ASCON Suite
Macros | Functions
ascon-c32.c File Reference
#include <ascon/permutation.h>
#include "ascon-select-backend.h"
#include "ascon-sliced32.h"
#include "ascon-util.h"

Go to the source code of this file.

Macros

#define ROUND_CONSTANT_PAIR(rc1, rc2)    (~((uint32_t)(rc1))), (~((uint32_t)(rc2)))
 
#define ascon_sbox(x0, x1, x2, x3, x4)
 

Functions

void ascon_permute (ascon_state_t *state, uint8_t first_round)
 Permutes the ASCON state with a specified number of rounds. More...
 

Macro Definition Documentation

◆ ascon_sbox

#define ascon_sbox (   x0,
  x1,
  x2,
  x3,
  x4 
)
Value:
do { \
x0 ^= x4; x4 ^= x3; x2 ^= x1; \
t0 = ~x0; t1 = ~x1; t2 = ~x2; t3 = ~x3; t4 = ~x4; \
t0 &= x1; t1 &= x2; t2 &= x3; t3 &= x4; t4 &= x0; \
x0 ^= t1; x1 ^= t2; x2 ^= t3; x3 ^= t4; x4 ^= t0; \
x1 ^= x0; x0 ^= x4; x3 ^= x2; /* x2 = ~x2; */ \
} while (0)

◆ ROUND_CONSTANT_PAIR

#define ROUND_CONSTANT_PAIR (   rc1,
  rc2 
)     (~((uint32_t)(rc1))), (~((uint32_t)(rc2)))

Definition at line 33 of file ascon-c32.c.

Function Documentation

◆ ascon_permute()

void ascon_permute ( ascon_state_t state,
uint8_t  first_round 
)

Permutes the ASCON state with a specified number of rounds.

Parameters
stateThe ASCON state in "operational" form.
first_roundThe first round to execute, between 0 and 11. The number of rounds will be 12 - first_round.

Definition at line 36 of file ascon-c32.c.