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

Saturnin block cipher. More...

#include "internal-util.h"

Go to the source code of this file.

Data Structures

struct  saturnin_key_schedule_t
 Structure of the key schedule for Saturnin. More...
 

Macros

#define SATURNIN_BLOCK_SIZE   32
 Size of a Saturnin block in bytes.
 
#define SATURNIN_DOMAIN_10_1   0
 Domain separator index 1 for the 10-round version of Saturnin.
 
#define SATURNIN_DOMAIN_10_2   10
 Domain separator index 2 for the 10-round version of Saturnin.
 
#define SATURNIN_DOMAIN_10_3   20
 Domain separator index 3 for the 10-round version of Saturnin.
 
#define SATURNIN_DOMAIN_10_4   30
 Domain separator index 4 for the 10-round version of Saturnin.
 
#define SATURNIN_DOMAIN_10_5   40
 Domain separator index 5 for the 10-round version of Saturnin.
 
#define SATURNIN_DOMAIN_10_6   50
 Domain separator index 6 for the 10-round version of Saturnin.
 
#define SATURNIN_DOMAIN_16_7   60
 Domain separator index 7 for the 16-round version of Saturnin.
 
#define SATURNIN_DOMAIN_16_8   76
 Domain separator index 8 for the 16-round version of Saturnin.
 

Functions

void saturnin_setup_key (saturnin_key_schedule_t *ks, const unsigned char *key)
 Sets up a key schedule for Saturnin. More...
 
void saturnin_encrypt_block (const saturnin_key_schedule_t *ks, unsigned char *output, const unsigned char *input, unsigned domain)
 Encrypts a 256-bit block with Saturnin. More...
 
void saturnin_decrypt_block (const saturnin_key_schedule_t *ks, unsigned char *output, const unsigned char *input, unsigned domain)
 Decrypts a 256-bit block with Saturnin. More...
 

Detailed Description

Saturnin block cipher.

References: https://project.inria.fr/saturnin/

Function Documentation

void saturnin_decrypt_block ( const saturnin_key_schedule_t ks,
unsigned char *  output,
const unsigned char *  input,
unsigned  domain 
)

Decrypts a 256-bit block with Saturnin.

Parameters
ksPoints to the Saturnin key schedule.
outputOutput buffer which must be at least 32 bytes in length.
inputInput buffer which must be at least 32 bytes in length.
domainDomain separator and round count indicator.

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

void saturnin_encrypt_block ( const saturnin_key_schedule_t ks,
unsigned char *  output,
const unsigned char *  input,
unsigned  domain 
)

Encrypts a 256-bit block with Saturnin.

Parameters
ksPoints to the Saturnin key schedule.
outputOutput buffer which must be at least 32 bytes in length.
inputInput buffer which must be at least 32 bytes in length.
domainDomain separator and round count indicator.

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

void saturnin_setup_key ( saturnin_key_schedule_t ks,
const unsigned char *  key 
)

Sets up a key schedule for Saturnin.

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