23 #ifndef LW_INTERNAL_ASCON_M2_H
24 #define LW_INTERNAL_ASCON_M2_H
103 const unsigned char *npub,
int is_160_bit);
115 unsigned char tag[16]);
127 unsigned char tag[16]);
139 unsigned char tag[16]);
155 size_t len, uint8_t first_round);
171 size_t len, uint8_t first_round);
185 const unsigned char *src,
size_t len, uint8_t first_round);
199 const unsigned char *src,
size_t len, uint8_t first_round);
213 const unsigned char *src,
size_t len, uint8_t first_round);
227 const unsigned char *src,
size_t len, uint8_t first_round);
236 #define ascon_masked_separator_x2(state) ((state)->a.W[8] ^= 0x01)
238 #define ascon_masked_separator_x2(state) ((state)->a.S[4] ^= 0x01)
void ascon_masked_encrypt_16_x2(ascon_masked_state_x2_t *state, unsigned char *dest, const unsigned char *src, size_t len, uint8_t first_round)
Encrypts a block of data with a 2-share masked ASCON state and a 16-byte block rate.
Definition: internal-ascon-m2.c:1231
Structure of the internal state of the ASCON permutation.
Definition: internal-ascon.h:67
ascon_state_t b
Definition: internal-ascon-m2.h:47
void ascon_permute_masked_x2(ascon_masked_state_x2_t *state, uint8_t first_round)
Permutes the 2-share version of the masked ASCON state.
Definition: internal-ascon-m2.c:600
ascon_state_t a
Definition: internal-ascon-m2.h:46
Structure of an ASCON key that has been masked with 2 shares.
Definition: internal-ascon-m2.h:54
void ascon_masked_init_key_x2(ascon_masked_state_x2_t *state, const ascon_masked_key_x2_t *mk, const unsigned char *npub, int is_160_bit)
Initializes the 2-share version of a masked ASCON state with a 128-bit key and a 128-bit nonce...
Definition: internal-ascon-m2.c:821
void ascon_mask_key_160_x2(ascon_masked_key_x2_t *mk, uint32_t iv, const unsigned char *k)
Masks a 160-bit key plus a 32-bit initialization vector.
Definition: internal-ascon-m2.c:808
void ascon_masked_absorb_16_x2(ascon_masked_state_x2_t *state, const unsigned char *data, size_t len, uint8_t first_round)
Absorbs data into a 2-share masked ASCON state with a 16-byte block rate.
Definition: internal-ascon-m2.c:1059
void ascon_masked_key_refresh_x2(ascon_masked_key_x2_t *mk)
Refreshes the randomness in aa 2-share masked ASCON key.
Definition: internal-ascon-m2.c:1424
void ascon_masked_decrypt_16_x2(ascon_masked_state_x2_t *state, unsigned char *dest, const unsigned char *src, size_t len, uint8_t first_round)
Decrypts a block of data with a 2-share masked ASCON state and a 16-byte block rate.
Definition: internal-ascon-m2.c:1322
void ascon_masked_decrypt_8_x2(ascon_masked_state_x2_t *state, unsigned char *dest, const unsigned char *src, size_t len, uint8_t first_round)
Decrypts a block of data with a 2-share masked ASCON state and an 8-byte block rate.
Definition: internal-ascon-m2.c:1175
void ascon_masked_finalize_128_x2(ascon_masked_state_x2_t *state, const ascon_masked_key_x2_t *mk, unsigned char tag[16])
Finalizes the 2-share version of a masked ASCON state and computes the final authentication tag for A...
Definition: internal-ascon-m2.c:867
void ascon_masked_encrypt_8_x2(ascon_masked_state_x2_t *state, unsigned char *dest, const unsigned char *src, size_t len, uint8_t first_round)
Encrypts a block of data with a 2-share masked ASCON state and an 8-byte block rate.
Definition: internal-ascon-m2.c:1116
void ascon_masked_finalize_80pq_x2(ascon_masked_state_x2_t *state, const ascon_masked_key_x2_t *mk, unsigned char tag[16])
Finalizes the 2-share version of a masked ASCON state and computes the final authentication tag for A...
Definition: internal-ascon-m2.c:969
Structure of the internal state of the masked ASCON permutation with two shares.
Definition: internal-ascon-m2.h:44
void ascon_masked_finalize_128a_x2(ascon_masked_state_x2_t *state, const ascon_masked_key_x2_t *mk, unsigned char tag[16])
Finalizes the 2-share version of a masked ASCON state and computes the final authentication tag for A...
Definition: internal-ascon-m2.c:918
void ascon_masked_refresh_x2(ascon_masked_state_x2_t *state)
Refreshes the randomness in a 2-share masked ASCON state.
Definition: internal-ascon-m2.c:1413
void ascon_mask_key_128_x2(ascon_masked_key_x2_t *mk, uint64_t iv, const unsigned char *k)
Masks a 128-bit key plus a 64-bit initialization vector.
Definition: internal-ascon-m2.c:795
void ascon_masked_absorb_8_x2(ascon_masked_state_x2_t *state, const unsigned char *data, size_t len, uint8_t first_round)
Absorbs data into a 2-share masked ASCON state with an 8-byte block rate.
Definition: internal-ascon-m2.c:1020
Internal implementation of the ASCON permutation.