23 #ifndef LW_INTERNAL_GIFT128_H
24 #define LW_INTERNAL_GIFT128_H
65 #define GIFT128_BLOCK_SIZE 16
71 #if GIFT128_VARIANT == GIFT128_VARIANT_TINY
72 #define GIFT128_ROUND_KEYS 4
73 #elif GIFT128_VARIANT == GIFT128_VARIANT_SMALL
74 #define GIFT128_ROUND_KEYS 20
76 #define GIFT128_ROUND_KEYS 80
109 const unsigned char *input);
127 const uint32_t input[4]);
141 const unsigned char *input);
154 void gift128n_init(gift128n_key_schedule_t *ks,
const unsigned char *key);
167 (
const gift128n_key_schedule_t *ks,
unsigned char *output,
168 const unsigned char *input);
181 (
const gift128n_key_schedule_t *ks,
unsigned char *output,
182 const unsigned char *input);
185 #define GIFT128T_TWEAK_0 0x00000000
186 #define GIFT128T_TWEAK_1 0xe1e1e1e1
187 #define GIFT128T_TWEAK_2 0xd2d2d2d2
188 #define GIFT128T_TWEAK_3 0x33333333
189 #define GIFT128T_TWEAK_4 0xb4b4b4b4
190 #define GIFT128T_TWEAK_5 0x55555555
191 #define GIFT128T_TWEAK_6 0x66666666
192 #define GIFT128T_TWEAK_7 0x87878787
193 #define GIFT128T_TWEAK_8 0x78787878
194 #define GIFT128T_TWEAK_9 0x99999999
195 #define GIFT128T_TWEAK_10 0xaaaaaaaa
196 #define GIFT128T_TWEAK_11 0x4b4b4b4b
197 #define GIFT128T_TWEAK_12 0xcccccccc
198 #define GIFT128T_TWEAK_13 0x2d2d2d2d
199 #define GIFT128T_TWEAK_14 0x1e1e1e1e
200 #define GIFT128T_TWEAK_15 0xffffffff
218 void gift128t_encrypt
219 (
const gift128n_key_schedule_t *ks,
unsigned char *output,
220 const unsigned char *input, uint32_t tweak);
239 (
const gift128n_key_schedule_t *ks,
unsigned char *output,
240 const unsigned char *input, uint32_t tweak);
void gift128n_decrypt(const gift128n_key_schedule_t *ks, unsigned char *output, const unsigned char *input)
Decrypts a 128-bit block with GIFT-128 (nibble-based).
Definition: internal-gift128.c:271
Structure of the key schedule for GIFT-128 (bit-sliced).
Definition: internal-gift128.h:82
void gift128n_init(gift128n_key_schedule_t *ks, const unsigned char *key)
Initializes the key schedule for GIFT-128 (nibble-based).
Definition: internal-gift128.c:464
void gift128n_encrypt(const gift128n_key_schedule_t *ks, unsigned char *output, const unsigned char *input)
Encrypts a 128-bit block with GIFT-128 (nibble-based).
Definition: internal-gift128.c:262
#define GIFT128_ROUND_KEYS
Number of round keys for the GIFT-128 key schedule.
Definition: internal-gift128.h:76
void gift128b_init(gift128b_key_schedule_t *ks, const unsigned char *key)
Initializes the key schedule for GIFT-128 (bit-sliced).
Definition: internal-gift128.c:457
void gift128b_decrypt(const gift128b_key_schedule_t *ks, unsigned char *output, const unsigned char *input)
Decrypts a 128-bit block with GIFT-128 (bit-sliced).
Definition: internal-gift128.c:1215
Configures the variant of GIFT-128 to use.
void gift128b_encrypt_preloaded(const gift128b_key_schedule_t *ks, uint32_t output[4], const uint32_t input[4])
Encrypts a 128-bit block with GIFT-128 (bit-sliced and pre-loaded).
Definition: internal-gift128.c:949
void gift128t_decrypt(const gift128n_key_schedule_t *ks, unsigned char *output, const unsigned char *input, uint32_t tweak)
Decrypts a 128-bit block with TweGIFT-128 (tweakable variant).
Definition: internal-gift128.c:1244
gift128b_key_schedule_t gift128n_key_schedule_t
Structure of the key schedule for GIFT-128 (nibble-based).
Definition: internal-gift128.h:146
void gift128b_encrypt(const gift128b_key_schedule_t *ks, unsigned char *output, const unsigned char *input)
Encrypts a 128-bit block with GIFT-128 (bit-sliced).
Definition: internal-gift128.c:920