sha3
Embeddable C11 SHA-3 implementation.
|
Misuse-resistant cryptographic hash function and XOF for hashing a tuple of byte strings, as defined in section 5 of SP 800-185. More...
Data Structures | |
struct | tuplehash_str_t |
Individual element of TupleHash tuple. More... | |
struct | tuplehash_params_t |
TupleHash configuration parameters. More... | |
Functions | |
void | tuplehash128 (const tuplehash_params_t params, uint8_t *dst, const size_t len) |
Absorb tuple and customization string into TupleHash128, then squeeze bytes out. More... | |
void | tuplehash256 (const tuplehash_params_t params, uint8_t *dst, const size_t len) |
Absorb tuple and customization string 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 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... | |
Misuse-resistant cryptographic hash function and XOF for hashing a tuple of byte strings, as defined in section 5 of SP 800-185.
void tuplehash128 | ( | const tuplehash_params_t | params, |
uint8_t * | dst, | ||
const size_t | len | ||
) |
Absorb tuple and customization string into TupleHash128, then squeeze bytes out.
Initialize internal TupleHash128 (NIST SP 800-185, section 5) context with configuration parameters params
, then squeeze len
bytes of output from internal context into destination buffer dst
.
[in] | params | TupleHash128 configuration parameters. |
[out] | dst | Destination buffer. |
[in] | len | Destination buffer length, in bytes. |
Example:
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
.
[out] | xof | TupleHash128 XOF context. |
[in] | params | TupleHash configuration parameters. |
Example:
void tuplehash128_xof_once | ( | const tuplehash_params_t | params, |
uint8_t * | dst, | ||
const size_t | 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 len
bytes of output into destination buffer dst
.
[in] | params | TupleHash128 configuration parameters. |
[out] | dst | Destination buffer. |
[in] | len | Destination buffer length, in bytes. |
Example:
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.
[in,out] | xof | TupleHash128 XOF context. |
[out] | dst | Destination buffer. |
[in] | len | Destination buffer length, in bytes. |
Example:
void tuplehash256 | ( | const tuplehash_params_t | params, |
uint8_t * | dst, | ||
const size_t | len | ||
) |
Absorb tuple and customization string into TupleHash256, then squeeze bytes out.
Initialize internal TupleHash256 (NIST SP 800-185, section 5) context with configuration parameters params
, then squeeze len
bytes of output from internal context into destination buffer dst
.
[in] | params | TupleHash256 configuration parameters. |
[out] | dst | Destination buffer. |
[in] | len | Destination buffer length, in bytes. |
Example:
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
.
[out] | xof | TupleHash256 XOF context. |
[in] | params | TupleHash configuration parameters. |
Example:
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 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.
[in] | params | TupleHash256 configuration parameters. |
[out] | dst | Destination buffer. |
[in] | len | Destination buffer length, in bytes. |
Example:
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.
[in,out] | xof | TupleHash256 XOF context. |
[out] | dst | Destination buffer. |
[in] | len | Destination buffer length, in bytes. |
Example: