YAARX: Yet Another ARX Toolkit
0.1
|
Automatic search for the best XOR differential trail in block cipher Speckey – optimized version by Yann Le Corre.. More...
Data Structures | |
struct | Correlation |
Macros | |
#define | SPECKEY_LEFT_ROT_CONST 7 |
#define | SPECKEY_RIGHT_ROT_CONST 2 |
#define | STRINGIFY_(x) #x |
#define | STRINGIFY(x) STRINGIFY_(x) |
Typedefs | |
typedef std::array < Correlation, g_best_B_ref.size()+1 > | SideTrail |
typedef std::array< SideTrail, 2 > | FullTrail |
Enumerations | |
enum | Side { LEFT = 0, RIGHT = 1, LEFT = 0, RIGHT = 1, LEFT = 0, RIGHT = 1, LEFT = 0, RIGHT = 1 } |
Functions | |
void | finalize (std::chrono::seconds startTime) |
void | speckey_print_linear_trail (FullTrail &T) |
void | speckey_round_masks_to_add_masks (const uint32_t ml_prev, const uint32_t mr_prev, const uint32_t ml, const uint32_t mr, const uint32_t rot_const, uint32_t *alpha, uint32_t *beta, uint32_t *gamma) |
bool | speckey_best_linear_search_i (const uint32_t iround, const int32_t ibit, const uint32_t alpha_in, const uint32_t beta_in, const uint32_t gamma_in, const uint32_t iGamma_R_in) |
bool | speckey_best_linear_search () |
void | speckey_find_bound (void) |
int | main (int argc, char *argv[]) |
Variables | |
const uint32_t | g_r1 = SPECKEY_LEFT_ROT_CONST % WORD_SIZE |
const uint32_t | g_r2 = SPECKEY_RIGHT_ROT_CONST % WORD_SIZE |
const std::array< int, 15 > | g_best_B_ref |
std::array< int, g_best_B_ref.size()> | g_best_B |
int | g_Bn |
FullTrail | g_T |
uint64_t | nNodes |
unsigned int | g_nRounds |
Automatic search for the best XOR differential trail in block cipher Speckey – optimized version by Yann Le Corre..
void finalize | ( | std::chrono::seconds | startTime | ) |
Print number of visited nodes and computation speed
int main | ( | int | argc, |
char * | argv[] | ||
) |
Main function.
bool speckey_best_linear_search_i | ( | const uint32_t | iround, |
const int32_t | ibit, | ||
const uint32_t | alpha_in, | ||
const uint32_t | beta_in, | ||
const uint32_t | gamma_in, | ||
const uint32_t | iGamma_R_in | ||
) |
Search for the best linear trail of SPECK32/Speckey.
iround | current round: |
ibit | current bit position (from w-1 to -1) |
alpha | first input mask to the 1st addition of round iround |
beta | second input mask to the 1st addition of round iround |
gamma | output mask from the1st addition of round iround |
iGamma_R_in | first right input mask to the iround-th round (the left part is iGamma_L_in and the output masks are oGamma_L and oGamma_R) |
void speckey_print_linear_trail | ( | FullTrail & | T | ) |
Print trail T up to- and including round nrounds
void speckey_round_masks_to_add_masks | ( | const uint32_t | ml_prev, |
const uint32_t | mr_prev, | ||
const uint32_t | ml, | ||
const uint32_t | mr, | ||
const uint32_t | rot_const, | ||
uint32_t * | alpha, | ||
uint32_t * | beta, | ||
uint32_t * | gamma | ||
) |
From the input and output masks of one round, extract the input and output masks of the addtion, using the following relations:
alpha_i = ml_{i-1} beta_i = mr_{i-1} ^ (mr_i >>> rot_const) gamma_i = ml_i ^ mr_i
ml_prev | left input mask to one round |
mr_prev | right input mask to one round |
ml | left output mask from one round |
mr | right output mask from one round |
alpha | first input mask to the modular adition of one round |
beta | second input mask to the modular adition of one round |
gamma | output mask from the modular adition of one round |
const std::array<int, 15> g_best_B_ref |