|
ASCON Suite
|
#include <ascon/kmac.h>#include <ascon/utility.h>#include "hash/ascon-xof-internal.h"#include "core/ascon-util-snp.h"#include <string.h>Go to the source code of this file.
Functions | |
| void | ascon_kmaca (const unsigned char *key, size_t keylen, const unsigned char *in, size_t inlen, const unsigned char *custom, size_t customlen, unsigned char *out, size_t outlen) |
| Computes a KMAC value using ASCON-XOFA. More... | |
| void | ascon_kmaca_init (ascon_kmaca_state_t *state, const unsigned char *key, size_t keylen, const unsigned char *custom, size_t customlen, size_t outlen) |
| Initializes an incremental KMAC state using ASCON-XOFA. More... | |
| void | ascon_kmaca_reinit (ascon_kmaca_state_t *state, const unsigned char *key, size_t keylen, const unsigned char *custom, size_t customlen, size_t outlen) |
| Re-initializes an incremental KMAC state using ASCON-XOFA. More... | |
| void | ascon_kmaca_free (ascon_kmaca_state_t *state) |
| Frees the ASCON-KMACA state and destroys any sensitive material. More... | |
| void | ascon_kmaca_absorb (ascon_kmaca_state_t *state, const unsigned char *in, size_t inlen) |
| Absorbs more input data into an incremental ASCON-KMACA state. More... | |
| void | ascon_kmaca_squeeze (ascon_kmaca_state_t *state, unsigned char *out, size_t outlen) |
| Squeezes output data from an incremental ASCON-KMACA state. More... | |
| void ascon_kmaca | ( | const unsigned char * | key, |
| size_t | keylen, | ||
| const unsigned char * | in, | ||
| size_t | inlen, | ||
| const unsigned char * | custom, | ||
| size_t | customlen, | ||
| unsigned char * | out, | ||
| size_t | outlen | ||
| ) |
Computes a KMAC value using ASCON-XOFA.
| key | Points to the key. |
| keylen | Number of bytes in the key. |
| in | Points to the data to authenticate. |
| inlen | Number of bytes of data to authenticate. |
| custom | Points to the customization string. |
| customlen | Number of bytes in the customization string. |
| out | Buffer to receive the output KMAC value. |
| outlen | Length of the output KMAC value. |
The customization string allows the application to perform domain separation between different uses of the KMAC algorithm.
Definition at line 70 of file ascon-kmaca.c.
| void ascon_kmaca_absorb | ( | ascon_kmaca_state_t * | state, |
| const unsigned char * | in, | ||
| size_t | inlen | ||
| ) |
Absorbs more input data into an incremental ASCON-KMACA state.
| state | KMAC 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. |
Definition at line 110 of file ascon-kmaca.c.
| void ascon_kmaca_free | ( | ascon_kmaca_state_t * | state | ) |
Frees the ASCON-KMACA state and destroys any sensitive material.
| state | KMAC state to be freed. |
Definition at line 104 of file ascon-kmaca.c.
| void ascon_kmaca_init | ( | ascon_kmaca_state_t * | state, |
| const unsigned char * | key, | ||
| size_t | keylen, | ||
| const unsigned char * | custom, | ||
| size_t | customlen, | ||
| size_t | outlen | ||
| ) |
Initializes an incremental KMAC state using ASCON-XOFA.
| state | Points to the state to be initialized. |
| key | Points to the key. |
| keylen | Number of bytes in the key. |
| custom | Points to the customization string. |
| customlen | Number of bytes in the customization string. |
| outlen | The desired output length in bytes, or 0 for arbitrary-length. |
Definition at line 83 of file ascon-kmaca.c.
| void ascon_kmaca_reinit | ( | ascon_kmaca_state_t * | state, |
| const unsigned char * | key, | ||
| size_t | keylen, | ||
| const unsigned char * | custom, | ||
| size_t | customlen, | ||
| size_t | outlen | ||
| ) |
Re-initializes an incremental KMAC state using ASCON-XOFA.
| state | Points to the state to be initialized. |
| key | Points to the key. |
| keylen | Number of bytes in the key. |
| custom | Points to the customization string. |
| customlen | Number of bytes in the customization string. |
| outlen | The desired output length in bytes, or 0 for arbitrary-length. |
This function is equivalent to calling ascon_kmaca_free() and then ascon_kmaca_init().
Definition at line 96 of file ascon-kmaca.c.
| void ascon_kmaca_squeeze | ( | ascon_kmaca_state_t * | state, |
| unsigned char * | out, | ||
| size_t | outlen | ||
| ) |
Squeezes output data from an incremental ASCON-KMACA state.
| state | KMAC 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. |
Definition at line 116 of file ascon-kmaca.c.