ASCON Suite
|
Go to the source code of this file.
Functions | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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.
state | The state to absorb the data into. |
data | Points to the data to be absorbed. |
len | Length of the data to be absorbed. |
first_round | First round of the permutation to apply each block. |
last_permute | Non-zero to permute the last block, or zero to delay the permutation. |
Definition at line 65 of file ascon-aead-common.c.
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.
state | The state to absorb the data into. |
data | Points to the data to be absorbed. |
len | Length of the data to be absorbed. |
first_round | First round of the permutation to apply each block. |
last_permute | Non-zero to permute the last block, or zero to delay the permutation. |
Definition at line 48 of file ascon-aead-common.c.
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.
plaintext | Points to the plaintext data. |
plaintext_len | Length of the plaintext in bytes. |
tag1 | First tag to compare. |
tag2 | Second tag to compare. |
size | Length of the tags in bytes. |
If the tag check fails, then the plaintext will also be zeroed to prevent it from being used accidentally by the application when the ciphertext was invalid.
Definition at line 26 of file ascon-aead-common.c.
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.
state | The state to decrypt with. |
dest | Points to the destination buffer. |
src | Points to the source buffer. |
len | Length of the data to decrypt from src into dest. |
first_round | First round of the permutation to apply each block. |
partial | Non-zero if the first byte to be decrypted should start partway through the first block. |
Definition at line 184 of file ascon-aead-common.c.
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.
state | The state to decrypt with. |
dest | Points to the destination buffer. |
src | Points to the source buffer. |
len | Length of the data to decrypt from src into dest. |
first_round | First round of the permutation to apply each block. |
partial | Non-zero if the first byte to be decrypted should start partway through the first block. |
Definition at line 150 of file ascon-aead-common.c.
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.
state | The state to encrypt with. |
dest | Points to the destination buffer. |
src | Points to the source buffer. |
len | Length of the data to encrypt from src into dest. |
first_round | First round of the permutation to apply each block. |
partial | Non-zero if the first byte to be encrypted should start partway through the first block. |
Definition at line 116 of file ascon-aead-common.c.
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.
state | The state to encrypt with. |
dest | Points to the destination buffer. |
src | Points to the source buffer. |
len | Length of the data to encrypt from src into dest. |
first_round | First round of the permutation to apply each block. |
partial | Non-zero if the first byte to be encrypted should start partway through the first block. |
Definition at line 82 of file ascon-aead-common.c.