ASCON Suite
Macros | Functions
ascon-x3-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 3-share masked representation. More...
 
#define ROUND_CONSTANT(round)    (~(uint64_t)(((0x0F - (round)) << 4) | (round)))
 

Functions

void ascon_x3_permute (ascon_masked_state_t *state, uint8_t first_round, uint64_t preserve[2])
 

Macro Definition Documentation

◆ and_not_xor

#define and_not_xor (   x,
  y,
 
)
Value:
do { \
x##_a ^= (~(y##_a) & z##_a); \
x##_a ^= ((y##_a) & ascon_mask64_unrotate_share1_0(z##_b)); \
x##_a ^= (y##_a & ascon_mask64_unrotate_share2_0(z##_c)); \
\
x##_b ^= (y##_b & ascon_mask64_rotate_share1_0(z##_a)); \
x##_b ^= ((~y##_b) & z##_b); \
x##_b ^= (y##_b & ascon_mask64_unrotate_share2_1(z##_c)); \
\
x##_c ^= (y##_c & ascon_mask64_rotate_share2_0(~z##_a)); \
x##_c ^= (y##_c & ascon_mask64_rotate_share2_1(z##_b)); \
x##_c ^= (y##_c | z##_c); \
} while (0)
#define ascon_mask64_rotate_share2_1(x)
Rotates 64-bit masked share 2 with respect to share 1.
#define ascon_mask64_rotate_share2_0(x)
Rotates 64-bit masked share 2 with respect to share 0.
#define ascon_mask64_unrotate_share2_0(x)
Unrotates 64-bit masked share 2 with respect to share 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.
#define ascon_mask64_unrotate_share2_1(x)
Unrotates 64-bit masked share 2 with respect to share 1.

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

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

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

◆ ROUND_CONSTANT

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

Definition at line 53 of file ascon-x3-c64.c.

Function Documentation

◆ ascon_x3_permute()

void ascon_x3_permute ( ascon_masked_state_t state,
uint8_t  first_round,
uint64_t  preserve[2] 
)

Definition at line 56 of file ascon-x3-c64.c.