My Project
Classes | Functions
TupleHash

Misuse-resistant cryptographic hash function and XOF for hashing a tuple of byte strings, as defined in section 5 of SP 800-185. More...

Classes

struct  tuplehash_str_t
 TupleHash tuple element. More...
 
struct  tuplehash_params_t
 TupleHash configuration parameters. More...
 

Functions

void tuplehash128 (const tuplehash_params_t params, uint8_t *dst, const size_t dst_len)
 Absorb data into TupleHash128, then squeeze bytes out. More...
 
void tuplehash256 (const tuplehash_params_t params, uint8_t *dst, const size_t dst_len)
 Absorb data into TupleHash256, then squeeze bytes out. More...
 
void tuplehash128_xof_init (sha3_xof_t *xof, const tuplehash_params_t params)
 Initialize a TupleHash128 XOF context. More...
 
void tuplehash128_xof_squeeze (sha3_xof_t *xof, uint8_t *dst, const size_t len)
 Squeeze data from TupleHash128 XOF context. More...
 
void tuplehash128_xof_once (const tuplehash_params_t params, uint8_t *dst, const size_t dst_len)
 Absorb data into TupleHash128 XOF, then squeeze bytes out. More...
 
void tuplehash256_xof_init (sha3_xof_t *xof, const tuplehash_params_t params)
 Initialize a TupleHash256 XOF context. More...
 
void tuplehash256_xof_squeeze (sha3_xof_t *xof, uint8_t *dst, const size_t len)
 Squeeze bytes from a TupleHash256 XOF context. More...
 
void tuplehash256_xof_once (const tuplehash_params_t params, uint8_t *dst, const size_t len)
 Absorb data into TupleHash256 XOF, then squeeze bytes out. More...
 

Detailed Description

Misuse-resistant cryptographic hash function and XOF for hashing a tuple of byte strings, as defined in section 5 of SP 800-185.

Function Documentation

◆ tuplehash128()

void tuplehash128 ( const tuplehash_params_t  params,
uint8_t *  dst,
const size_t  dst_len 
)

Absorb data into TupleHash128, then squeeze bytes out.

Initialize internal TupleHash128 (NIST SP 800-185, section 5) context with configuration parameters params, then squeeze dst_len bytes of output from internal context into destination buffer dst.

Parameters
[in]paramsTupleHash128 configuration parameters.
[out]dstDestination buffer.
[in]dst_lenDestination buffer length, in bytes.

◆ tuplehash128_xof_init()

void tuplehash128_xof_init ( sha3_xof_t xof,
const tuplehash_params_t  params 
)

Initialize a TupleHash128 XOF context.

Initialize TupleHash128 XOF (TupleHash eXtendable Output Function, as defined in section 5.3.1 of NIST SP 800-185) context with configuration parameters params.

Note: TupleHash128 and TupleHash128 XOF produce different output, because TupleHash128 encodes the fixed output size as part of the input while TupleHash128 XOF does not. See section 5.3.1 of NIST SP 800-185 for details.

Parameters
[out]xofTupleHash128 XOF context.
[in]paramsTupleHash configuration parameters.

◆ tuplehash128_xof_once()

void tuplehash128_xof_once ( const tuplehash_params_t  params,
uint8_t *  dst,
const size_t  dst_len 
)

Absorb data into TupleHash128 XOF, then squeeze bytes out.

Initialize internal TupleHash128 XOF (TupleHash eXtendable Output Function, as defined in section 5 of NIST SP 800-185) context with configuration parameters params, then squeeze dst_len bytes of output into destination buffer dst.

Note: TupleHash128 and TupleHash128 XOF produce different output, because TupleHash128 encodes the fixed output size as part of the input while TupleHash128 XOF does not. See section 5.3.1 of NIST SP 800-185 for details.

Parameters
[in]paramsTupleHash128 configuration parameters.
[out]dstDestination buffer.
[in]dst_lenDestination buffer length, in bytes.

◆ tuplehash128_xof_squeeze()

void tuplehash128_xof_squeeze ( sha3_xof_t xof,
uint8_t *  dst,
const size_t  len 
)

Squeeze data from TupleHash128 XOF context.

Squeeze len bytes of output into destination buffer dst from TupleHash128 XOF context xof. Can be called iteratively to squeeze output data in chunks.

Note: TupleHash128 and TupleHash128 XOF produce different output, because TupleHash128 encodes the fixed output size as part of the input while TupleHash128 XOF does not. See section 5.3.1 of NIST SP 800-185 for details.

Parameters
[in,out]xofTupleHash128 XOF context.
[out]dstDestination buffer.
[in]lenDestination buffer length, in bytes.

◆ tuplehash256()

void tuplehash256 ( const tuplehash_params_t  params,
uint8_t *  dst,
const size_t  dst_len 
)

Absorb data into TupleHash256, then squeeze bytes out.

Initialize internal TupleHash256 (NIST SP 800-185, section 5) context with configuration parameters params, then squeeze dst_len bytes of output from internal context into destination buffer dst.

Parameters
[in]paramsTupleHash256 configuration parameters.
[out]dstDestination buffer.
[in]dst_lenDestination buffer length, in bytes.

◆ tuplehash256_xof_init()

void tuplehash256_xof_init ( sha3_xof_t xof,
const tuplehash_params_t  params 
)

Initialize a TupleHash256 XOF context.

Initialize TupleHash256 XOF (TupleHash eXtendable Output Function, as defined in section 5.3.1 of NIST SP 800-185) context with configuration parameters params.

Note: TupleHash256 and TupleHash256 XOF produce different output, because TupleHash256 encodes the fixed output size as part of the input while TupleHash256 XOF does not. See section 5.3.1 of NIST SP 800-185 for details.

Parameters
[out]xofTupleHash256 XOF context.
[in]paramsTupleHash configuration parameters.

◆ tuplehash256_xof_once()

void tuplehash256_xof_once ( const tuplehash_params_t  params,
uint8_t *  dst,
const size_t  len 
)

Absorb data into TupleHash256 XOF, then squeeze bytes out.

Initialize internal TupleHash256 XOF (TupleHash eXtendable Output Function, as defined in section 5 of NIST SP 800-185) context with configuration parameters params, then squeeze dst_len bytes of output into destination buffer dst.

Note: TupleHash256 and TupleHash256 XOF produce different output, because TupleHash256 encodes the fixed output size as part of the input while TupleHash256 XOF does not. See section 5.3.1 of NIST SP 800-185 for details.

Parameters
[in]paramsTupleHash256 configuration parameters.
[out]dstDestination buffer.
[in]lenDestination buffer length, in bytes.

◆ tuplehash256_xof_squeeze()

void tuplehash256_xof_squeeze ( sha3_xof_t xof,
uint8_t *  dst,
const size_t  len 
)

Squeeze bytes from a TupleHash256 XOF context.

Squeeze len bytes of output into destination buffer dst from TupleHash256 XOF context xof. Can be called iteratively to squeeze output data in chunks.

Note: TupleHash256 and TupleHash256 XOF produce different output, because TupleHash256 encodes the fixed output size as part of the input while TupleHash256 XOF does not. See section 5.3.1 of NIST SP 800-185 for details.

Parameters
[in,out]xofTupleHash256 XOF context.
[out]dstDestination buffer.
[in]lenDestination buffer length, in bytes.