Lightweight Cryptography Primitives
 All Data Structures Files Functions Variables Typedefs Macros Pages
Data Structures | Macros | Functions
internal-gift128-m.h File Reference

Masked version of the GIFT-128 block cipher. More...

#include "internal-masking.h"
#include "internal-gift128-config.h"

Go to the source code of this file.

Data Structures

struct  gift128b_masked_key_schedule_t
 Structure of the key schedule for masked GIFT-128 (bit-sliced). More...
 

Macros

#define GIFT128_MASKED_BLOCK_SIZE   16
 Size of a GIFT-128 block in bytes.
 
#define GIFT128_MASKED_ROUND_KEYS   80
 Number of round keys for the GIFT-128 key schedule.
 

Functions

void gift128b_init_masked (gift128b_masked_key_schedule_t *ks, const unsigned char *key)
 Initializes the key schedule for masked GIFT-128 (bit-sliced). More...
 
void gift128b_encrypt_preloaded_masked (const gift128b_masked_key_schedule_t *ks, mask_uint32_t output[4], const mask_uint32_t input[4])
 Encrypts a block with masked GIFT-128 (bit-sliced and pre-loaded). More...
 
void gift128b_decrypt_preloaded_masked (const gift128b_masked_key_schedule_t *ks, mask_uint32_t output[4], const mask_uint32_t input[4])
 Decrypts a block with masked GIFT-128 (bit-sliced and pre-loaded). More...
 

Detailed Description

Masked version of the GIFT-128 block cipher.

Function Documentation

void gift128b_decrypt_preloaded_masked ( const gift128b_masked_key_schedule_t ks,
mask_uint32_t  output[4],
const mask_uint32_t  input[4] 
)

Decrypts a block with masked GIFT-128 (bit-sliced and pre-loaded).

Parameters
ksPoints to the masked GIFT-128 key schedule.
outputOutput buffer which must be at least 16 bytes in length.
inputInput buffer which must be at least 16 bytes in length.

The input and output buffers can be the same buffer for in-place decryption.

This version assumes that the input has already been pre-loaded from big-endian into host byte order in the supplied word array. The output is delivered in the same way.

void gift128b_encrypt_preloaded_masked ( const gift128b_masked_key_schedule_t ks,
mask_uint32_t  output[4],
const mask_uint32_t  input[4] 
)

Encrypts a block with masked GIFT-128 (bit-sliced and pre-loaded).

Parameters
ksPoints to the masked GIFT-128 key schedule.
outputOutput buffer which must be at least 16 bytes in length.
inputInput buffer which must be at least 16 bytes in length.

The input and output buffers can be the same buffer for in-place encryption.

This version assumes that the input has already been pre-loaded from big-endian into host byte order in the supplied word array. The output is delivered in the same way.

void gift128b_init_masked ( gift128b_masked_key_schedule_t ks,
const unsigned char *  key 
)

Initializes the key schedule for masked GIFT-128 (bit-sliced).

Parameters
ksPoints to the key schedule to initialize.
keyPoints to the 16 bytes of the key data.