My Project
|
HMAC instantiated with SHA-3 hash functions, as specified in section 7 of FIPS 202, RFC 2104, and FIPS 198-1. More...
Classes | |
struct | hmac_sha3_t |
HMAC-SHA3 (Hash-based Message Authentication Code) context. More... | |
Functions | |
void | hmac_sha3_224 (const uint8_t *k, const size_t k_len, const uint8_t *m, const size_t m_len, uint8_t dst[28]) |
Calculat HMAC-SHA3-224 of given key and data. More... | |
void | hmac_sha3_256 (const uint8_t *k, const size_t k_len, const uint8_t *m, const size_t m_len, uint8_t dst[32]) |
Calculate HMAC-SHA3-256 given key and data. More... | |
void | hmac_sha3_384 (const uint8_t *k, const size_t k_len, const uint8_t *m, const size_t m_len, uint8_t dst[48]) |
void | hmac_sha3_512 (const uint8_t *k, const size_t k_len, const uint8_t *m, const size_t m_len, uint8_t dst[64]) |
Calculate HMAC-SHA3-512 of given key and data. More... | |
void | hmac_sha3_224_init (hmac_sha3_t *hmac, const uint8_t *k, const size_t k_len) |
Initialize HMAC-SHA3-224 (FIPS 202, Section 7) context. More... | |
_Bool | hmac_sha3_224_absorb (hmac_sha3_t *hmac, const uint8_t *src, const size_t len) |
Absorb data into HMAC-SHA3-224 context. More... | |
void | hmac_sha3_224_final (hmac_sha3_t *hmac, uint8_t dst[28]) |
Finalize HMAC-SHA3-224 hash context and write 28 bytes of output to destination buffer dst . More... | |
void | hmac_sha3_256_init (hmac_sha3_t *hmac, const uint8_t *k, const size_t k_len) |
Initialize HMAC-SHA3-256 (FIPS 202, Section 7) context. More... | |
_Bool | hmac_sha3_256_absorb (hmac_sha3_t *hmac, const uint8_t *src, const size_t len) |
Absorb data into HMAC-SHA3-256 context. More... | |
void | hmac_sha3_256_final (hmac_sha3_t *hmac, uint8_t dst[32]) |
Finalize HMAC-SHA3-256 hash context and write 32 bytes of output to destination buffer dst . More... | |
void | hmac_sha3_384_init (hmac_sha3_t *hmac, const uint8_t *k, const size_t k_len) |
Initialize HMAC-SHA3-384 (FIPS 202, Section 7) context. More... | |
_Bool | hmac_sha3_384_absorb (hmac_sha3_t *hmac, const uint8_t *src, const size_t len) |
Absorb data into HMAC-SHA3-384 context. More... | |
void | hmac_sha3_384_final (hmac_sha3_t *hmac, uint8_t dst[48]) |
Finalize HMAC-SHA3-384 hash context and write 48 bytes of output to destination buffer dst . More... | |
void | hmac_sha3_512_init (hmac_sha3_t *hmac, const uint8_t *k, const size_t k_len) |
Initialize HMAC-SHA3-512 (FIPS 202, Section 7) context. More... | |
_Bool | hmac_sha3_512_absorb (hmac_sha3_t *hmac, const uint8_t *src, const size_t len) |
Absorb data into HMAC-SHA3-512 context. More... | |
void | hmac_sha3_512_final (hmac_sha3_t *hmac, uint8_t dst[64]) |
Finalize HMAC-SHA3-512 hash context and write 64 bytes of output to destination buffer dst . More... | |
HMAC instantiated with SHA-3 hash functions, as specified in section 7 of FIPS 202, RFC 2104, and FIPS 198-1.
void hmac_sha3_224 | ( | const uint8_t * | k, |
const size_t | k_len, | ||
const uint8_t * | m, | ||
const size_t | m_len, | ||
uint8_t | dst[28] | ||
) |
Calculat HMAC-SHA3-224 of given key and data.
Calculate HMAC-SHA3-224 (FIPS 202, Section 7) of key in buffer k
of length k_len
and input message in buffer m
of length m_len
bytes and write 28 bytes of output to destination buffer dst
.
[in] | k | Key. |
[in] | k_len | Key length, in bytes. |
[in] | m | Input message. |
[in] | m_len | Input message length, in bytes. |
[out] | dst | Destination array. Must be at least 28 bytes in length. |
_Bool hmac_sha3_224_absorb | ( | hmac_sha3_t * | hmac, |
const uint8_t * | src, | ||
const size_t | len | ||
) |
Absorb data into HMAC-SHA3-224 context.
Absorb input data in src
of length len
bytes into HMAC-SHA3-224 context hmac
. Can be called iteratively to absorb input data in chunks.
[in,out] | hmac | HMAC-SHA3-224 context. |
[in] | src | Input data. |
[in] | len | Input data length, in bytes. |
void hmac_sha3_224_final | ( | hmac_sha3_t * | hmac, |
uint8_t | dst[28] | ||
) |
Finalize HMAC-SHA3-224 hash context and write 28 bytes of output to destination buffer dst
.
[in,out] | hmac | HMAC-SHA3-224 hash context. |
[out] | dst | Destination buffer. Must be at least 28 bytes in length. |
void hmac_sha3_224_init | ( | hmac_sha3_t * | hmac, |
const uint8_t * | k, | ||
const size_t | k_len | ||
) |
Initialize HMAC-SHA3-224 (FIPS 202, Section 7) context.
[out] | hmac | HMAC-SHA3-224 context. |
[in] | k | Key. |
[in] | k_len | Key length, in bytes. |
void hmac_sha3_256 | ( | const uint8_t * | k, |
const size_t | k_len, | ||
const uint8_t * | m, | ||
const size_t | m_len, | ||
uint8_t | dst[32] | ||
) |
Calculate HMAC-SHA3-256 given key and data.
Calculate HMAC-SHA3-256 (FIPS 202, Section 7) of key in buffer k
of length k_len
and input message in buffer m
of length m_len
bytes and write 32 bytes of output to destination buffer dst
.
[in] | k | Key. |
[in] | k_len | Key length, in bytes. |
[in] | m | Input message. |
[in] | m_len | Input message length, in bytes. |
[out] | dst | Destination array. Must be at least 32 bytes in length. |
_Bool hmac_sha3_256_absorb | ( | hmac_sha3_t * | hmac, |
const uint8_t * | src, | ||
const size_t | len | ||
) |
Absorb data into HMAC-SHA3-256 context.
Absorb input data in src
of length len
bytes into HMAC-SHA3-256 context hmac
. Can be called iteratively to absorb input data in chunks.
[in,out] | hmac | HMAC-SHA3-256 context. |
[in] | src | Input data. |
[in] | len | Input data length, in bytes. |
void hmac_sha3_256_final | ( | hmac_sha3_t * | hmac, |
uint8_t | dst[32] | ||
) |
Finalize HMAC-SHA3-256 hash context and write 32 bytes of output to destination buffer dst
.
[in,out] | hmac | HMAC-SHA3-256 hash context. |
[out] | dst | Destination buffer. Must be at least 32 bytes in length. |
void hmac_sha3_256_init | ( | hmac_sha3_t * | hmac, |
const uint8_t * | k, | ||
const size_t | k_len | ||
) |
Initialize HMAC-SHA3-256 (FIPS 202, Section 7) context.
[out] | hmac | HMAC-SHA3-256 context. |
[in] | k | Key. |
[in] | k_len | Key length, in bytes. |
void hmac_sha3_384 | ( | const uint8_t * | k, |
const size_t | k_len, | ||
const uint8_t * | m, | ||
const size_t | m_len, | ||
uint8_t | dst[48] | ||
) |
Calculate HMAC-SHA3-384 of given key and data.
Calculate HMAC-SHA3-384 (FIPS 202, Section 7) of key in buffer k
of length k_len
and input message in buffer m
of length m_len
bytes and write 48 bytes of output to destination buffer dst
.
[in] | k | Key. |
[in] | k_len | Key length, in bytes. |
[in] | m | Input message. |
[in] | m_len | Input message length, in bytes. |
[out] | dst | Destination array. Must be at least 48 bytes in length. |
_Bool hmac_sha3_384_absorb | ( | hmac_sha3_t * | hmac, |
const uint8_t * | src, | ||
const size_t | len | ||
) |
Absorb data into HMAC-SHA3-384 context.
Absorb input data in src
of length len
bytes into HMAC-SHA3-384 context hmac
. Can be called iteratively to absorb input data in chunks.
[in,out] | hmac | HMAC-SHA3-384 context. |
[in] | src | Input data. |
[in] | len | Input data length, in bytes. |
void hmac_sha3_384_final | ( | hmac_sha3_t * | hmac, |
uint8_t | dst[48] | ||
) |
Finalize HMAC-SHA3-384 hash context and write 48 bytes of output to destination buffer dst
.
[in,out] | hmac | HMAC-SHA3-384 hash context. |
[out] | dst | Destination buffer. Must be at least 48 bytes in length. |
void hmac_sha3_384_init | ( | hmac_sha3_t * | hmac, |
const uint8_t * | k, | ||
const size_t | k_len | ||
) |
Initialize HMAC-SHA3-384 (FIPS 202, Section 7) context.
[out] | hmac | HMAC-SHA3-384 context. |
[in] | k | Key. |
[in] | k_len | Key length, in bytes. |
void hmac_sha3_512 | ( | const uint8_t * | k, |
const size_t | k_len, | ||
const uint8_t * | m, | ||
const size_t | m_len, | ||
uint8_t | dst[64] | ||
) |
Calculate HMAC-SHA3-512 of given key and data.
Calculate HMAC-SHA3-512 (FIPS 202, Section 7) of key in buffer k
of length k_len
and input message in buffer m
of length m_len
bytes and write 64 bytes of output to destination buffer dst
.
[in] | k | Key. |
[in] | k_len | Key length, in bytes. |
[in] | m | Input message. |
[in] | m_len | Input message length, in bytes. |
[out] | dst | Destination array. Must be at least 64 bytes in length. |
_Bool hmac_sha3_512_absorb | ( | hmac_sha3_t * | hmac, |
const uint8_t * | src, | ||
const size_t | len | ||
) |
Absorb data into HMAC-SHA3-512 context.
Absorb input data in src
of length len
bytes into HMAC-SHA3-512 context hmac
. Can be called iteratively to absorb input data in chunks.
[in,out] | hmac | HMAC-SHA3-512 context. |
[in] | src | Input data. |
[in] | len | Input data length, in bytes. |
void hmac_sha3_512_final | ( | hmac_sha3_t * | hmac, |
uint8_t | dst[64] | ||
) |
Finalize HMAC-SHA3-512 hash context and write 64 bytes of output to destination buffer dst
.
[in,out] | hmac | HMAC-SHA3-512 hash context. |
[out] | dst | Destination buffer. Must be at least 64 bytes in length. |
void hmac_sha3_512_init | ( | hmac_sha3_t * | hmac, |
const uint8_t * | k, | ||
const size_t | k_len | ||
) |
Initialize HMAC-SHA3-512 (FIPS 202, Section 7) context.
[out] | hmac | HMAC-SHA3-512 context. |
[in] | k | Key. |
[in] | k_len | Key length, in bytes. |