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

Header file for xdp-rot-and.cc: Automatic search for XOR differentials in block cipher Simon32 (16 bit words) using either the full DDT or a complete partial DDT for all differences with max Hamming weight 5. . More...

Go to the source code of this file.

Functions

double ** simon_ddt_alloc ()
 
void simon_ddt_free (double **T)
 
differential_t ** simon_rsddt_alloc ()
 
void simon_rsddt_free (differential_t **T)
 
void simon_ddt_sort_rows (differential_t **T)
 
bool simon_comp_differentials_npairs (differential_t a, differential_t b)
 
bool simon_comp_differentials_diffs (differential_t a, differential_t b)
 
void simon_ddt_sort (differential_t *SDDT)
 
differential_tsimon_sddt_alloc ()
 
void simon_sddt_free (differential_t *ST)
 
void simon_ddt_to_list (double **DDT, differential_t *SDDT)
 
void simon_ddt_to_diff_struct (double **DDT, differential_t **SDDT)
 
void simon_rot_and_ddt (double **D, const uint32_t s, const uint32_t t, const double p_thres)
 
void simon_xor_ddt_search (const int n, const int nrounds, double B[NROUNDS], double *Bn, const differential_t diff_in[NROUNDS], differential_t trail[NROUNDS], const uint32_t dyy_init, uint32_t lrot_const_s, uint32_t lrot_const_t, uint32_t lrot_const_u, differential_t *SDDT, differential_t **RSDDT, double p_thres)
 
uint32_t simon_xor_ddt_trail_search (uint32_t key[SIMON_MAX_NROUNDS], double B[NROUNDS], differential_t trail[NROUNDS], uint32_t num_rounds)
 
uint32_t gen_word_hw (const uint32_t n, const uint32_t hw, std::vector< uint32_t > *X)
 
uint32_t gen_word_hw_all (const uint32_t word_size, const uint32_t hw)
 
void simon_diff_update_max (const differential_t input_diff, const differential_t output_diff, differential_t *max_diff)
 
void simon_compute_full_ddt (std::unordered_map< uint32_t, std::vector< differential_t >> *T)
 
void simon32_ddt_file_write (const char *filename, std::unordered_map< uint32_t, std::vector< differential_t >> *T)
 
void simon32_ddt_file_read (const char *filename, std::unordered_map< uint32_t, std::vector< differential_t >> *T)
 
void simon_diff_search (const uint32_t nrounds, const uint32_t dx_in, const uint32_t dy_in, const uint32_t hw_max, std::unordered_map< uint32_t, std::vector< differential_t >> *T, std::unordered_map< uint32_t, differential_t > *D, const uint32_t D_round, const char *logfile)
 
void simon_compute_partial_ddt (std::unordered_map< uint32_t, std::vector< differential_t >> *T, std::vector< uint32_t > DX, const uint32_t hw_max)
 

Detailed Description

Header file for xdp-rot-and.cc: Automatic search for XOR differentials in block cipher Simon32 (16 bit words) using either the full DDT or a complete partial DDT for all differences with max Hamming weight 5. .

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

Function Documentation

uint32_t gen_word_hw ( const uint32_t  n,
const uint32_t  hw,
std::vector< uint32_t > *  X 
)

Generate all words of given Hamming weight – wrapper for gen_word_hw_i (recursive version)

uint32_t gen_word_hw_all ( const uint32_t  word_size,
const uint32_t  hw 
)

Generate all words of given Hamming weight Same as gen_word_hw but exhasutively trying out all inputs (non-recursive version)

void simon32_ddt_file_read ( const char *  filename,
std::unordered_map< uint32_t, std::vector< differential_t >> *  T 
)

Read a pre-compute full DDT for Simon32 (16-bit words) from file and store it in a hash table

void simon32_ddt_file_write ( const char *  filename,
std::unordered_map< uint32_t, std::vector< differential_t >> *  T 
)

Pre-compute the full DDT for Simon32 (16-bit words) and store it in file

bool simon_comp_differentials_npairs ( differential_t  a,
differential_t  b 
)
See Also
comp_rows
void simon_compute_full_ddt ( std::unordered_map< uint32_t, std::vector< differential_t >> *  T)

Compute full DDT T containing only the non-zero prob. entries

void simon_compute_partial_ddt ( std::unordered_map< uint32_t, std::vector< differential_t >> *  T,
std::vector< uint32_t >  DX,
const uint32_t  hw_max 
)

Compute a partial DDT T for a subset of inputs stored in X The subset represent all words of given Hamming weight

double** simon_ddt_alloc ( )
See Also
ddt_alloc
void simon_ddt_free ( double **  T)
See Also
ddt_free
void simon_ddt_sort ( differential_t SDDT)
See Also
ddt_sort
void simon_ddt_sort_rows ( differential_t **  T)
See Also
ddt_sort_rows
void simon_ddt_to_diff_struct ( double **  DDT,
differential_t **  SDDT 
)
void simon_ddt_to_list ( double **  DDT,
differential_t SDDT 
)

Convert a DDT to a list of differentials.

See Also
ddt_to_list
differential_t** simon_rsddt_alloc ( )
See Also
rsddt_alloc
void simon_rsddt_free ( differential_t **  T)
See Also
rsddt_free
differential_t* simon_sddt_alloc ( )
See Also
sddt_alloc
void simon_sddt_free ( differential_t ST)
See Also
sddt_free