libdecaf
|
SHA2-512. More...
Go to the source code of this file.
Classes | |
struct | decaf_keccak_sponge_s |
Sponge container object for the various primitives. More... | |
Typedefs | |
typedef struct decaf_keccak_sponge_s | decaf_keccak_sponge_s |
Sponge container object for the various primitives. | |
typedef struct decaf_keccak_sponge_s | decaf_keccak_sponge_t[1] |
Convenience GMP-style one-element array version. | |
Functions | |
void DECAF_API_VIS | decaf_sha3_init (decaf_keccak_sponge_t sponge, const struct decaf_kparams_s *params) |
Initialize a sponge context object. More... | |
decaf_error_t DECAF_API_VIS | decaf_sha3_update (struct decaf_keccak_sponge_s *__restrict__ sponge, const uint8_t *in, size_t len) |
Absorb data into a DECAF_SHA3 or DECAF_SHAKE hash context. More... | |
decaf_error_t DECAF_API_VIS | decaf_sha3_output (decaf_keccak_sponge_t sponge, uint8_t *__restrict__ out, size_t len) |
Squeeze output data from a DECAF_SHA3 or DECAF_SHAKE hash context. More... | |
decaf_error_t DECAF_API_VIS | decaf_sha3_final (decaf_keccak_sponge_t sponge, uint8_t *__restrict__ out, size_t len) |
Squeeze output data from a DECAF_SHA3 or DECAF_SHAKE hash context. More... | |
void DECAF_API_VIS | decaf_sha3_reset (decaf_keccak_sponge_t sponge) |
Reset the sponge to the empty string. More... | |
size_t DECAF_API_VIS | decaf_sha3_default_output_bytes (const decaf_keccak_sponge_t sponge) |
Return the default output length of the sponge construction, for the purpose of C++ default operators. More... | |
size_t DECAF_API_VIS | decaf_sha3_max_output_bytes (const decaf_keccak_sponge_t sponge) |
Return the default output length of the sponge construction, for the purpose of C++ default operators. More... | |
void DECAF_API_VIS | decaf_sha3_destroy (decaf_keccak_sponge_t sponge) |
Destroy a DECAF_SHA3 or DECAF_SHAKE sponge context by overwriting it with 0. More... | |
decaf_error_t DECAF_API_VIS | decaf_sha3_hash (uint8_t *out, size_t outlen, const uint8_t *in, size_t inlen, const struct decaf_kparams_s *params) |
Hash (in) to (out) More... | |
SHA2-512.
SHA-3-n and DECAF_SHAKE-n instances.
size_t DECAF_API_VIS decaf_sha3_default_output_bytes | ( | const decaf_keccak_sponge_t | sponge | ) |
Return the default output length of the sponge construction, for the purpose of C++ default operators.
Returns n/8 for DECAF_SHA3-n and 2n/8 for DECAF_SHAKE-n.
[in,out] | sponge | The context. |
void DECAF_API_VIS decaf_sha3_destroy | ( | decaf_keccak_sponge_t | sponge | ) |
Destroy a DECAF_SHA3 or DECAF_SHAKE sponge context by overwriting it with 0.
[out] | sponge | The context. |
decaf_error_t DECAF_API_VIS decaf_sha3_final | ( | decaf_keccak_sponge_t | sponge, |
uint8_t *__restrict__ | out, | ||
size_t | len | ||
) |
Squeeze output data from a DECAF_SHA3 or DECAF_SHAKE hash context.
This re-initializes the context to its starting parameters.
[in,out] | sponge | The context. |
[out] | out | The output data. |
[in] | len | The requested output data length in bytes. |
decaf_error_t DECAF_API_VIS decaf_sha3_hash | ( | uint8_t * | out, |
size_t | outlen, | ||
const uint8_t * | in, | ||
size_t | inlen, | ||
const struct decaf_kparams_s * | params | ||
) |
Hash (in) to (out)
[in] | in | The input data. |
[in] | inlen | The length of the input data. |
[out] | out | A buffer for the output data. |
[in] | outlen | The length of the output data. |
[in] | params | The parameters of the sponge hash. |
void DECAF_API_VIS decaf_sha3_init | ( | decaf_keccak_sponge_t | sponge, |
const struct decaf_kparams_s * | params | ||
) |
Initialize a sponge context object.
[out] | sponge | The object to initialize. |
[in] | params | The sponge's parameter description. |
size_t DECAF_API_VIS decaf_sha3_max_output_bytes | ( | const decaf_keccak_sponge_t | sponge | ) |
Return the default output length of the sponge construction, for the purpose of C++ default operators.
Returns n/8 for DECAF_SHA3-n and SIZE_MAX for DECAF_SHAKE-n.
[in,out] | sponge | The context. |
decaf_error_t DECAF_API_VIS decaf_sha3_output | ( | decaf_keccak_sponge_t | sponge, |
uint8_t *__restrict__ | out, | ||
size_t | len | ||
) |
Squeeze output data from a DECAF_SHA3 or DECAF_SHAKE hash context.
This does not destroy or re-initialize the hash context, and decaf_sha3 output can be called more times.
[in,out] | sponge | The context. |
[out] | out | The output data. |
[in] | len | The requested output data length in bytes. |
void DECAF_API_VIS decaf_sha3_reset | ( | decaf_keccak_sponge_t | sponge | ) |
Reset the sponge to the empty string.
[in,out] | sponge | The context. |
decaf_error_t DECAF_API_VIS decaf_sha3_update | ( | struct decaf_keccak_sponge_s *__restrict__ | sponge, |
const uint8_t * | in, | ||
size_t | len | ||
) |
Absorb data into a DECAF_SHA3 or DECAF_SHAKE hash context.
[in,out] | sponge | The context. |
[in] | in | The input data. |
[in] | len | The input data's length in bytes. |