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

Internal implementation details of the Spook AEAD mode. More...

#include "internal-util.h"

Go to the source code of this file.

Data Structures

union  shadow512_state_t
 Internal state of the Shadow-512 permutation. More...
 
union  shadow384_state_t
 Internal state of the Shadow-384 permutation. More...
 

Macros

#define CLYDE128_BLOCK_SIZE   16
 Size of the block for the Clyde-128 block cipher.
 
#define CLYDE128_KEY_SIZE   16
 Size of the key for the Clyde-128 block cipher.
 
#define CLYDE128_TWEAK_SIZE   16
 Size of the tweak for the Clyde-128 block cipher.
 
#define CLYDE128_STEPS   6
 Number of steps in the Clyde-128 block cipher. More...
 
#define SHADOW512_STATE_SIZE   64
 Size of the state for Shadow-512.
 
#define SHADOW512_RATE   32
 Rate to absorb data into or squeeze data out of a Shadow-512 state.
 
#define SHADOW384_STATE_SIZE   48
 Size of the state for Shadow-384.
 
#define SHADOW384_RATE   16
 Rate to absorb data into or squeeze data out of a Shadow-384 state.
 

Functions

void clyde128_encrypt (const unsigned char key[CLYDE128_KEY_SIZE], uint32_t output[CLYDE128_BLOCK_SIZE/4], const uint32_t input[CLYDE128_BLOCK_SIZE/4], const uint32_t tweak[CLYDE128_TWEAK_SIZE/4])
 Encrypts a block with the Clyde-128 block cipher. More...
 
void clyde128_decrypt (const unsigned char key[CLYDE128_KEY_SIZE], uint32_t output[CLYDE128_BLOCK_SIZE/4], const unsigned char input[CLYDE128_BLOCK_SIZE], const uint32_t tweak[CLYDE128_TWEAK_SIZE/4])
 Decrypts a block with the Clyde-128 block cipher. More...
 
void clyde128_encrypt_masked (const unsigned char key[CLYDE128_KEY_SIZE], uint32_t output[CLYDE128_BLOCK_SIZE/4], const uint32_t input[CLYDE128_BLOCK_SIZE/4], const uint32_t tweak[CLYDE128_TWEAK_SIZE/4])
 Encrypts a block with the Clyde-128 block cipher in masked mode. More...
 
void clyde128_decrypt_masked (const unsigned char key[CLYDE128_KEY_SIZE], uint32_t output[CLYDE128_BLOCK_SIZE/4], const unsigned char input[CLYDE128_BLOCK_SIZE], const uint32_t tweak[CLYDE128_TWEAK_SIZE/4])
 Decrypts a block with the Clyde-128 block cipher in masked mode. More...
 
void shadow512 (shadow512_state_t *state)
 Performs the Shadow-512 permutation on a state. More...
 
void shadow384 (shadow384_state_t *state)
 Performs the Shadow-384 permutation on a state. More...
 

Detailed Description

Internal implementation details of the Spook AEAD mode.

Macro Definition Documentation

#define CLYDE128_STEPS   6

Number of steps in the Clyde-128 block cipher.

This is also the number of steps in the Shadow-512 and Shadow-384 permutations.

Function Documentation

void clyde128_decrypt ( const unsigned char  key[CLYDE128_KEY_SIZE],
uint32_t  output[CLYDE128_BLOCK_SIZE/4],
const unsigned char  input[CLYDE128_BLOCK_SIZE],
const uint32_t  tweak[CLYDE128_TWEAK_SIZE/4] 
)

Decrypts a block with the Clyde-128 block cipher.

Parameters
keyPoints to the key to decrypt with.
outputOutput buffer for the plaintext.
inputInput buffer for the ciphertext.
tweakPoints to the tweak to decrypt with.
See Also
clyde128_encrypt()
void clyde128_decrypt_masked ( const unsigned char  key[CLYDE128_KEY_SIZE],
uint32_t  output[CLYDE128_BLOCK_SIZE/4],
const unsigned char  input[CLYDE128_BLOCK_SIZE],
const uint32_t  tweak[CLYDE128_TWEAK_SIZE/4] 
)

Decrypts a block with the Clyde-128 block cipher in masked mode.

Parameters
keyPoints to the key to decrypt with.
outputOutput buffer for the plaintext.
inputInput buffer for the ciphertext.
tweakPoints to the tweak to decrypt with.
See Also
clyde128_encrypt()
void clyde128_encrypt ( const unsigned char  key[CLYDE128_KEY_SIZE],
uint32_t  output[CLYDE128_BLOCK_SIZE/4],
const uint32_t  input[CLYDE128_BLOCK_SIZE/4],
const uint32_t  tweak[CLYDE128_TWEAK_SIZE/4] 
)

Encrypts a block with the Clyde-128 block cipher.

Parameters
keyPoints to the key to encrypt with.
outputOutput buffer for the ciphertext.
inputInput buffer for the plaintext.
tweakPoints to the tweak to encrypt with.
See Also
clyde128_decrypt()
void clyde128_encrypt_masked ( const unsigned char  key[CLYDE128_KEY_SIZE],
uint32_t  output[CLYDE128_BLOCK_SIZE/4],
const uint32_t  input[CLYDE128_BLOCK_SIZE/4],
const uint32_t  tweak[CLYDE128_TWEAK_SIZE/4] 
)

Encrypts a block with the Clyde-128 block cipher in masked mode.

Parameters
keyPoints to the key to encrypt with.
outputOutput buffer for the ciphertext.
inputInput buffer for the plaintext.
tweakPoints to the tweak to encrypt with.
See Also
clyde128_decrypt()
void shadow384 ( shadow384_state_t state)

Performs the Shadow-384 permutation on a state.

Parameters
stateThe Shadow-384 state which will be in little-endian byte order on input and output.
See Also
shadow512()
void shadow512 ( shadow512_state_t state)

Performs the Shadow-512 permutation on a state.

Parameters
stateThe Shadow-512 state which will be in little-endian byte order on input and output.
See Also
shadow384()