My Project
|
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... | |
Hash function and XOF, as defined in section 6 of SP 800-185.
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
[in] | params | ParallelHash128 configuration parameters. |
[in] | src | Source buffer. |
[in] | src_len | Source buffer length, in bytes. |
[out] | dst | Destination buffer. |
[in] | dst_len | Destination buffer length, in bytes. |
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.
[in,out] | hash | ParallelHash128 XOF context. |
[in] | src | Source buffer. |
[in] | len | Source buffer length, in bytes. |
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.
[out] | xof | ParallelHash128 XOF context. |
[in] | params | ParallelHash configuration parameters. |
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.
[in] | params | ParallelHash configuration parameters. |
[in] | src | Source buffer. |
[in] | src_len | Source buffer length, in bytes. |
[out] | dst | Destination buffer. |
[in] | dst_len | Destination buffer length, in bytes. |
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.
[in,out] | xof | ParallelHash128 XOF context. |
[out] | dst | Destination buffer. |
[in] | len | Destination buffer length, in bytes. |
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.
[in] | params | ParallelHash256 configuration parameters. |
[in] | src | Source buffer. |
[in] | src_len | Source buffer length, in bytes. |
[out] | dst | Destination buffer. |
[in] | dst_len | Destination buffer length, in bytes. |
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.
[in,out] | hash | ParallelHash256 XOF context. |
[in] | src | Source buffer. |
[in] | len | Source buffer length, in bytes. |
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.
[out] | xof | ParallelHash256 XOF context. |
[in] | params | ParallelHash configuration parameters. |
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.
[in] | params | ParallelHash configuration parameters. |
[in] | src | Source buffer. |
[in] | src_len | Source buffer length, in bytes. |
[out] | dst | Destination buffer. |
[in] | dst_len | Destination buffer length, in bytes. |
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.
[in,out] | xof | ParallelHash256 XOF context. |
[out] | dst | Destination buffer. |
[in] | len | Destination buffer length, in bytes. |