31 #if defined(ASCON_BACKEND_SLICED64) || defined(ASCON_BACKEND_SLICED32) || \
32 defined(ASCON_BACKEND_DIRECT_XOR)
33 #define ASCON_PBKDF2_FREE_STATE 0
35 #define ASCON_PBKDF2_FREE_STATE 1
45 static void ascon_pbkdf2_f
47 const unsigned char *salt,
size_t saltlen,
48 unsigned long count,
unsigned long blocknum)
57 #if ASCON_PBKDF2_FREE_STATE
64 #if ASCON_PBKDF2_FREE_STATE
77 #if !ASCON_PBKDF2_FREE_STATE
83 (
unsigned char *out,
size_t outlen,
84 const unsigned char *password,
size_t passwordlen,
85 const unsigned char *salt,
size_t saltlen,
unsigned long count)
89 unsigned long blocknum = 1;
94 ascon_pbkdf2_f(&
state, out, U, salt, saltlen, count, blocknum);
99 ascon_pbkdf2_f(&
state, T, U, salt, saltlen, count, blocknum);
100 memcpy(out, T, outlen);
void ascon_pbkdf2(unsigned char *out, size_t outlen, const unsigned char *password, size_t passwordlen, const unsigned char *salt, size_t saltlen, unsigned long count)
Derives key material using ASCON-PBKDF2.
#define lw_xor_block(dest, src, len)
#define be_store_word32(ptr, x)
Password-based key derivation function based on ASCON.
#define ASCON_PBKDF2_SIZE
Default output block size for ASCON-PBKDF2. Key material is generated in blocks of this size.
ascon_state_t state
[snippet_key]
State information for ASCON-XOF incremental mode.
System utilities of use to applications that use ASCON.
void ascon_clean(void *buf, unsigned size)
Cleans a buffer that contains sensitive material.
ASCON-XOF and ASCON-XOFA extensible output functions (XOF's).
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_copy(ascon_xof_state_t *dest, const ascon_xof_state_t *src)
Clones a copy of an ASCON-XOF state.
void ascon_xof_squeeze(ascon_xof_state_t *state, unsigned char *out, size_t outlen)
Squeezes output data from an ASCON-XOF state.