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

Masked implementation of the TinyJAMBU permutation. More...

#include "internal-masking.h"

Go to the source code of this file.

Macros

#define TINY_JAMBU_MASKED_STATE_SIZE   4
 Size of the TinyJAMBU state in masked 32-bit words.
 
#define TINYJAMBU_MASKED_ROUNDS(steps)   ((steps) / 128)
 Converts a number of steps into a number of rounds, where each round consists of 128 steps. More...
 

Functions

void tiny_jambu_permutation_masked (mask_uint32_t state[TINY_JAMBU_MASKED_STATE_SIZE], const mask_uint32_t *key, unsigned key_words, unsigned rounds)
 Perform the TinyJAMBU permutation in masked form. More...
 

Detailed Description

Masked implementation of the TinyJAMBU permutation.

Macro Definition Documentation

#define TINYJAMBU_MASKED_ROUNDS (   steps)    ((steps) / 128)

Converts a number of steps into a number of rounds, where each round consists of 128 steps.

Parameters
stepsThe number of steps to perform; 384, 1024, 1152, or 1280.
Returns
The number of rounds corresponding to steps.

Function Documentation

void tiny_jambu_permutation_masked ( mask_uint32_t  state[TINY_JAMBU_MASKED_STATE_SIZE],
const mask_uint32_t key,
unsigned  key_words,
unsigned  rounds 
)

Perform the TinyJAMBU permutation in masked form.

Parameters
stateTinyJAMBU state to be permuted in masked form.
keyPoints to the masked key words.
key_wordsThe number of words in the masked key.
roundsThe number of rounds to perform.

The number of key words should be 4 for TinyJAMBU-128, 12 for TinyJAMBU-192, and 8 for TinuJAMBU-256. The TinyJAMBU-192 key is duplicated so that the key_words parameter is a multiple of 4.

Note
The words of the key must be the inverted version of the actual key so that we can replace NAND with AND operations when evaluating the permutation.