ASCON Suite
Macros | Functions
ascon-x2-c64.c File Reference
#include "ascon-masked-state.h"
#include "ascon-masked-backend.h"
#include "core/ascon-util.h"

Go to the source code of this file.

Macros

#define and_not_xor(x, y, z)
 Computes x ^= (~y & z) with a 2-share masked representation. More...
 
#define ROUND_CONSTANT(round)    (~(uint64_t)(((0x0F - (round)) << 4) | (round)))
 

Functions

void ascon_x2_permute (ascon_masked_state_t *state, uint8_t first_round, uint64_t *preserve)
 Permutes the ASCON-x2 state with a specified number of rounds. More...
 

Macro Definition Documentation

◆ and_not_xor

#define and_not_xor (   x,
  y,
 
)
Value:
do { \
x##_a ^= ((~y##_a) & ascon_mask64_unrotate_share1_0(z##_b)); \
x##_a ^= ((~y##_a) & z##_a); \
x##_b ^= (y##_b & z##_b); \
x##_b ^= (y##_b & ascon_mask64_rotate_share1_0(z##_a)); \
} while (0)
#define ascon_mask64_rotate_share1_0(x)
Rotates 64-bit masked share 1 with respect to share 0.
#define ascon_mask64_unrotate_share1_0(x)
Unrotates 64-bit masked share 1 with respect to share 0.

Computes x ^= (~y & z) with a 2-share masked representation.

Parameters
xOutput variable to XOR with.
yFirst input variable.
zSecond input variable.

Definition at line 36 of file ascon-x2-c64.c.

◆ ROUND_CONSTANT

#define ROUND_CONSTANT (   round)     (~(uint64_t)(((0x0F - (round)) << 4) | (round)))

Definition at line 46 of file ascon-x2-c64.c.

Function Documentation

◆ ascon_x2_permute()

void ascon_x2_permute ( ascon_masked_state_t state,
uint8_t  first_round,
uint64_t *  preserve 
)

Permutes the ASCON-x2 state with a specified number of rounds.

Parameters
stateThe ASCON-x2 state in "operational" form.
first_roundThe first round to execute, between 0 and 11. The number of rounds will be 12 - first_round.
preservePreserved randomness from the previous permutation operation, or a fresh random word if randomness should not be preserved.

Definition at line 49 of file ascon-x2-c64.c.