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

Functions

void ascon_x4_permute (ascon_masked_state_t *state, uint8_t first_round, uint64_t preserve[3])
 

Macro Definition Documentation

◆ and_not_xor

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

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

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

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

◆ ROUND_CONSTANT

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

Definition at line 61 of file ascon-x4-c64.c.

Function Documentation

◆ ascon_x4_permute()

void ascon_x4_permute ( ascon_masked_state_t state,
uint8_t  first_round,
uint64_t  preserve[3] 
)

Definition at line 64 of file ascon-x4-c64.c.