Lightweight Cryptography Primitives
|
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... | |
Internal implementation details of the Spook AEAD mode.
#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.
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.
key | Points to the key to decrypt with. |
output | Output buffer for the plaintext. |
input | Input buffer for the ciphertext. |
tweak | Points to the tweak to decrypt with. |
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.
key | Points to the key to decrypt with. |
output | Output buffer for the plaintext. |
input | Input buffer for the ciphertext. |
tweak | Points to the tweak to decrypt with. |
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.
key | Points to the key to encrypt with. |
output | Output buffer for the ciphertext. |
input | Input buffer for the plaintext. |
tweak | Points to the tweak to encrypt with. |
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.
key | Points to the key to encrypt with. |
output | Output buffer for the ciphertext. |
input | Input buffer for the plaintext. |
tweak | Points to the tweak to encrypt with. |
void shadow384 | ( | shadow384_state_t * | state | ) |
Performs the Shadow-384 permutation on a state.
state | The Shadow-384 state which will be in little-endian byte order on input and output. |
void shadow512 | ( | shadow512_state_t * | state | ) |
Performs the Shadow-512 permutation on a state.
state | The Shadow-512 state which will be in little-endian byte order on input and output. |