27 void ascon_hasha(
unsigned char *out,
const unsigned char *in,
size_t inlen)
39 #if defined(ASCON_BACKEND_SLICED64)
40 static uint64_t
const iv[5] = {
41 0x01470194fc6528a6ULL, 0x738ec38ac0adffa7ULL,
42 0x2ec8e3296c76384cULL, 0xd6f6a54d7f52377dULL,
45 memcpy(
state->xof.state.
S, iv,
sizeof(iv));
46 #elif defined(ASCON_BACKEND_SLICED32)
47 static uint32_t
const iv[10] = {
48 0x1b16eb02, 0x0108e46d, 0xd29083f3, 0x5b9b8efd,
49 0x2891ae4a, 0x7ad66562, 0xee3bfc7f, 0x9dc27156,
50 0x16801633, 0xc61d5fa9
52 memcpy(
state->xof.state.
W, iv,
sizeof(iv));
54 static uint8_t
const iv[40] = {
55 0x01, 0x47, 0x01, 0x94, 0xfc, 0x65, 0x28, 0xa6,
56 0x73, 0x8e, 0xc3, 0x8a, 0xc0, 0xad, 0xff, 0xa7,
57 0x2e, 0xc8, 0xe3, 0x29, 0x6c, 0x76, 0x38, 0x4c,
58 0xd6, 0xf6, 0xa5, 0x4d, 0x7f, 0x52, 0x37, 0x7d,
59 0xa1, 0x3c, 0x42, 0xa2, 0x23, 0xbe, 0x8d, 0x87
61 #if defined(ASCON_BACKEND_DIRECT_XOR)
62 memcpy(
state->xof.state.
B, iv,
sizeof(iv));
75 #if defined(ASCON_BACKEND_SLICED64) || defined(ASCON_BACKEND_SLICED32) || \
76 defined(ASCON_BACKEND_DIRECT_XOR)
void ascon_hasha_finalize(ascon_hasha_state_t *state, unsigned char *out)
Returns the final hash value from an ASCON-HASHA hashing operation.
void ascon_hasha_reinit(ascon_hasha_state_t *state)
Re-initializes the state for an ASCON-HASHA hashing operation.
void ascon_hasha(unsigned char *out, const unsigned char *in, size_t inlen)
Hashes a block of input data with ASCON-HASHA.
void ascon_hasha_init(ascon_hasha_state_t *state)
Initializes the state for an ASCON-HASHA hashing operation.
void ascon_hasha_free(ascon_hasha_state_t *state)
Frees the ASCON-HASHA state and destroys any sensitive material.
void ascon_hasha_update(ascon_hasha_state_t *state, const unsigned char *in, size_t inlen)
Updates an ASCON-HASHA state with more input data.
void ascon_hasha_copy(ascon_hasha_state_t *dest, const ascon_hasha_state_t *src)
Clones a copy of an ASCON-HASHA state.
ASCON-HASH and ASCON-HASHA hash algorithms.
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-HASHA incremental mode.
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.
#define ASCON_HASH_SIZE
Size of the hash output for ASCON-HASH and the default hash output size for ASCON-XOF.
void ascon_xofa_copy(ascon_xofa_state_t *dest, const ascon_xofa_state_t *src)
Clones a copy of an ASCON-XOFA state.
void ascon_xofa_free(ascon_xofa_state_t *state)
Frees the ASCON-XOFA state and destroys any sensitive material.