23 #ifndef LWCRYPTO_ASCON_PERMUTATION_H
24 #define LWCRYPTO_ASCON_PERMUTATION_H
63 #define ASCON_STATE_SIZE 40
68 #define ASCON_MAX_ROUNDS 12
149 unsigned offset,
unsigned length);
172 unsigned offset,
unsigned length);
240 unsigned offset,
unsigned length);
273 unsigned char *output,
unsigned offset,
unsigned length);
309 unsigned char *output,
unsigned offset,
unsigned length,
int padded);
345 unsigned char *output,
unsigned offset,
unsigned length,
int padded);
void ascon_add_bytes(ascon_permutation_state_t *state, const unsigned char *data, unsigned offset, unsigned length)
Adds bytes to the state by XOR'ing them with the existing bytes.
Definition: ascon-permutation.c:76
#define ASCON_STATE_SIZE
Size of the ASCON permutation state in bytes.
Definition: ascon-permutation.h:63
void ascon_encrypt_bytes(ascon_permutation_state_t *state, const unsigned char *input, unsigned char *output, unsigned offset, unsigned length, int padded)
Encrypts bytes by XOR'ing them with the state and then adding the encrypted version back to the state...
Definition: ascon-permutation.c:295
Structure of the internal state of the ASCON permutation.
Definition: ascon-permutation.h:76
void ascon_extract_and_add_bytes(const ascon_permutation_state_t *state, const unsigned char *input, unsigned char *output, unsigned offset, unsigned length)
Extracts bytes from an ASCON state and XOR's them with input data.
Definition: ascon-permutation.c:251
void ascon_extract_bytes(const ascon_permutation_state_t *state, unsigned char *data, unsigned offset, unsigned length)
Extracts bytes from an ASCON state.
Definition: ascon-permutation.c:210
void ascon_permute_n_rounds(ascon_permutation_state_t *state, unsigned rounds)
Performs N rounds of the ASCON permutation.
Definition: ascon-permutation.c:186
void ascon_decrypt_bytes(ascon_permutation_state_t *state, const unsigned char *input, unsigned char *output, unsigned offset, unsigned length, int padded)
Decrypts bytes by XOR'ing them with the state and then overwriting the state with the original cipher...
Definition: ascon-permutation.c:363
void ascon_overwrite_bytes(ascon_permutation_state_t *state, const unsigned char *data, unsigned offset, unsigned length)
Writes bytes to the state, overwriting any existing bytes.
Definition: ascon-permutation.c:119
void ascon_to_operational(ascon_permutation_state_t *state)
Converts an ASCON state from traditional mode to operational mode.
Definition: ascon-permutation.c:44
void ascon_permute_all_rounds(ascon_permutation_state_t *state)
Performs all 12 rounds of the ASCON permutation.
Definition: ascon-permutation.c:200
void ascon_init(ascon_permutation_state_t *state)
Initializes an ASCON state to all-zeroes.
Definition: ascon-permutation.c:30
void ascon_from_operational(ascon_permutation_state_t *state)
Converts an ASCON state from operational mode to traditional mode.
Definition: ascon-permutation.c:35
void ascon_add_byte(ascon_permutation_state_t *state, unsigned char data, unsigned offset)
Adds a single byte to the state by XOR'ing it with the existing byte.
Definition: ascon-permutation.c:54
void ascon_overwrite_with_zeroes(ascon_permutation_state_t *state, unsigned count)
Overwrites the leading part of the state with zeroes.
Definition: ascon-permutation.c:162