# TupleHash

> cryptographic hash function

**Wikidata**: [Q131904302](https://www.wikidata.org/wiki/Q131904302)  
**Source**: https://4ort.xyz/entity/tuplehash

## Summary
TupleHash is a cryptographic hash function variant designed to handle arbitrary-length input tuples and produce variable-length outputs. It is specified in NIST SP 800-185 and includes variants like TupleHash128 and TupleHash256.

## Key Facts
- TupleHash is a subclass of cryptographic hash function.
- Aliases include TupleHash128, TupleHash256, TupleHashXOF128, and TupleHashXOF256.
- Described by the source document: NIST SP 800-185.
- Its wikidata classification is cryptographic hash function.
- Designed to accept inputs consisting of arbitrary numbers of elements (tuples).
- Capable of producing outputs of variable lengths, including extendable-output functions (XOFs).
- Part of a class of hash functions possessing specific cryptographic properties.

## FAQs
### Q: What is TupleHash?
A: TupleHash is a cryptographic hash function specifically designed to hash inputs that are tuples, meaning they can contain any number of elements, and to produce outputs of flexible lengths. It is defined in NIST SP 800-185.

### Q: How does TupleHash differ from standard hash functions?
A: Unlike many common hash functions that take a single string or binary input, TupleHash is designed to handle inputs structured as arbitrary-length tuples (multiple elements). It also supports generating outputs of variable length, including extendable output.

### Q: What are the main variants of TupleHash?
A: The primary variants mentioned are TupleHash128, TupleHash256, TupleHashXOF128, and TupleHashXOF256, where the numbers typically denote the nominal output size in bits.

### Q: Where is TupleHash standardized?
A: TupleHash is described and defined in NIST Special Publication 800-185, "SHA-3 Derived Functions: cSHAKE, KMAC, TupleHash, and ParallelHash."

### Q: What makes TupleHash suitable for cryptographic use?
A: As a cryptographic hash function, TupleHash possesses properties like preimage resistance, second preimage resistance, and collision resistance, making it suitable for security applications involving arbitrary tuple inputs.

## Why It Matters
TupleHash addresses a specific need in cryptography for hashing structured data where the input naturally consists of multiple distinct elements (a tuple). Traditional hash functions often require concatenating these elements into a single string, which can be inefficient or complex. TupleHash provides a direct and efficient mechanism to hash such inputs while maintaining strong cryptographic properties. Its support for variable-length outputs, including extendable outputs (XOFs), adds significant flexibility for applications requiring different output sizes or on-demand output generation, expanding the toolkit available for secure cryptographic constructions and protocols.

## Notable For
- Supporting arbitrary-length tuple inputs directly, eliminating the need for pre-processing concatenation.
- Offering variable-length output capability, including extendable output functions (XOFs) like TupleHashXOF.
- Being formally specified in NIST SP 800-185, a key standard for SHA-3 derived functions.
- Providing a specialized solution for hashing structured, multi-element data within the cryptographic hash function framework.

## Body
### Definition and Classification
TupleHash is a specific cryptographic hash function. It is formally classified as a subclass of the broader cryptographic hash function class. Its core purpose is to hash inputs structured as arbitrary-length tuples.

### Specification and Source
TupleHash is described and defined in detail within NIST Special Publication 800-185 ("SHA-3 Derived Functions: cSHAKE, KMAC, TupleHash, and ParallelHash"). This document serves as its primary specification and reference source.

### Input Structure
A defining characteristic of TupleHash is its ability to accept inputs consisting of any number of discrete elements, known as a tuple. This contrasts with hash functions typically limited to a single contiguous input string. Each element within the tuple can be a string of arbitrary length.

### Output Capabilities
TupleHash variants produce outputs of different nominal lengths, such as 128 bits or 256 bits. Critically, certain variants (TupleHashXOF128, TupleHashXOF256) are designed as extendable-output functions (XOFs), allowing the generation of outputs of virtually any desired length from the same fixed-size underlying state.

### Relationship to Other Functions
TupleHash is one of the SHA-3 derived functions specified in NIST SP 800-185, alongside others like cSHAKE, KMAC, and ParallelHash. It shares the core sponge construction principles of the SHA-3 (Keccak) family.