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

Masked implementation of the KNOT permutation. More...

#include "internal-masking.h"

Go to the source code of this file.

Data Structures

struct  knot256_masked_state_t
 Internal state of the masked KNOT-256 permutation. More...
 
struct  knot384_masked_state_t
 Internal state of the masked KNOT-384 permutation. More...
 
struct  knot512_masked_state_t
 Internal state of the masked KNOT-512 permutation. More...
 

Functions

void knot256_masked_permute_6 (knot256_masked_state_t *state, uint8_t rounds)
 Permutes the KNOT-256 state, using 6-bit round constants. More...
 
void knot256_masked_permute_7 (knot256_masked_state_t *state, uint8_t rounds)
 Permutes the KNOT-256 state, using 7-bit round constants. More...
 
void knot256_mask (knot256_masked_state_t *output, const uint64_t input[4])
 Converts an unmasked KNOT-256 state into a masked state. More...
 
void knot256_unmask (uint64_t output[4], const knot256_masked_state_t *input)
 Converts a masked KNOT-256 state into an unmasked state. More...
 
void knot384_masked_permute_7 (knot384_masked_state_t *state, uint8_t rounds)
 Permutes the KNOT-384 state, using 7-bit round constants. More...
 
void knot384_mask (knot384_masked_state_t *output, const uint32_t input[12])
 Converts an unmasked KNOT-384 state into a masked state. More...
 
void knot384_unmask (uint32_t output[12], const knot384_masked_state_t *input)
 Converts a masked KNOT-384 state into an unmasked state. More...
 
void knot512_masked_permute_7 (knot512_masked_state_t *state, uint8_t rounds)
 Permutes the KNOT-512 state, using 7-bit round constants. More...
 
void knot512_masked_permute_8 (knot512_masked_state_t *state, uint8_t rounds)
 Permutes the KNOT-512 state, using 8-bit round constants. More...
 
void knot512_mask (knot512_masked_state_t *output, const uint64_t input[8])
 Converts an unmasked KNOT-512 state into a masked state. More...
 
void knot512_unmask (uint64_t output[8], const knot512_masked_state_t *input)
 Converts a masked KNOT-512 state into an unmasked state. More...
 

Detailed Description

Masked implementation of the KNOT permutation.

Function Documentation

void knot256_mask ( knot256_masked_state_t output,
const uint64_t  input[4] 
)

Converts an unmasked KNOT-256 state into a masked state.

Parameters
outputThe output masked state in host byte order.
inputThe input unmasked state, in little-endian byte order.
void knot256_masked_permute_6 ( knot256_masked_state_t state,
uint8_t  rounds 
)

Permutes the KNOT-256 state, using 6-bit round constants.

Parameters
stateThe KNOT-256 state to be permuted.
roundsThe number of rounds to be performed, 1 to 52.

The input and output state will be in host byte order.

void knot256_masked_permute_7 ( knot256_masked_state_t state,
uint8_t  rounds 
)

Permutes the KNOT-256 state, using 7-bit round constants.

Parameters
stateThe KNOT-256 state to be permuted.
roundsThe number of rounds to be performed, 1 to 104.

The input and output state will be in host byte order.

void knot256_unmask ( uint64_t  output[4],
const knot256_masked_state_t input 
)

Converts a masked KNOT-256 state into an unmasked state.

Parameters
outputThe output unmasked state, in little-endian byte order.
inputThe input masked state in host byte order.
void knot384_mask ( knot384_masked_state_t output,
const uint32_t  input[12] 
)

Converts an unmasked KNOT-384 state into a masked state.

Parameters
outputThe output masked state in host byte order.
inputThe input unmasked state, in little-endian byte order.
void knot384_masked_permute_7 ( knot384_masked_state_t state,
uint8_t  rounds 
)

Permutes the KNOT-384 state, using 7-bit round constants.

Parameters
stateThe KNOT-384 state to be permuted.
roundsThe number of rounds to be performed, 1 to 104.

The input and output state will be in host byte order.

void knot384_unmask ( uint32_t  output[12],
const knot384_masked_state_t input 
)

Converts a masked KNOT-384 state into an unmasked state.

Parameters
outputThe output unmasked state, in little-endian byte order.
inputThe input masked state in host byte order.
void knot512_mask ( knot512_masked_state_t output,
const uint64_t  input[8] 
)

Converts an unmasked KNOT-512 state into a masked state.

Parameters
outputThe output masked state in host byte order.
inputThe input unmasked state, in little-endian byte order.
void knot512_masked_permute_7 ( knot512_masked_state_t state,
uint8_t  rounds 
)

Permutes the KNOT-512 state, using 7-bit round constants.

Parameters
stateThe KNOT-512 state to be permuted.
roundsThe number of rounds to be performed, 1 to 104.

The input and output state will be in host byte order.

void knot512_masked_permute_8 ( knot512_masked_state_t state,
uint8_t  rounds 
)

Permutes the KNOT-512 state, using 8-bit round constants.

Parameters
stateThe KNOT-512 state to be permuted.
roundsThe number of rounds to be performed, 1 to 140.

The input and output state will be in host byte order.

void knot512_unmask ( uint64_t  output[8],
const knot512_masked_state_t input 
)

Converts a masked KNOT-512 state into an unmasked state.

Parameters
outputThe output unmasked state, in little-endian byte order.
inputThe input masked state in host byte order.