Skip to content
uencoder

TupleHash

TupleHash is the Keccak hash for tuples of byte strings defined in NIST SP 800-185, ensuring that different tuple structures do not collide.

Purpose

Provides unambiguous hashing for tuples of variable-length fields, avoiding delimiter-injection collisions — suited to structured record digests.

Mechanism

Each field is encoded as right_encode(length) || field content and concatenated, with a final cSHAKE output. The length-prefix encoding ensures (ab, c) and (a, bc) produce different inputs.

Use cases

  • Structured record hashing
  • Database row digests
  • Unambiguous tuple encoding

Related tools

References