# SequenceHash: multihashing for the rest of us

DevFeed: [SequenceHash: multihashing for the rest of us](<https://devfeed.tech/articles/sequencehash-multihashing-for-the-rest-of-us-64138.md>)

Original publisher: [Read original article](<https://blog.trailofbits.com/2026/10/02/sequencehash-multihashing-for-the-rest-of-us/>)

Author: "Opal Wright"

Published: 2026-10-02T11:00:00Z

Content type: article

Language: en

Sources: [The Trail of Bits Blog](<https://devfeed.tech/sources/the-trail-of-bits-blog-2.md>), [Trail of Bits](<https://devfeed.tech/sources/the-trail-of-bits-blog.md>)

Topics: [Cryptography](<https://devfeed.tech/topics/cryptography.md>), [hashing](<https://devfeed.tech/topics/hashing.md>), [Memory Safety](<https://devfeed.tech/topics/memory-safety.md>)

Tags: [cryptography](<https://devfeed.tech/tags/cryptography.md>), [go](<https://devfeed.tech/tags/go.md>), [hashing](<https://devfeed.tech/tags/hashing.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [python](<https://devfeed.tech/tags/python.md>), [rust](<https://devfeed.tech/tags/rust.md>), [security](<https://devfeed.tech/tags/security.md>), [sha256](<https://devfeed.tech/tags/sha256.md>), [zero-knowledge](<https://devfeed.tech/tags/zero-knowledge.md>)

## AI overview

Trail of Bits introduces SequenceHash and SequenceMAC, hash-agnostic constructions for securely hashing multiple inputs without ambiguous encodings. The article describes their length-extension protections, customization strings, implementations in Rust, Go, and Python, and test vectors. The specification is part of C2SP. It notes that security depends on the underlying hash and that an XOF variant has not yet been specified.

## Source excerpt

Multihashing is one of those cryptographic tasks that's easy not to think about too much. This is unfortunate, because multihashing is a common stumbling point when cryptographers try to use hashes. As part of our goal to "fix software, not bugs," Trail of Bits is introducing SequenceHash and its sister function SequenceMAC, a pair of related hash constructions that bring secure multihashing to developers using hash functions other than Keccak. We hope SequenceHash and SequenceMAC will help cryptographers avoid attacks that take advantage of ambiguous input encodings. The specification is open source, and is now a part of the Community Cryptography Specification Project (C2SP). SequenceHash and SequenceMAC behave similarly to NIST's TupleHash, but have the advantage of not being tied to a single hash function. They also don't require developers to implement fiddly computations that aren't byte-aligned. Instead, SequenceHash and SequenceMAC work out of the box with nearly any secure cryptographic hash function you care to use, including SHA256/384/512, BLAKE, and RIPEMD. SequenceMAC supports keys 32 bytes or longer (up to the ridiculous limit of ${2}^{128}-1$ bytes). (It's worth noting: SequenceHash and SequenceMAC rely on the security of the underlying hash for their own security. SequenceHash and SequenceMAC can't magically make MD4 or SHA0 secure again. For the purposes of this document, it's assumed that you have chosen a reasonable hash function like SHA256, not CRC32.) To make SequenceHash and SequenceMAC easy to use, we're releasing three initial implementations of SequenceHash and SequenceMAC: one each in Rust, Go, and Python. We're also releasing a large set of test vectors that cover multiple hash functions and include intermediate values to help developers debug and verify their implementations. Wait, "multihashing"? Yeah, it's a weird term, but the idea is pretty simple. "Multihashing" means "hashing a bunch of values together." If you've ever read a cryp