Header file for speck.cc: Analysis of block cipher Speck [ePrint 2013/404]. .
More...
Go to the source code of this file.
|
|
#define | SPECK_MAX_NKEY_WORDS 4 |
| |
|
#define | SPECK_KEY_LEN_BITS 128 |
| |
|
#define | SPECK_MAX_NROUNDS 34 |
| |
|
#define | SPECK_RIGHT_ROT_CONST 8 |
| |
|
#define | SPECK_LEFT_ROT_CONST 3 |
| |
|
#define | SPECK_RIGHT_ROT_CONST_16BITS 7 |
| |
|
#define | SPECK_LEFT_ROT_CONST_16BITS 2 |
| |
|
#define | SPECK_P_THRES (1.0 / (double)(1UL << 16)) |
| |
|
#define | SPECK_MAX_DIFF_CNT (1ULL << 22) |
| |
|
#define | SPECK_NPAIRS (1ULL << 24) |
| |
|
#define | SPECK_BEST_TRAIL_LOG2P -58 |
| |
|
#define | SPECK_MAX_HW 16 |
| |
|
#define | SPECK_CLUSTER_MAX_HW 9 |
| |
|
#define | SPECK_BACK_TO_HWAY 0 |
| |
|
#define | SPECK_GREEDY_SEARCH 0 |
| |
|
#define | SPECK_NDIFFS 2 |
| |
|
#define | SPECK_EPS (double)(1.0 / (double)(1ULL << 15)) |
| |
|
#define | SPECK_DEBUG 0 |
| |
|
#define | SPECK_TRAIL_LEN_MAX 14 |
| |
|
#define | SPECK_BEST_TRAILS_LATEX_FILE "speck-trails.tex" |
| |
|
#define | SPECK_48 0 |
| |
|
#define | SPECK_P_THRES (1.0 / (double)(1UL << 5)) |
| |
|
#define | SPECK_USE_PRECOMPUTED_BOUNDS 0 |
| |
|
#define | SPECK_TRAIL_LEN 20 |
| |
|
#define | SPECK_LOG_FILE "speck.log" |
| |
|
| uint32_t | speck_compute_nkeywords (uint32_t word_size, uint32_t key_size) |
| |
| uint32_t | speck_get_keysize (uint32_t word_size) |
| |
| void | speck_get_rot_const (uint32_t word_size, uint32_t *alpha, uint32_t *beta) |
| |
| uint32_t | speck_compute_nrounds (uint32_t word_size, uint32_t nkey_words) |
| |
| void | speck_key_expansion (WORD_T key[SPECK_MAX_NROUNDS], uint32_t nrounds, uint32_t nkey_words, uint32_t alpha, uint32_t beta) |
| |
| void | speck_encrypt (WORD_T key[SPECK_MAX_NROUNDS], uint32_t nrounds, uint32_t alpha, uint32_t beta, WORD_T *x_in, WORD_T *y_in) |
| |
|
void | speck_decrypt (WORD_T key[SPECK_MAX_NROUNDS], uint32_t nrounds, uint32_t alpha, uint32_t beta, WORD_T *x_in, WORD_T *y_in) |
| |
Header file for speck.cc: Analysis of block cipher Speck [ePrint 2013/404]. .
- Author
- V.Velichkov, vesse.nosp@m.lin..nosp@m.velic.nosp@m.hkov.nosp@m.@uni..nosp@m.lu
- Date
- 2012-2013
| uint32_t speck_compute_nkeywords |
( |
uint32_t |
word_size, |
|
|
uint32_t |
key_size |
|
) |
| |
Compute the number of key words depending on the word size
- Parameters
-
| word_size | word size |
| key_size | key size in bits |
| uint32_t speck_compute_nrounds |
( |
uint32_t |
word_size, |
|
|
uint32_t |
nkey_words |
|
) |
| |
Compute the number of rounds for Speck and the index of the z-sequence
- Parameters
-
| word_size | word size |
| nkey_words | number of key words |
- Returns
- number of rounds
| void speck_encrypt |
( |
WORD_T |
key[SPECK_MAX_NROUNDS], |
|
|
uint32_t |
nrounds, |
|
|
uint32_t |
alpha, |
|
|
uint32_t |
beta, |
|
|
WORD_T * |
x_in, |
|
|
WORD_T * |
y_in |
|
) |
| |
Speck encryption procedure.
- Parameters
-
| key | expanded key |
| nrounds | number of rounds |
| alpha | right rotation constant |
| beta | left rotation constant |
| x_in | first plaintext word |
| y_in | second plaintext word |
| uint32_t speck_get_keysize |
( |
uint32_t |
word_size | ) |
|
Get the size of the key in bits depending on the word size
- Parameters
-
| word_size | word size in bits |
| void speck_get_rot_const |
( |
uint32_t |
word_size, |
|
|
uint32_t * |
alpha, |
|
|
uint32_t * |
beta |
|
) |
| |
Get the rotation constants.
| void speck_key_expansion |
( |
WORD_T |
key[SPECK_MAX_NROUNDS], |
|
|
uint32_t |
nrounds, |
|
|
uint32_t |
nkey_words, |
|
|
uint32_t |
alpha, |
|
|
uint32_t |
beta |
|
) |
| |
Speck key expansion procedure.
- Parameters
-
| key | original key (with enough space for the expanded key) |
| nrounds | number of rounds |
| nkey_words | number of key words |
| alpha | right rotation constant |
| beta | left rotation constant |