Lightweight Cryptography Primitives
|
Xoodyak-Hash hash algorithm. More...
#include <stddef.h>
Go to the source code of this file.
Data Structures | |
union | xoodyak_hash_state_t |
State information for Xoodyak incremental hashing modes. More... | |
Macros | |
#define | XOODYAK_HASH_SIZE 32 |
Size of the hash output for Xoodyak. | |
#define | XOODYAK_HASH_RATE 16 |
Rate for absorbing and squeezing in Xoodyak's hashing mode. | |
Functions | |
int | xoodyak_hash (unsigned char *out, const unsigned char *in, size_t inlen) |
Hashes a block of input data with Xoodyak to generate a hash value. More... | |
void | xoodyak_hash_init (xoodyak_hash_state_t *state) |
Initializes the state for a Xoodyak hashing operation. More... | |
void | xoodyak_hash_absorb (xoodyak_hash_state_t *state, const unsigned char *in, size_t inlen) |
Aborbs more input data into a Xoodyak hashing state. More... | |
void | xoodyak_hash_squeeze (xoodyak_hash_state_t *state, unsigned char *out, size_t outlen) |
Squeezes output data from a Xoodyak hashing state. More... | |
void | xoodyak_hash_finalize (xoodyak_hash_state_t *state, unsigned char *out) |
Returns the final hash value from a Xoodyak hashing operation. More... | |
void | xoodyak_hash_pad (xoodyak_hash_state_t *state) |
Absorbs enough zeroes into a Xoodyak hashing state to pad the input to the next multiple of the block rate. More... | |
Xoodyak-Hash hash algorithm.
Xoodyak-Hash is based around the 384-bit Xoodoo permutation and has a 256-bit output. Xoodyak-Hash can also be used as an extensible output function (XOF).
References: https://keccak.team/xoodyak.html
int xoodyak_hash | ( | unsigned char * | out, |
const unsigned char * | in, | ||
size_t | inlen | ||
) |
Hashes a block of input data with Xoodyak to generate a hash value.
out | Buffer to receive the hash output which must be at least XOODYAK_HASH_SIZE bytes in length. |
in | Points to the input data to be hashed. |
inlen | Length of the input data in bytes. |
void xoodyak_hash_absorb | ( | xoodyak_hash_state_t * | state, |
const unsigned char * | in, | ||
size_t | inlen | ||
) |
Aborbs more input data into a Xoodyak hashing state.
state | Hash state to be updated. |
in | Points to the input data to be absorbed into the state. |
inlen | Length of the input data to be absorbed into the state. |
void xoodyak_hash_finalize | ( | xoodyak_hash_state_t * | state, |
unsigned char * | out | ||
) |
Returns the final hash value from a Xoodyak hashing operation.
state | Hash state to be finalized. |
out | Points to the output buffer to receive the hash value. |
void xoodyak_hash_init | ( | xoodyak_hash_state_t * | state | ) |
Initializes the state for a Xoodyak hashing operation.
state | Hash state to be initialized. |
void xoodyak_hash_pad | ( | xoodyak_hash_state_t * | state | ) |
Absorbs enough zeroes into a Xoodyak hashing state to pad the input to the next multiple of the block rate.
state | The state to pad. Does nothing if the state is already aligned on a multiple of the block rate. |
This function can avoid unnecessary XOR-with-zero operations to save some time when padding is required.
void xoodyak_hash_squeeze | ( | xoodyak_hash_state_t * | state, |
unsigned char * | out, | ||
size_t | outlen | ||
) |
Squeezes output data from a Xoodyak hashing state.
state | Hash state to squeeze the output data from. |
out | Points to the output buffer to receive the squeezed data. |
outlen | Number of bytes of data to squeeze out of the state. |