36 #if defined(ASCON_BACKEND_SLICED64)
37 static uint64_t
const iv[5] = {
38 0x7a09132495dfa176ULL, 0x1b19e04f31cc4caeULL,
39 0x64ba72afaa61d2b1ULL, 0xd2964e09a5169084ULL,
42 memcpy(
state->state.
S, iv,
sizeof(iv));
43 #elif defined(ASCON_BACKEND_SLICED32)
44 static uint32_t
const iv[10] = {
45 0xc1527f1e, 0x72148bc5, 0x558b5aa2, 0x32c34a2f,
46 0xa4c309c5, 0x4f5ff49c, 0xc6a13642, 0x9932c188,
47 0x36a2c6d9, 0x0e693f03
49 memcpy(
state->state.
W, iv,
sizeof(iv));
51 static uint8_t
const iv[40] = {
52 0x7a, 0x09, 0x13, 0x24, 0x95, 0xdf, 0xa1, 0x76,
53 0x1b, 0x19, 0xe0, 0x4f, 0x31, 0xcc, 0x4c, 0xae,
54 0x64, 0xba, 0x72, 0xaf, 0xaa, 0x61, 0xd2, 0xb1,
55 0xd2, 0x96, 0x4e, 0x09, 0xa5, 0x16, 0x90, 0x84,
56 0x05, 0xbc, 0x6c, 0x86, 0x5a, 0xbe, 0x51, 0x4b
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_kmac_init_precomputed(&(
state->xof));
98 const unsigned char *custom,
size_t customlen,
size_t outlen)
void ascon_kmac_reinit(ascon_kmac_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-XOF.
void ascon_kmac_absorb(ascon_kmac_state_t *state, const unsigned char *in, size_t inlen)
Absorbs more input data into an incremental ASCON-KMAC state.
void ascon_kmac_free(ascon_kmac_state_t *state)
Frees the ASCON-KMAC state and destroys any sensitive material.
void ascon_kmac_squeeze(ascon_kmac_state_t *state, unsigned char *out, size_t outlen)
Squeezes output data from an incremental ASCON-KMAC state.
void ascon_kmac_init(ascon_kmac_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-XOF.
void ascon_kmac(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-XOF.
void ascon_xof_absorb_custom(ascon_xof_state_t *state, const unsigned char *custom, size_t customlen)
Absorbs a customization string into an ASCON-XOF state.
Keyed Message Authentication Code (KMAC) based on ASCON-XOF.
#define ASCON_KMAC_SIZE
Default size of the output for ASCON-KMAC.
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-KMAC incremental mode.
State information for ASCON-XOF incremental mode.
System utilities of use to applications that use ASCON.
void ascon_xof_free(ascon_xof_state_t *state)
Frees the ASCON-XOF state and destroys any sensitive material.
void ascon_xof_absorb(ascon_xof_state_t *state, const unsigned char *in, size_t inlen)
Absorbs more input data into an ASCON-XOF state.
void ascon_xof_init_custom(ascon_xof_state_t *state, const char *function_name, const unsigned char *custom, size_t customlen, size_t outlen)
Initializes the state for an incremental ASCON-XOF operation, with a named function,...
void ascon_xof_squeeze(ascon_xof_state_t *state, unsigned char *out, size_t outlen)
Squeezes output data from an ASCON-XOF state.