Internal implementation of the TinyJAMBU permutation.
More...
#include "internal-util.h"
Go to the source code of this file.
Internal implementation of the TinyJAMBU permutation.
#define tiny_jambu_absorb |
( |
|
state, |
|
|
|
word |
|
) |
| ((state)->s[3] ^= (word)) |
Absorbs a 32-bit word into the TinyJAMBU state.
- Parameters
-
state | TinyJAMBU state to be updated. |
word | Word value to absorb. |
#define tiny_jambu_add_domain |
( |
|
state, |
|
|
|
domain |
|
) |
| ((state)->s[1] ^= (domain)) |
Adds a domain separation value to the TinyJAMBU state.
- Parameters
-
state | TinyJAMBU state to be updated. |
domain | Domain separation value to add. |
#define tiny_jambu_init_state |
( |
|
state | ) |
((state)->s[0] = (state)->s[1] = (state)->s[2] = (state)->s[3] = 0) |
Initializes a TinyJAMBU state to zero.
- Parameters
-
state | TinyJAMBU state to be initialized. |
Loads an even key word for TinyJAMBU.
- Parameters
-
ptr | Points to the 4 bytes of the key word in little-endian order. |
- Returns
- The key word.
Loads an odd key word for TinyJAMBU.
- Parameters
-
ptr | Points to the 4 bytes of the key word in little-endian order. |
- Returns
- The key word.
#define tiny_jambu_squeeze |
( |
|
state | ) |
((state)->s[2]) |
Squeezes a 32-bit word from the TinyJAMBU state.
- Parameters
-
state | TinyJAMBU state to squeeze from. |
- Returns
- Word value that was squeezed out.
#define TINYJAMBU_ROUNDS |
( |
|
steps | ) |
((steps) / 128) |
Converts a number of steps into a number of rounds, where each round consists of 128 steps.
- Parameters
-
steps | The number of steps to perform; 384, 1024, 1152, or 1280. |
- Returns
- The number of rounds corresponding to steps.
Perform the TinyJAMBU-128 permutation.
- Parameters
-
state | TinyJAMBU-128 state to be permuted. |
key | Points to the 4 key words. |
rounds | The number of rounds to perform. |
- 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.
Perform the TinyJAMBU-192 permutation.
- Parameters
-
state | TinyJAMBU-192 state to be permuted. |
key | Points to the 6 key words. |
rounds | The number of rounds to perform. |
- 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.
Perform the TinyJAMBU-256 permutation.
- Parameters
-
state | TinyJAMBU-256 state to be permuted. |
key | Points to the 8 key words. |
rounds | The number of rounds to perform. |
- 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.