27 #if defined(ASCON_MASKED_X2_BACKEND_C64)
36 #define and_not_xor(x, y, z) \
38 x##_a ^= ((~y##_a) & ascon_mask64_unrotate_share1_0(z##_b)); \
39 x##_a ^= ((~y##_a) & z##_a); \
40 x##_b ^= (y##_b & z##_b); \
41 x##_b ^= (y##_b & ascon_mask64_rotate_share1_0(z##_a)); \
46 #define ROUND_CONSTANT(round) \
47 (~(uint64_t)(((0x0F - (round)) << 4) | (round)))
52 static const uint64_t RC[12] = {
66 uint64_t x0_a, x1_a, x2_a, x3_a, x4_a;
67 uint64_t x0_b, x1_b, x2_b, x3_b, x4_b;
68 uint64_t t0_a, t0_b, t1_a, t1_b;
74 #if defined(ASCON_MASKED_WORD_BACKEND_DIRECT_XOR)
104 while (first_round < 12) {
106 x2_a ^= RC[first_round++];
163 #if defined(ASCON_MASKED_WORD_BACKEND_DIRECT_XOR)
Utility functions for operating on masked ASCON states with between 2 and 4 shares.
#define ascon_mask64_rotate_share1_0(x)
Rotates 64-bit masked share 1 with respect to share 0.
#define rightRotate39_64(a)
#define rightRotate61_64(a)
#define rightRotate41_64(a)
#define rightRotate1_64(a)
#define rightRotate10_64(a)
#define be_store_word64(ptr, x)
#define rightRotate19_64(a)
#define rightRotate6_64(a)
#define rightRotate7_64(a)
#define rightRotate28_64(a)
#define rightRotate17_64(a)
#define be_load_word64(ptr)
#define rightRotate13_64(a)
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.
#define and_not_xor(x, y, z)
Computes x ^= (~y & z) with a 2-share masked representation.
#define ROUND_CONSTANT(round)
ascon_state_t state
[snippet_key]
State of the ASCON permutation which has been masked with up to 4 shares.