23 #ifndef LW_INTERNAL_TINYJAMBU_H
24 #define LW_INTERNAL_TINYJAMBU_H
26 #include "internal-util.h"
38 #if defined(LW_UTIL_CPU_IS_64BIT)
39 #define TINY_JAMBU_64BIT 1
41 #define TINY_JAMBU_64BIT 0
82 #define tiny_jambu_key_load_even(ptr) \
83 ((tiny_jambu_key_word_t)(~(le_load_word32((ptr)))))
84 #define tiny_jambu_key_load_odd(ptr) \
85 (((tiny_jambu_key_word_t)(~(le_load_word32((ptr))))) << 32)
87 #define tiny_jambu_key_load_even(ptr) \
88 ((tiny_jambu_key_word_t)(~(le_load_word32((ptr)))))
89 #define tiny_jambu_key_load_odd(ptr) \
90 ((tiny_jambu_key_word_t)(~(le_load_word32((ptr)))))
121 #define tiny_jambu_init_state(state) \
122 ((state)->t[0] = (state)->t[1] = 0)
123 #define tiny_jambu_add_domain(state, domain) \
124 ((state)->t[0] ^= ((uint64_t)(domain)) << 32)
125 #define tiny_jambu_absorb(state, word) \
126 ((state)->t[1] ^= ((uint64_t)(word)) << 32)
127 #define tiny_jambu_squeeze(state) ((uint32_t)((state)->t[1]))
129 #define tiny_jambu_init_state(state) \
130 ((state)->s[0] = (state)->s[1] = (state)->s[2] = (state)->s[3] = 0)
131 #define tiny_jambu_add_domain(state, domain) \
132 ((state)->s[1] ^= (domain))
133 #define tiny_jambu_absorb(state, word) \
134 ((state)->s[3] ^= (word))
135 #define tiny_jambu_squeeze(state) ((state)->s[2])
146 #define TINYJAMBU_ROUNDS(steps) ((steps) / 128)
TinyJAMBU permutation state.
Definition: internal-tinyjambu.h:48
void tiny_jambu_permutation_128(tiny_jambu_state_t *state, const tiny_jambu_key_word_t *key, unsigned rounds)
Perform the TinyJAMBU-128 permutation.
Definition: internal-tinyjambu.c:52
uint32_t tiny_jambu_key_word_t
Size of a word in the key schedule (32 or 64 bits).
Definition: internal-tinyjambu.h:64
void tiny_jambu_permutation_256(tiny_jambu_state_t *state, const tiny_jambu_key_word_t *key, unsigned rounds)
Perform the TinyJAMBU-256 permutation.
Definition: internal-tinyjambu.c:138
void tiny_jambu_permutation_192(tiny_jambu_state_t *state, const tiny_jambu_key_word_t *key, unsigned rounds)
Perform the TinyJAMBU-192 permutation.
Definition: internal-tinyjambu.c:90