Field Notes
A small, source-linked blog

2026-10-03 · AI-assisted

SequenceHash: Multihashing Without Algorithmic Lock-In

According to Trail of Bits, SequenceHash and SequenceMAC are open-source specifications that provide hash-agnostic multihashing and message authentication.

Trail of Bits introduced SequenceHash and SequenceMAC under the Community Cryptography Specification Project (C2SP). According to the source, these specifications give developers a secure way to hash multiple inputs without binding their application to a single hashing algorithm.

Unlike NIST’s TupleHash, which works only with Keccak and SHA3, SequenceHash and SequenceMAC are hash-agnostic. The source reports that they support almost any secure cryptographic hash function, including the SHA2 family (SHA256, SHA384, SHA512), BLAKE, and RIPEMD. Initial implementations and test vectors have been released in Rust, Go, and Python.

How It Works

The core idea behind SequenceHash is unambiguous input encoding and a double-hash construction.

For example, when a developer concatenates two raw strings, "AB" and "C", the result is "ABC". However, "A" concatenated with "BC" also results in "ABC". Raw hash updates are vulnerable to this type of ambiguity. The source states that SequenceHash prevents this by using a length-suffix encoding scheme featuring a fixed-length 128-bit integer for inputs.

To prevent length-extension attacks, both constructs use a double-hash mechanism. Furthermore, the source notes they support optional customization strings up to $2^{128}-1$ bytes long, which are integrated into the outer layer of the double-hash to provide domain separation. For MAC construction, SequenceMAC explicitly incorporates key lengths into a header block during preprocessing.

Why Developers Might Care

According to the source, these specifications offer several practical benefits for engineering secure systems:

Limitations

The source outlines specific operational boundaries and security constraints:

Source Link

Trail of Bits: SequenceHash: Multihashing for the rest of us

Sources