ASCON Suite
|
#include "ascon-masked-state.h"
#include "ascon-masked-backend.h"
#include "core/ascon-util-snp.h"
#include <ascon/utility.h>
#include <string.h>
Go to the source code of this file.
Functions | |
void | ascon_masked_state_init (ascon_masked_state_t *state) |
Initializes the words of a masked ASCON permutation state. More... | |
void | ascon_masked_state_free (ascon_masked_state_t *state) |
Frees an ASCON-x2 permutation state and attempts to destroy any sensitive material. More... | |
void | ascon_x2_randomize (ascon_masked_state_t *state, ascon_trng_state_t *trng) |
Randomizes an ASCON-x2 permutation state. More... | |
void | ascon_x2_copy_from_x1 (ascon_masked_state_t *dest, const ascon_state_t *src, ascon_trng_state_t *trng) |
Copies the entire ASCON-x2 permutation state from a regular ASCON-x1 permutation state. More... | |
void | ascon_x2_copy_to_x1 (ascon_state_t *dest, const ascon_masked_state_t *src) |
Copies the entire ASCON-x2 permutation state to a regular ASCON-x1 permutation state. More... | |
void | ascon_x2_copy_from_x2 (ascon_masked_state_t *dest, const ascon_masked_state_t *src, ascon_trng_state_t *trng) |
Copies the entire ASCON-x2 permutation state from a source to a destination. More... | |
void | ascon_x2_copy_from_x3 (ascon_masked_state_t *dest, const ascon_masked_state_t *src, ascon_trng_state_t *trng) |
Copies the entire ASCON-x3 permutation state to an ASCON-x2 permutation state. More... | |
void | ascon_x2_copy_from_x4 (ascon_masked_state_t *dest, const ascon_masked_state_t *src, ascon_trng_state_t *trng) |
Copies the entire ASCON-x4 permutation state to an ASCON-x2 permutation state. More... | |
void | ascon_x3_randomize (ascon_masked_state_t *state, ascon_trng_state_t *trng) |
Randomizes an ASCON-x3 permutation state. More... | |
void | ascon_x3_copy_from_x1 (ascon_masked_state_t *dest, const ascon_state_t *src, ascon_trng_state_t *trng) |
Copies the entire ASCON-x3 permutation state from a regular ASCON-x1 permutation state. More... | |
void | ascon_x3_copy_to_x1 (ascon_state_t *dest, const ascon_masked_state_t *src) |
Copies the entire ASCON-x3 permutation state to a regular ASCON-x1 permutation state. More... | |
void | ascon_x3_copy_from_x2 (ascon_masked_state_t *dest, const ascon_masked_state_t *src, ascon_trng_state_t *trng) |
Copies the entire ASCON-x3 permutation state from an ASCON-x2 permutation state. More... | |
void | ascon_x3_copy_from_x3 (ascon_masked_state_t *dest, const ascon_masked_state_t *src, ascon_trng_state_t *trng) |
Copies the entire ASCON-x3 permutation state from a source to a destination. More... | |
void | ascon_x3_copy_from_x4 (ascon_masked_state_t *dest, const ascon_masked_state_t *src, ascon_trng_state_t *trng) |
Copies the entire ASCON-x3 permutation state from an ASCON-x4 permutation state. More... | |
void | ascon_x4_randomize (ascon_masked_state_t *state, ascon_trng_state_t *trng) |
Randomizes an ASCON-x4 permutation state. More... | |
void | ascon_x4_copy_from_x1 (ascon_masked_state_t *dest, const ascon_state_t *src, ascon_trng_state_t *trng) |
Copies the entire ASCON-x4 permutation state from a regular ASCON-x1 permutation state. More... | |
void | ascon_x4_copy_to_x1 (ascon_state_t *dest, const ascon_masked_state_t *src) |
Copies the entire ASCON-x4 permutation state to a regular ASCON-x1 permutation state. More... | |
void | ascon_x4_copy_from_x2 (ascon_masked_state_t *dest, const ascon_masked_state_t *src, ascon_trng_state_t *trng) |
Copies the entire ASCON-x4 permutation state from an ASCON-x2 permutation state. More... | |
void | ascon_x4_copy_from_x3 (ascon_masked_state_t *dest, const ascon_masked_state_t *src, ascon_trng_state_t *trng) |
Copies the entire ASCON-x4 permutation state from an ASCON-x3 permutation state. More... | |
void | ascon_x4_copy_from_x4 (ascon_masked_state_t *dest, const ascon_masked_state_t *src, ascon_trng_state_t *trng) |
Copies the entire ASCON-x4 permutation state from a source to a destination. More... | |
void ascon_masked_state_free | ( | ascon_masked_state_t * | state | ) |
Frees an ASCON-x2 permutation state and attempts to destroy any sensitive material.
state | The ASCON-x2 state to be freed. |
Definition at line 34 of file ascon-masked-state.c.
void ascon_masked_state_init | ( | ascon_masked_state_t * | state | ) |
Initializes the words of a masked ASCON permutation state.
state | The masked ASCON state to initialize. |
All words will be set to zero with no randomness. The application must use functions ascon_x2_overwrite_word() to populate the initial randomized state.
Definition at line 29 of file ascon-masked-state.c.
void ascon_x2_copy_from_x1 | ( | ascon_masked_state_t * | dest, |
const ascon_state_t * | src, | ||
ascon_trng_state_t * | trng | ||
) |
Copies the entire ASCON-x2 permutation state from a regular ASCON-x1 permutation state.
dest | The destination to copy to. |
src | The source to copy from. |
trng | TRNG to use to mask the original ASCON-x1 state. |
Definition at line 49 of file ascon-masked-state.c.
void ascon_x2_copy_from_x2 | ( | ascon_masked_state_t * | dest, |
const ascon_masked_state_t * | src, | ||
ascon_trng_state_t * | trng | ||
) |
Copies the entire ASCON-x2 permutation state from a source to a destination.
dest | The destination to copy to. |
src | The source to copy from. |
trng | TRNG to use to re-randomize the source state. |
Definition at line 85 of file ascon-masked-state.c.
void ascon_x2_copy_from_x3 | ( | ascon_masked_state_t * | dest, |
const ascon_masked_state_t * | src, | ||
ascon_trng_state_t * | trng | ||
) |
Copies the entire ASCON-x3 permutation state to an ASCON-x2 permutation state.
dest | The destination to copy to after unmasking it. |
src | The source to copy from. |
trng | TRNG to use to randomize the output state. |
Definition at line 98 of file ascon-masked-state.c.
void ascon_x2_copy_from_x4 | ( | ascon_masked_state_t * | dest, |
const ascon_masked_state_t * | src, | ||
ascon_trng_state_t * | trng | ||
) |
Copies the entire ASCON-x4 permutation state to an ASCON-x2 permutation state.
dest | The destination to copy to after unmasking it. |
src | The source to copy from. |
trng | TRNG to use to randomize the output state. |
Definition at line 111 of file ascon-masked-state.c.
void ascon_x2_copy_to_x1 | ( | ascon_state_t * | dest, |
const ascon_masked_state_t * | src | ||
) |
Copies the entire ASCON-x2 permutation state to a regular ASCON-x1 permutation state.
dest | The destination to copy to after unmasking it. |
src | The source to copy from. |
The dest must be released and freed before this operation as it will be initialized by the process.
Definition at line 68 of file ascon-masked-state.c.
void ascon_x2_randomize | ( | ascon_masked_state_t * | state, |
ascon_trng_state_t * | trng | ||
) |
Randomizes an ASCON-x2 permutation state.
state | The ASCON-x2 state to be randomized. |
trng | TRNG to use to randomize the state. |
The state will still have the same effective value, but this function will mix in fresh randomness to all words.
Definition at line 40 of file ascon-masked-state.c.
void ascon_x3_copy_from_x1 | ( | ascon_masked_state_t * | dest, |
const ascon_state_t * | src, | ||
ascon_trng_state_t * | trng | ||
) |
Copies the entire ASCON-x3 permutation state from a regular ASCON-x1 permutation state.
dest | The destination to copy to. |
src | The source to copy from. |
trng | TRNG to use to mask the original ASCON-x1 state. |
Definition at line 133 of file ascon-masked-state.c.
void ascon_x3_copy_from_x2 | ( | ascon_masked_state_t * | dest, |
const ascon_masked_state_t * | src, | ||
ascon_trng_state_t * | trng | ||
) |
Copies the entire ASCON-x3 permutation state from an ASCON-x2 permutation state.
dest | The destination to copy to. |
src | The source to copy from. |
trng | TRNG to use to randomize the output state. |
Definition at line 169 of file ascon-masked-state.c.
void ascon_x3_copy_from_x3 | ( | ascon_masked_state_t * | dest, |
const ascon_masked_state_t * | src, | ||
ascon_trng_state_t * | trng | ||
) |
Copies the entire ASCON-x3 permutation state from a source to a destination.
dest | The destination to copy to. |
src | The source to copy from. |
trng | TRNG to use to re-randomize the source state. |
Definition at line 178 of file ascon-masked-state.c.
void ascon_x3_copy_from_x4 | ( | ascon_masked_state_t * | dest, |
const ascon_masked_state_t * | src, | ||
ascon_trng_state_t * | trng | ||
) |
Copies the entire ASCON-x3 permutation state from an ASCON-x4 permutation state.
dest | The destination to copy to. |
src | The source to copy from. |
trng | TRNG to use to randomize the output state. |
Definition at line 191 of file ascon-masked-state.c.
void ascon_x3_copy_to_x1 | ( | ascon_state_t * | dest, |
const ascon_masked_state_t * | src | ||
) |
Copies the entire ASCON-x3 permutation state to a regular ASCON-x1 permutation state.
dest | The destination to copy to after unmasking it. |
src | The source to copy from. |
The dest must be released and freed before this operation as it will be initialized by the process.
Definition at line 152 of file ascon-masked-state.c.
void ascon_x3_randomize | ( | ascon_masked_state_t * | state, |
ascon_trng_state_t * | trng | ||
) |
Randomizes an ASCON-x3 permutation state.
state | The ASCON-x3 state to be randomized. |
trng | TRNG to use to randomize the state. |
The state will still have the same effective value, but this function will mix in fresh randomness to all words.
Definition at line 124 of file ascon-masked-state.c.
void ascon_x4_copy_from_x1 | ( | ascon_masked_state_t * | dest, |
const ascon_state_t * | src, | ||
ascon_trng_state_t * | trng | ||
) |
Copies the entire ASCON-x4 permutation state from a regular ASCON-x1 permutation state.
dest | The destination to copy to. |
src | The source to copy from. |
trng | TRNG to use to mask the original ASCON-x1 state. |
Definition at line 215 of file ascon-masked-state.c.
void ascon_x4_copy_from_x2 | ( | ascon_masked_state_t * | dest, |
const ascon_masked_state_t * | src, | ||
ascon_trng_state_t * | trng | ||
) |
Copies the entire ASCON-x4 permutation state from an ASCON-x2 permutation state.
dest | The destination to copy to. |
src | The source to copy from. |
trng | TRNG to use to randomize the output state. |
Definition at line 251 of file ascon-masked-state.c.
void ascon_x4_copy_from_x3 | ( | ascon_masked_state_t * | dest, |
const ascon_masked_state_t * | src, | ||
ascon_trng_state_t * | trng | ||
) |
Copies the entire ASCON-x4 permutation state from an ASCON-x3 permutation state.
dest | The destination to copy to. |
src | The source to copy from. |
trng | TRNG to use to randomize the output state. |
Definition at line 260 of file ascon-masked-state.c.
void ascon_x4_copy_from_x4 | ( | ascon_masked_state_t * | dest, |
const ascon_masked_state_t * | src, | ||
ascon_trng_state_t * | trng | ||
) |
Copies the entire ASCON-x4 permutation state from a source to a destination.
dest | The destination to copy to. |
src | The source to copy from. |
trng | TRNG to use to re-randomize the source state. |
Definition at line 269 of file ascon-masked-state.c.
void ascon_x4_copy_to_x1 | ( | ascon_state_t * | dest, |
const ascon_masked_state_t * | src | ||
) |
Copies the entire ASCON-x4 permutation state to a regular ASCON-x1 permutation state.
dest | The destination to copy to after unmasking it. |
src | The source to copy from. |
The dest must be released and freed before this operation as it will be initialized by the process.
Definition at line 234 of file ascon-masked-state.c.
void ascon_x4_randomize | ( | ascon_masked_state_t * | state, |
ascon_trng_state_t * | trng | ||
) |
Randomizes an ASCON-x4 permutation state.
state | The ASCON-x4 state to be randomized. |
trng | TRNG to use to randomize the state. |
The state will still have the same effective value, but this function will mix in fresh randomness to all words.
Definition at line 206 of file ascon-masked-state.c.