TupleHashXOF128
Hash an ordered tuple of byte strings without length-extension ambiguity, at any output length.
Calculate TupleHashXOF128 (NIST SP 800-185) of an ordered tuple at any output length. Free, offline, runs client-side. Read more Show less
What is TupleHashXOF128?
TupleHashXOF128 is the extendable-output variant of TupleHash128 (NIST SP 800-185). It hashes an ordered tuple of byte strings - with no length-extension ambiguity - at any output length the caller requests.
TupleHash encodes the length of each element before hashing it, so ("ab", "c") and ("a", "bc") produce completely different outputs. TupleHashXOF128 does the same, but with the XOF length encoding so the output length can be chosen at runtime.
How to use
Enter one tuple element per line. Each line is treated as a separate byte string. Empty lines are preserved - an empty line is a valid empty byte string, and it changes the output.
Choose the output length in bits. Optionally provide a customization string for domain separation.
TupleHash128 vs TupleHashXOF128
The two tools produce different outputs for the same inputs, because the SP 800-185 length encoding differs. Use TupleHash128 when the digest length is fixed by a protocol. Use TupleHashXOF128 when you want to choose or change the output length at runtime, or when the output is used as a key derivation stream.
FAQ
Is TupleHashXOF128 deterministic?
Yes. Same tuple, same customization string, same output length - same output.
TupleHashXOF128 vs TupleHashXOF256?
Same construction, different underlying cSHAKE width. The 128 variant gives 128-bit security; the 256 variant gives 256-bit. See TupleHashXOF256.
Is TupleHashXOF128 a MAC?
No. It is unkeyed. For keyed authentication, use KMAC (see KMACXOF128) with the tuple encoded inside the message.
How many elements can I hash?
No practical limit. The tool processes each line in order. For very large tuples, use a native library.
Command line equivalent
# Node with @noble/hashes
npm i @noble/hashes
node --input-type=module -e '
import { tuplehash128xof } from "@noble/hashes/sha3-addons";
const out = tuplehash128xof([new TextEncoder().encode("a"), new TextEncoder().encode("b"), new TextEncoder().encode("c")], { dkLen: 32 });
console.log(Buffer.from(out).toString("hex"));
'