36 #if defined(ASCON_BACKEND_SLICED64)
37 static uint64_t
const iv[5] = {
38 0x47d45e034222e472ULL, 0xed0da2bb5580c30aULL,
39 0xedceed89ce04c765ULL, 0xffe052a5533eaa30ULL,
42 memcpy(
state->state.
S, iv,
sizeof(iv));
43 #elif defined(ASCON_BACKEND_SLICED32)
44 static uint32_t
const iv[10] = {
45 0xbee180ac, 0x183115c5, 0xb305f090, 0xe2df0893,
46 0xbab1a2bb, 0xebeab094, 0xf8c3d604, 0xfc1c17f4,
47 0x869edbd4, 0xaf21e5e3
49 memcpy(
state->state.
W, iv,
sizeof(iv));
51 static uint8_t
const iv[40] = {
52 0x47, 0xd4, 0x5e, 0x03, 0x42, 0x22, 0xe4, 0x72,
53 0xed, 0x0d, 0xa2, 0xbb, 0x55, 0x80, 0xc3, 0x0a,
54 0xed, 0xce, 0xed, 0x89, 0xce, 0x04, 0xc7, 0x65,
55 0xff, 0xe0, 0x52, 0xa5, 0x53, 0x3e, 0xaa, 0x30,
56 0xc8, 0xbe, 0x49, 0x56, 0xf9, 0x67, 0xf9, 0x1a
58 #if defined(ASCON_BACKEND_DIRECT_XOR)
59 memcpy(
state->state.
B, iv,
sizeof(iv));
71 (
const unsigned char *key,
size_t keylen,
72 const unsigned char *in,
size_t inlen,
73 const unsigned char *custom,
size_t customlen,
74 unsigned char *out,
size_t outlen)
85 const unsigned char *custom,
size_t customlen,
size_t outlen)
88 ascon_kmaca_init_precomputed(&(
state->xof));
98 const unsigned char *custom,
size_t customlen,
size_t outlen)
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.
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.
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.
void ascon_kmaca_free(ascon_kmaca_state_t *state)
Frees the ASCON-KMACA state and destroys any sensitive material.
void ascon_kmaca_squeeze(ascon_kmaca_state_t *state, unsigned char *out, size_t outlen)
Squeezes output data from an incremental ASCON-KMACA state.
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.
void ascon_xofa_absorb_custom(ascon_xofa_state_t *state, const unsigned char *custom, size_t customlen)
Absorbs a customization string into an ASCON-XOFA state.
Keyed Message Authentication Code (KMAC) based on ASCON-XOF.
#define ASCON_KMACA_SIZE
Default size of the output for ASCON-KMACA.
void ascon_release(ascon_state_t *state)
Temporarily releases access to any shared hardware resources that a permutation state was using.
void ascon_overwrite_bytes(ascon_state_t *state, const uint8_t *data, unsigned offset, unsigned size)
Overwrites existing bytes in the ASCON state.
void ascon_init(ascon_state_t *state)
Initializes the words of the ASCON permutation state to zero.
ascon_state_t state
[snippet_key]
State information for the ASCON-KMACA incremental mode.
State information for ASCON-XOFA incremental mode.
System utilities of use to applications that use ASCON.
void ascon_xofa_squeeze(ascon_xofa_state_t *state, unsigned char *out, size_t outlen)
Squeezes output data from an ASCON-XOFA state.
void ascon_xofa_absorb(ascon_xofa_state_t *state, const unsigned char *in, size_t inlen)
Absorbs more input data into an ASCON-XOFA state.
void ascon_xofa_init_custom(ascon_xofa_state_t *state, const char *function_name, const unsigned char *custom, size_t customlen, size_t outlen)
Initializes the state for an incremental ASCON-XOFA operation, with a named function,...
void ascon_xofa_free(ascon_xofa_state_t *state)
Frees the ASCON-XOFA state and destroys any sensitive material.