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

Internal implementation of the WAGE permutation. More...

#include "internal-util.h"

Go to the source code of this file.

Macros

#define WAGE_STATE_SIZE   37
 Size of the WAGE state in bytes. More...
 

Functions

void wage_permute (unsigned char s[WAGE_STATE_SIZE])
 Permutes the WAGE state. More...
 
void wage_absorb (unsigned char s[WAGE_STATE_SIZE], const unsigned char data[8])
 Absorbs 8 bytes into the WAGE state. More...
 
void wage_get_rate (const unsigned char s[WAGE_STATE_SIZE], unsigned char data[8])
 Gets the 8 bytes of the rate from the WAGE state. More...
 
void wage_set_rate (unsigned char s[WAGE_STATE_SIZE], const unsigned char data[8])
 Sets the 8 bytes of the rate in the WAGE state. More...
 
void wage_absorb_key (unsigned char s[WAGE_STATE_SIZE], const unsigned char *key)
 Absorbs 16 key bytes into the WAGE state. More...
 
void wage_init (unsigned char s[WAGE_STATE_SIZE], const unsigned char *key, const unsigned char *nonce)
 Initializes the WAGE state with a key and nonce. More...
 
void wage_extract_tag (const unsigned char s[WAGE_STATE_SIZE], unsigned char tag[16])
 Extracts the 128-bit authentication tag from the WAGE state. More...
 

Detailed Description

Internal implementation of the WAGE permutation.

References: https://uwaterloo.ca/communications-security-lab/lwc/wage

Macro Definition Documentation

#define WAGE_STATE_SIZE   37

Size of the WAGE state in bytes.

The state is 259 bits, divided into 37 7-bit components, one per byte.

Function Documentation

void wage_absorb ( unsigned char  s[WAGE_STATE_SIZE],
const unsigned char  data[8] 
)

Absorbs 8 bytes into the WAGE state.

Parameters
sThe WAGE state to be permuted.
dataThe data to be absorbed.
void wage_absorb_key ( unsigned char  s[WAGE_STATE_SIZE],
const unsigned char *  key 
)

Absorbs 16 key bytes into the WAGE state.

Parameters
sThe WAGE state to be permuted.
keyPoints to the key data to be absorbed.
void wage_extract_tag ( const unsigned char  s[WAGE_STATE_SIZE],
unsigned char  tag[16] 
)

Extracts the 128-bit authentication tag from the WAGE state.

Parameters
sThe WAGE state to extract the tag from.
tagPoints to the buffer to receive the extracted tag.
void wage_get_rate ( const unsigned char  s[WAGE_STATE_SIZE],
unsigned char  data[8] 
)

Gets the 8 bytes of the rate from the WAGE state.

Parameters
sThe WAGE state to get the bytes from.
dataPoints to the buffer to receive the extracted bytes.
void wage_init ( unsigned char  s[WAGE_STATE_SIZE],
const unsigned char *  key,
const unsigned char *  nonce 
)

Initializes the WAGE state with a key and nonce.

Parameters
sThe WAGE state to be initialized.
keyPoints to the 128-bit key.
noncePoints to the 128-bit nonce.
void wage_permute ( unsigned char  s[WAGE_STATE_SIZE])

Permutes the WAGE state.

Parameters
sThe WAGE state to be permuted.
void wage_set_rate ( unsigned char  s[WAGE_STATE_SIZE],
const unsigned char  data[8] 
)

Sets the 8 bytes of the rate in the WAGE state.

Parameters
sThe WAGE state to set the rate in.
dataPoints to the bytes to set into the rate.