23 #ifndef LW_INTERNAL_DRYSPONGE_H
24 #define LW_INTERNAL_DRYSPONGE_H
27 #include "drygascon128_arm_selector.h"
29 #include "internal-util.h"
45 #define GASCON128_STATE_SIZE 40
50 #define GASCON256_STATE_SIZE 72
55 #define DRYSPONGE128_RATE 16
60 #define DRYSPONGE256_RATE 16
65 #define DRYSPONGE128_XSIZE 16
70 #define DRYSPONGE256_XSIZE 16
76 #define DRYSPONGE128_ROUNDS 7
81 #define DRYSPONGE128_INIT_ROUNDS 11
87 #define DRYSPONGE256_ROUNDS 8
92 #define DRYSPONGE256_INIT_ROUNDS 12
94 #ifdef DRYGASCON_F_OPT
99 #define DRYDOMAIN128_PADDED (1 << 0)
104 #define DRYDOMAIN128_FINAL (1 << 1)
109 #define DRYDOMAIN128_NONCE (1 << 2)
114 #define DRYDOMAIN128_ASSOC_DATA (2 << 2)
119 #define DRYDOMAIN128_MESSAGE (3 << 2)
126 #define DRYDOMAIN128_PADDED (1 << 8)
131 #define DRYDOMAIN128_FINAL (1 << 9)
136 #define DRYDOMAIN128_NONCE (1 << 10)
141 #define DRYDOMAIN128_ASSOC_DATA (2 << 10)
147 #define DRYDOMAIN128_MESSAGE (3 << 10)
155 #define DRYDOMAIN256_PADDED (1 << 2)
160 #define DRYDOMAIN256_FINAL (1 << 3)
165 #define DRYDOMAIN256_NONCE (1 << 4)
170 #define DRYDOMAIN256_ASSOC_DATA (2 << 4)
175 #define DRYDOMAIN256_MESSAGE (3 << 4)
347 (drysponge128_state_t *state,
const unsigned char *input,
unsigned len);
370 (drysponge128_state_t *state,
const unsigned char *key,
unsigned int keysize,
371 const unsigned char *nonce,
int final_block);
383 const unsigned char *nonce,
int final_block);
uint32_t rounds
Definition: internal-drysponge.h:264
void drysponge256_g_core(drysponge256_state_t *state)
Performs the DrySPONGE256 G function which runs the core rounds but does not squeeze out any output...
Definition: internal-drysponge.c:333
void drysponge128_setup(drysponge128_state_t *state, const unsigned char *key, unsigned int keysize, const unsigned char *nonce, int final_block)
Set up a DrySPONGE128 state to begin encryption or decryption.
Definition: internal-drysponge.c:600
drysponge256_x_t x
Definition: internal-drysponge.h:262
void gascon128_core_round(gascon128_state_t *state, uint8_t round)
Permutes the GASCON-128 state using one iteration of CoreRound.
Definition: internal-drysponge.c:121
drysponge128_rate_t r
Definition: internal-drysponge.h:251
void drysponge256_setup(drysponge256_state_t *state, const unsigned char *key, const unsigned char *nonce, int final_block)
Set up a DrySPONGE256 state to begin encryption or decryption.
Definition: internal-drysponge.c:652
#define GASCON128_STATE_SIZE
Size of the GASCON-128 permutation state in bytes.
Definition: internal-drysponge.h:45
gascon128_state_t c
Definition: internal-drysponge.h:248
#define DRYSPONGE256_XSIZE
Size of the "x" value for DrySPONGE256.
Definition: internal-drysponge.h:70
gascon256_state_t c
Definition: internal-drysponge.h:260
drysponge128_x_t x
Definition: internal-drysponge.h:252
Internal state of the GASCON-256 permutation.
Definition: internal-drysponge.h:191
#define DRYSPONGE128_XSIZE
Size of the "x" value for DrySPONGE128.
Definition: internal-drysponge.h:65
void gascon256_core_round(gascon256_state_t *state, uint8_t round)
Permutes the GASCON-256 state using one iteration of CoreRound.
Definition: internal-drysponge.c:177
Structure of the rolling DrySPONGE256 state.
Definition: internal-drysponge.h:258
Structure of the "x" value for DrySPONGE128.
Definition: internal-drysponge.h:224
int drysponge128_safe_alignement(const drysponge128_state_t *state)
Determine if state alignement is safe vs timing attacks.
Definition: internal-drysponge.c:595
void drysponge128_g_core(drysponge128_state_t *state)
Performs the DrySPONGE128 G function which runs the core rounds but does not squeeze out any output...
Definition: internal-drysponge.c:325
drysponge256_rate_t r
Definition: internal-drysponge.h:261
Structure of a rate block for DrySPONGE256.
Definition: internal-drysponge.h:213
uint32_t rounds
Definition: internal-drysponge.h:250
uint32_t domain
Definition: internal-drysponge.h:263
void drysponge128_g(drysponge128_state_t *state)
Performs the DrySPONGE128 G function which runs the core rounds and squeezes data out of the GASGON-1...
Definition: internal-drysponge.c:285
void drysponge256_f_absorb(drysponge256_state_t *state, const unsigned char *input, unsigned len)
Performs the absorption phase of the DrySPONGE256 F function.
Definition: internal-drysponge.c:557
Internal state of the GASCON-128 permutation.
Definition: internal-drysponge.h:180
#define GASCON256_STATE_SIZE
Size of the GASCON-256 permutation state in bytes.
Definition: internal-drysponge.h:50
uint32_t domain
Definition: internal-drysponge.h:249
void drygascon128_f_wrap(drysponge128_state_t *state, const unsigned char *input, unsigned len)
Wrapper that combines the DrySPONGE128 F and G functions.
Definition: internal-drysponge.c:535
Structure of the "x" value for DrySPONGE256.
Definition: internal-drysponge.h:235
#define DRYSPONGE256_RATE
Rate of absorption and squeezing for DrySPONGE256.
Definition: internal-drysponge.h:60
Structure of a rate block for DrySPONGE128.
Definition: internal-drysponge.h:202
void drysponge256_g(drysponge256_state_t *state)
Performs the DrySPONGE256 G function which runs the core rounds and squeezes data out of the GASGON-2...
Definition: internal-drysponge.c:290
#define DRYSPONGE128_RATE
Rate of absorption and squeezing for DrySPONGE128.
Definition: internal-drysponge.h:55
DryGASCON authenticated encryption algorithm.