Internal implementation of the WAGE permutation.
More...
#include "internal-util.h"
Go to the source code of this file.
Internal implementation of the WAGE permutation.
References: https://uwaterloo.ca/communications-security-lab/lwc/wage
#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.
void wage_absorb |
( |
unsigned char |
s[WAGE_STATE_SIZE], |
|
|
const unsigned char |
data[8] |
|
) |
| |
Absorbs 8 bytes into the WAGE state.
- Parameters
-
s | The WAGE state to be permuted. |
data | The 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
-
s | The WAGE state to be permuted. |
key | Points 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
-
s | The WAGE state to extract the tag from. |
tag | Points 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
-
s | The WAGE state to get the bytes from. |
data | Points 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
-
s | The WAGE state to be initialized. |
key | Points to the 128-bit key. |
nonce | Points to the 128-bit nonce. |
void wage_permute |
( |
unsigned char |
s[WAGE_STATE_SIZE] | ) |
|
Permutes the WAGE state.
- Parameters
-
s | The 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
-
s | The WAGE state to set the rate in. |
data | Points to the bytes to set into the rate. |