31 #if defined(ASCON_BACKEND_C32)
33 #define ROUND_CONSTANT_PAIR(rc1, rc2) \
34 (~((uint32_t)(rc1))), (~((uint32_t)(rc2)))
38 static const uint32_t RC[12 * 2] = {
52 const uint32_t *rc = RC + first_round * 2;
53 uint32_t t0, t1, t2, t3, t4;
56 uint32_t x0_e =
state->
W[0];
57 uint32_t x0_o =
state->
W[1];
58 uint32_t x1_e =
state->
W[2];
59 uint32_t x1_o =
state->
W[3];
60 uint32_t x2_e =
state->
W[4];
61 uint32_t x2_o =
state->
W[5];
62 uint32_t x3_e =
state->
W[6];
63 uint32_t x3_o =
state->
W[7];
64 uint32_t x4_e =
state->
W[8];
65 uint32_t x4_o =
state->
W[9];
75 while (first_round < 12) {
82 #define ascon_sbox(x0, x1, x2, x3, x4) \
84 x0 ^= x4; x4 ^= x3; x2 ^= x1; \
85 t0 = ~x0; t1 = ~x1; t2 = ~x2; t3 = ~x3; t4 = ~x4; \
86 t0 &= x1; t1 &= x2; t2 &= x3; t3 &= x4; t4 &= x0; \
87 x0 ^= t1; x1 ^= t2; x2 ^= t3; x3 ^= t4; x4 ^= t0; \
88 x1 ^= x0; x0 ^= x4; x3 ^= x2; \
#define ascon_sbox(x0, x1, x2, x3, x4)
#define ROUND_CONSTANT_PAIR(rc1, rc2)
void ascon_permute(ascon_state_t *state, uint8_t first_round)
Permutes the ASCON state with a specified number of rounds.
Direct access to the ASCON permutation primitive.
ascon_state_t state
[snippet_key]
Structure of the internal state of the ASCON permutation.