Hasty Briefsbeta

Bilingual

SequenceHash: Multihashing for the rest of us

7 hours ago
  • Trail of Bits introduces SequenceHash and SequenceMAC, hash-agnostic multihashing constructs that prevent ambiguous input encoding and length extension attacks.
  • They work with any secure hash function (SHA2, BLAKE, RIPEMD) and are not tied to a single hash like NIST's TupleHash.
  • Features include unambiguous length-suffix encoding, length-extension resistance via double-hash, optional customization strings for domain separation, and a keyed MAC mode (SequenceMAC) with keys ≥32 bytes.
  • Initial implementations are available in Rust, Go, and Python, with test vectors including intermediate values for debugging.
  • SequenceHash and SequenceMAC help prevent forgeries in zero-knowledge proofs (e.g., Fiat-Shamir transforms) and secure cryptographic commitments.
  • They are not a panacea; users must ensure consistent input encoding (e.g., avoid JSON field ordering issues) and include all relevant values in protocols.