DoxigAlpha

TupleHash

The TupleHash extendable output hash function, with domain-separated inputs. TupleHash is a secure hash function with a variable output length, based on the cSHAKE function. It is designed for unambiguously hashing tuples of data.

With most hash functions, calling update("A") followed by update("B")is identical to update("AB"). With TupleHash, this is not the case: update("A"); update("B") is different from update("AB").

Any number of inputs can be hashed, and the output depends on individual inputs and their order.

Fields of this type

Fields

#
cshaker:CShaker
xof_mode:bool
= false

TupleHash options can include a context string.

Types

#
Options
TupleHash options can include a context string.

Initialize a state for the TupleHash function, with an optional context.

Functions

#
initWithOptions
Initialize a state for the TupleHash function, with an optional context.
init
Initialize a state for the MAC function.
update
Add data to the state, separated from previous updates.
final
Return an authentication tag for the current state.
fillBlock
Align the input to a block boundary.
squeeze
Squeeze a slice of bytes from the state.

Error sets in this namespace

Error Sets

#

The output length, in bytes.

Values

#
digest_length
The output length, in bytes.
block_length
The block length, or rate, in bytes.

Source

Implementation

#
pub fn TupleHash(comptime security_level: u11) type {
    return TupleHashLike(security_level, 0x04, 24);
}