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

SKINNY-128-384+ block cipher. More...

#include <stddef.h>
#include <stdint.h>
#include "internal-skinny-plus-config.h"

Go to the source code of this file.

Data Structures

struct  skinny_plus_key_schedule_t
 Structure of the key schedule for SKINNY-128-384+. More...
 

Macros

#define SKINNY_PLUS_BLOCK_SIZE   16
 Size of a block for SKINNY-128-384+.
 
#define SKINNY_PLUS_ROUNDS   40
 Number of rounds for SKINNY-128-384+.
 

Functions

void skinny_plus_init (skinny_plus_key_schedule_t *ks, const unsigned char key[48])
 Initializes the key schedule for SKINNY-128-384+. More...
 
void skinny_plus_init_without_tk1 (skinny_plus_key_schedule_t *ks, const unsigned char *tk2, const unsigned char *tk3)
 Initializes the key schedule for SKINNY-128-384+ without TK1. More...
 
void skinny_plus_encrypt (const skinny_plus_key_schedule_t *ks, unsigned char *output, const unsigned char *input)
 Encrypts a 128-bit block with SKINNY-128-384+. More...
 
void skinny_plus_decrypt (const skinny_plus_key_schedule_t *ks, unsigned char *output, const unsigned char *input)
 Decrypts a 128-bit block with SKINNY-128-384+. More...
 
void skinny_plus_encrypt_tk_full (const unsigned char key[48], unsigned char *output, const unsigned char *input)
 Encrypts a 128-bit block with SKINNY-128-384+ and a fully specified tweakey value. More...
 
void skinny_plus_decrypt_tk_full (const unsigned char key[48], unsigned char *output, const unsigned char *input)
 Decrypts a 128-bit block with SKINNY-128-384+ and a fully specified tweakey value. More...
 

Detailed Description

SKINNY-128-384+ block cipher.

References: https://eprint.iacr.org/2016/660.pdf, https://romulusae.github.io/romulus/

Function Documentation

void skinny_plus_decrypt ( const skinny_plus_key_schedule_t ks,
unsigned char *  output,
const unsigned char *  input 
)

Decrypts a 128-bit block with SKINNY-128-384+.

Parameters
ksPoints to the SKINNY-128-384+ 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.

void skinny_plus_decrypt_tk_full ( const unsigned char  key[48],
unsigned char *  output,
const unsigned char *  input 
)

Decrypts a 128-bit block with SKINNY-128-384+ and a fully specified tweakey value.

Parameters
keyPoints to the 384-bit tweakey value.
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 is useful when the entire tweakey changes from block to block. It is slower than the other versions of SKINNY-128-384+ but more memory-efficient.

void skinny_plus_encrypt ( const skinny_plus_key_schedule_t ks,
unsigned char *  output,
const unsigned char *  input 
)

Encrypts a 128-bit block with SKINNY-128-384+.

Parameters
ksPoints to the SKINNY-128-384+ 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.

void skinny_plus_encrypt_tk_full ( const unsigned char  key[48],
unsigned char *  output,
const unsigned char *  input 
)

Encrypts a 128-bit block with SKINNY-128-384+ and a fully specified tweakey value.

Parameters
keyPoints to the 384-bit tweakey value.
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 is useful when the entire tweakey changes from block to block. It is slower than the other versions of SKINNY-128-384+ but more memory-efficient.

void skinny_plus_init ( skinny_plus_key_schedule_t ks,
const unsigned char  key[48] 
)

Initializes the key schedule for SKINNY-128-384+.

Parameters
ksPoints to the key schedule to initialize.
keyPoints to the key data.
void skinny_plus_init_without_tk1 ( skinny_plus_key_schedule_t ks,
const unsigned char *  tk2,
const unsigned char *  tk3 
)

Initializes the key schedule for SKINNY-128-384+ without TK1.

Parameters
ksPoints to the key schedule to initialize.
tk2Points to the 16 bytes of key data for TK2.
tk3Points to the 16 bytes of key data for TK3.