YAARX: Yet Another ARX Toolkit  0.1
 All Data Structures Files Functions Variables Macros Pages
simon.hh File Reference

Header file for simon.cc: More...

Go to the source code of this file.

Data Structures

struct  simon_diff_graph_edge_t
 
struct  simon_diff_graph_node_t
 

Macros

#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"
 

Functions

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)
 

Variables

uint32_t g_simon_zseq [5][62]
 

Detailed Description

Header file for simon.cc:

Author
V.Velichkov, vesse.nosp@m.lin..nosp@m.velic.nosp@m.hkov.nosp@m.@uni..nosp@m.lu
Date
2012-2013

Function Documentation

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_sizeword size
key_sizekey 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_sizeword size
nkey_wordsnumber of key words
zseq_jindex 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
keyexpanded key
nroundsnumber of rounds
x_infirst plaintext word
y_insecond 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_sizeword 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
keyoriginal key (with enough space for the expanded key)
Zthe z-sequence ( g_simon_zseq)
zseq_jindex of the z-seqence
nroundsnumber of rounds
nkey_wordsnumber of key words

Variable Documentation

uint32_t g_simon_zseq[5][62]

Pre-computed z_j sequences (o <= j < 5) used in the key schedule of Simon.