27 (
unsigned char *plaintext,
size_t plaintext_len,
28 const unsigned char *tag1,
const unsigned char *tag2,
size_t size)
33 accum |= (*tag1++ ^ *tag2++);
36 accum = (accum - 1) >> 8;
39 while (plaintext_len > 0) {
40 *plaintext++ &= accum;
50 size_t len, uint8_t first_round,
int last_permute)
67 size_t len, uint8_t first_round,
int last_permute)
84 const unsigned char *src,
size_t len, uint8_t first_round,
85 unsigned char partial)
89 size_t temp = 8U - partial;
92 return (
unsigned char)(partial + len);
113 return (
unsigned char)len;
118 const unsigned char *src,
size_t len, uint8_t first_round,
119 unsigned char partial)
123 size_t temp = 16U - partial;
126 return (
unsigned char)(partial + len);
147 return (
unsigned char)len;
152 const unsigned char *src,
size_t len, uint8_t first_round,
153 unsigned char partial)
157 size_t temp = 8U - partial;
160 return (
unsigned char)(partial + len);
181 return (
unsigned char)len;
186 const unsigned char *src,
size_t len, uint8_t first_round,
187 unsigned char partial)
191 size_t temp = 16U - partial;
194 return (
unsigned char)(partial + len);
215 return (
unsigned char)len;
void ascon_aead_absorb_16(ascon_state_t *state, const unsigned char *data, size_t len, uint8_t first_round, int last_permute)
Absorbs data into an ASCON state with a 16-byte rate.
unsigned char ascon_aead_encrypt_16(ascon_state_t *state, unsigned char *dest, const unsigned char *src, size_t len, uint8_t first_round, unsigned char partial)
Encrypts a block of data with an ASCON state and a 16-byte rate.
unsigned char ascon_aead_encrypt_8(ascon_state_t *state, unsigned char *dest, const unsigned char *src, size_t len, uint8_t first_round, unsigned char partial)
Encrypts a block of data with an ASCON state and an 8-byte rate.
int ascon_aead_check_tag(unsigned char *plaintext, size_t plaintext_len, const unsigned char *tag1, const unsigned char *tag2, size_t size)
Check an authentication tag in constant time.
unsigned char ascon_aead_decrypt_8(ascon_state_t *state, unsigned char *dest, const unsigned char *src, size_t len, uint8_t first_round, unsigned char partial)
Decrypts a block of data with an ASCON state and an 8-byte rate.
void ascon_aead_absorb_8(ascon_state_t *state, const unsigned char *data, size_t len, uint8_t first_round, int last_permute)
Absorbs data into an ASCON state with an 8-byte rate.
unsigned char ascon_aead_decrypt_16(ascon_state_t *state, unsigned char *dest, const unsigned char *src, size_t len, uint8_t first_round, unsigned char partial)
Decrypts a block of data with an ASCON state and a 16-byte rate.
#define ascon_decrypt_8(state, dest, src, offset)
#define ascon_decrypt_16(state, dest, src, offset)
#define ascon_absorb_8(state, data, offset)
#define ascon_pad(state, offset)
#define ascon_encrypt_8(state, dest, src, offset)
#define ascon_absorb_16(state, data, offset)
#define ascon_encrypt_16(state, dest, src, offset)
#define ascon_absorb_partial(state, data, offset, count)
#define ascon_decrypt_partial(state, dest, src, offset, count)
#define ascon_encrypt_partial(state, dest, src, offset, count)
void ascon_permute(ascon_state_t *state, uint8_t first_round)
Permutes the ASCON state with a specified number of rounds.
ascon_state_t state
[snippet_key]
unsigned char data[8]
[snippet_key]
Structure of the internal state of the ASCON permutation.