My Project
Classes | Functions
ParallelHash

Hash function and XOF, as defined in section 6 of SP 800-185. More...

Classes

struct  parallelhash_params_t
 ParallelHash configuration parameters. More...
 
struct  parallelhash_t
 ParallelHash context (all members are private). More...
 

Functions

void parallelhash128 (const parallelhash_params_t params, const uint8_t *src, const size_t src_len, uint8_t *dst, const size_t dst_len)
 Absorb data into ParallelHash128, then squeeze bytes out. More...
 
void parallelhash256 (const parallelhash_params_t params, const uint8_t *src, const size_t src_len, uint8_t *dst, const size_t dst_len)
 Absorb data into ParallelHash256, then squeeze bytes out. More...
 
void parallelhash128_xof_init (parallelhash_t *xof, const parallelhash_params_t params)
 Initialize a ParallelHash128 XOF context. More...
 
void parallelhash128_xof_absorb (parallelhash_t *hash, const uint8_t *src, const size_t len)
 Absorb data into a ParallelHash128 XOF context. More...
 
void parallelhash128_xof_squeeze (parallelhash_t *xof, uint8_t *dst, const size_t len)
 Squeeze bytes from a ParallelHash128 XOF context. More...
 
void parallelhash128_xof_once (const parallelhash_params_t params, const uint8_t *src, const size_t src_len, uint8_t *dst, const size_t dst_len)
 Absorb bytes into ParallelHash128 XOF, then squeeze bytes out. More...
 
void parallelhash256_xof_init (parallelhash_t *xof, const parallelhash_params_t params)
 Initialize a ParallelHash256 XOF context. More...
 
void parallelhash256_xof_absorb (parallelhash_t *hash, const uint8_t *src, const size_t len)
 Absorb data into a ParallelHash256 XOF context. More...
 
void parallelhash256_xof_squeeze (parallelhash_t *xof, uint8_t *dst, const size_t len)
 Squeeze bytes from a ParallelHash256 XOF context. More...
 
void parallelhash256_xof_once (const parallelhash_params_t params, const uint8_t *src, const size_t src_len, uint8_t *dst, const size_t dst_len)
 Absorb bytes into ParallelHash256 XOF, then squeeze bytes out. More...
 

Detailed Description

Hash function and XOF, as defined in section 6 of SP 800-185.

Function Documentation

◆ parallelhash128()

void parallelhash128 ( const parallelhash_params_t  params,
const uint8_t *  src,
const size_t  src_len,
uint8_t *  dst,
const size_t  dst_len 
)

Absorb data into ParallelHash128, then squeeze bytes out.

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

Note: This implementation of ParallelHash128 is sequential, not parallel.

Note: This implementation of ParallelHash128 is sequential, not

Parameters
[in]paramsParallelHash128 configuration parameters.
[in]srcSource buffer.
[in]src_lenSource buffer length, in bytes.
[out]dstDestination buffer.
[in]dst_lenDestination buffer length, in bytes.

◆ parallelhash128_xof_absorb()

void parallelhash128_xof_absorb ( parallelhash_t hash,
const uint8_t *  src,
const size_t  len 
)

Absorb data into a ParallelHash128 XOF context.

Absorb data in buffer src of length len bytes into ParallelHash128 XOF context. Can be called iteratively to absorb input data in chunks.

Note: This implementation of ParallelHash128 is sequential, not parallel.

Parameters
[in,out]hashParallelHash128 XOF context.
[in]srcSource buffer.
[in]lenSource buffer length, in bytes.

◆ parallelhash128_xof_init()

void parallelhash128_xof_init ( parallelhash_t xof,
const parallelhash_params_t  params 
)

Initialize a ParallelHash128 XOF context.

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

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

Note: This implementation of ParallelHash128 is sequential, not parallel.

Parameters
[out]xofParallelHash128 XOF context.
[in]paramsParallelHash configuration parameters.

◆ parallelhash128_xof_once()

void parallelhash128_xof_once ( const parallelhash_params_t  params,
const uint8_t *  src,
const size_t  src_len,
uint8_t *  dst,
const size_t  dst_len 
)

Absorb bytes into ParallelHash128 XOF, then squeeze bytes out.

Initialize internal ParallelHash128 XOF (ParallelHash eXtendable Output Function, as defined in section 6.3.1 of NIST SP 800-185) context with configuration parameters params, absorb data in buffer src of length src_len bytes into context, then squeeze dst_len bytes of output into destination buffer dst.

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

Note: This implementation of ParallelHash128 is sequential, not parallel.

Parameters
[in]paramsParallelHash configuration parameters.
[in]srcSource buffer.
[in]src_lenSource buffer length, in bytes.
[out]dstDestination buffer.
[in]dst_lenDestination buffer length, in bytes.

◆ parallelhash128_xof_squeeze()

void parallelhash128_xof_squeeze ( parallelhash_t xof,
uint8_t *  dst,
const size_t  len 
)

Squeeze bytes from a ParallelHash128 XOF context.

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

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

Note: This implementation of ParallelHash128 is sequential, not parallel.

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

◆ parallelhash256()

void parallelhash256 ( const parallelhash_params_t  params,
const uint8_t *  src,
const size_t  src_len,
uint8_t *  dst,
const size_t  dst_len 
)

Absorb data into ParallelHash256, then squeeze bytes out.

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

Note: This implementation of ParallelHash256 is sequential, not parallel.

Parameters
[in]paramsParallelHash256 configuration parameters.
[in]srcSource buffer.
[in]src_lenSource buffer length, in bytes.
[out]dstDestination buffer.
[in]dst_lenDestination buffer length, in bytes.

◆ parallelhash256_xof_absorb()

void parallelhash256_xof_absorb ( parallelhash_t hash,
const uint8_t *  src,
const size_t  len 
)

Absorb data into a ParallelHash256 XOF context.

Absorb data in buffer src of length len bytes into ParallelHash256 XOF context. Can be called iteratively to absorb input data in chunks.

Note: This implementation of ParallelHash256 is sequential, not parallel.

Parameters
[in,out]hashParallelHash256 XOF context.
[in]srcSource buffer.
[in]lenSource buffer length, in bytes.

◆ parallelhash256_xof_init()

void parallelhash256_xof_init ( parallelhash_t xof,
const parallelhash_params_t  params 
)

Initialize a ParallelHash256 XOF context.

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

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

Note: This implementation of ParallelHash256 is sequential, not parallel.

Parameters
[out]xofParallelHash256 XOF context.
[in]paramsParallelHash configuration parameters.

◆ parallelhash256_xof_once()

void parallelhash256_xof_once ( const parallelhash_params_t  params,
const uint8_t *  src,
const size_t  src_len,
uint8_t *  dst,
const size_t  dst_len 
)

Absorb bytes into ParallelHash256 XOF, then squeeze bytes out.

Initialize internal ParallelHash256 XOF (ParallelHash eXtendable Output Function, as defined in section 6.3.1 of NIST SP 800-185) context with configuration parameters params, absorb src_len bytes if input from source buffer src, then squeeze dst_len bytes of output into destination buffer dst.

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

Note: This implementation of ParallelHash256 is sequential, not parallel.

Parameters
[in]paramsParallelHash configuration parameters.
[in]srcSource buffer.
[in]src_lenSource buffer length, in bytes.
[out]dstDestination buffer.
[in]dst_lenDestination buffer length, in bytes.

◆ parallelhash256_xof_squeeze()

void parallelhash256_xof_squeeze ( parallelhash_t xof,
uint8_t *  dst,
const size_t  len 
)

Squeeze bytes from a ParallelHash256 XOF context.

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

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

Note: This implementation of ParallelHash256 is sequential, not parallel.

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