Header file for simon.cc:
More...
Go to the source code of this file.
|
#define | SIMON_LROT_CONST_S 1 |
|
#define | SIMON_LROT_CONST_T 8 |
|
#define | SIMON_LROT_CONST_U 2 |
|
#define | SIMON_NPAIRS (1ULL << 20) |
|
#define | SIMON_NROUNDS 20 |
|
#define | SIMON_NDIFFS 2 |
|
#define | SIMON_MAX_NKEY_WORDS 4 |
|
#define | SIMON_KEY_LEN_BITS 128 |
|
#define | SIMON_ZSEQ_LEN 62 |
|
#define | SIMON_MAX_NROUNDS 72 |
|
#define | SIMON_EPS (double)(1.0 / (double)(1ULL << 15)) |
|
#define | SIMON_DRAW_GRAPH 0 |
|
#define | SIMON_BACK_TO_HWAY true |
|
#define | SIMON_TRAIL_LEN_MAX 21 |
|
#define | SIMON_GVIZ_DATFILE "simon-gviz.dat" |
|
#define | SIMON_GVIZ_DATFILE_CON "simon-gviz-con.dat" |
|
#define | SIMON_BEST_TRAILS_LATEX_FILE "simon-trails.tex" |
|
#define | SIMON_GVIZ_CLUSTER_TRAILS_DATFILE "gviz-cluster-full.dat" |
|
#define | SIMON_GVIZ_CLUSTER_TRAILS_DATFILE_CON "gviz-cluster.dat" |
|
#define | SIMON_CLUSTER_TRAILS_DATFILE "temp.dat" |
|
|
void | simon_diff_graph_check_edge (std::vector< simon_diff_graph_edge_t > *E, const simon_diff_graph_edge_t new_edge) |
|
uint32_t | simon_compute_nkeywords (uint32_t word_size, uint32_t key_size) |
|
uint32_t | simon_get_keysize (uint32_t word_size) |
|
uint32_t | simon_compute_nrounds (uint32_t word_size, uint32_t nkey_words, uint32_t *zseq_j) |
|
void | simon_key_expansion (uint32_t key[SIMON_MAX_NROUNDS], uint32_t Z[5][62], uint32_t zseq_j, uint32_t nrounds, uint32_t nkey_words) |
|
void | simon_encrypt (uint32_t key[SIMON_MAX_NROUNDS], uint32_t nrounds, uint32_t *x_in, uint32_t *y_in) |
|
void | simon_encrypt_pairs (uint32_t key[SIMON_MAX_NROUNDS], uint32_t nrounds, uint32_t *x_in, uint32_t *y_in, uint32_t *xx_in, uint32_t *yy_in, std::vector< simon_diff_graph_edge_t > *E) |
|
uint32_t simon_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 simon_compute_nrounds |
( |
uint32_t |
word_size, |
|
|
uint32_t |
nkey_words, |
|
|
uint32_t * |
zseq_j |
|
) |
| |
Compute the number of rounds for Simon and the index of the z-sequence
- Parameters
-
word_size | word size |
nkey_words | number of key words |
zseq_j | index of the z-sequence g_simon_zseq |
- Returns
- number of rounds
void simon_encrypt |
( |
uint32_t |
key[SIMON_MAX_NROUNDS], |
|
|
uint32_t |
nrounds, |
|
|
uint32_t * |
x_in, |
|
|
uint32_t * |
y_in |
|
) |
| |
Simon encryption procedure.
- Parameters
-
key | expanded key |
nrounds | number of rounds |
x_in | first plaintext word |
y_in | second plaintext word |
uint32_t simon_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 simon_key_expansion |
( |
uint32_t |
key[SIMON_MAX_NROUNDS], |
|
|
uint32_t |
Z[5][62], |
|
|
uint32_t |
zseq_j, |
|
|
uint32_t |
nrounds, |
|
|
uint32_t |
nkey_words |
|
) |
| |
Simon key expansion procedure.
- Parameters
-
key | original key (with enough space for the expanded key) |
Z | the z-sequence ( g_simon_zseq) |
zseq_j | index of the z-seqence |
nrounds | number of rounds |
nkey_words | number of key words |
uint32_t g_simon_zseq[5][62] |
Pre-computed z_j sequences (o <= j < 5) used in the key schedule of Simon.