YAARX: Yet Another ARX Toolkit
0.1
|
Automatic search for XOR differential trails in block cipher XTEA. More...
#include "common.hh"
#include "xdp-add.hh"
#include "max-xdp-add.hh"
#include "xtea.hh"
#include "xdp-xtea-f-fk.hh"
#include "xtea-f-xor-pddt.hh"
Macros | |
#define | XTEA_P_ADJUST_APPROX 1 |
Functions | |
double | xtea_xor_init_estimate (uint32_t next_round, uint32_t lsh_const, uint32_t rsh_const, uint32_t npairs, gsl_matrix *A[2][2][2], double B[NROUNDS], differential_t trail[NROUNDS], std::set< differential_t, struct_comp_diff_dx_dy > *diff_set_dx_dy, std::multiset< differential_t, struct_comp_diff_p > *diff_mset_p, uint32_t round_key[64], uint32_t round_delta[64]) |
void | xtea_xor_threshold_search (const int n, const int nrounds, const uint32_t npairs, const uint32_t round_key[64], const uint32_t round_delta[64], gsl_matrix *A[2][2][2], double B[NROUNDS], double *Bn, const differential_t diff_in[NROUNDS], differential_t trail[NROUNDS], uint32_t lsh_const, uint32_t rsh_const, std::multiset< differential_t, struct_comp_diff_p > *diff_mset_p, std::set< differential_t, struct_comp_diff_dx_dy > *diff_set_dx_dy, uint32_t dxx_init, uint32_t *dxx_init_in) |
uint32_t | xtea_xor_trail_search (uint32_t key[4], uint32_t round_key[64], uint32_t round_delta[64], std::set< differential_t, struct_comp_diff_dx_dy > *diff_set_dx_dy, std::multiset< differential_t, struct_comp_diff_p > *diff_mset_p, double B[NROUNDS], differential_t trail[NROUNDS]) |
void | xtea_xor_threshold_search_full (const int n, const int nrounds, const uint32_t npairs, const uint32_t round_key[64], const uint32_t round_delta[64], gsl_matrix *A[2][2][2], double B[NROUNDS], double *Bn, const differential_t diff_in[NROUNDS], differential_t trail[NROUNDS], uint32_t lsh_const, uint32_t rsh_const, std::multiset< differential_t, struct_comp_diff_p > *diff_mset_p, std::set< differential_t, struct_comp_diff_dx_dy > *diff_set_dx_dy, uint32_t dxx_init, uint32_t *dxx_init_in) |
uint32_t | xtea_xor_trail_search_full (uint32_t key[4], uint32_t round_key[64], uint32_t round_delta[64], std::set< differential_t, struct_comp_diff_dx_dy > diff_set_dx_dy, std::multiset< differential_t, struct_comp_diff_p > diff_mset_p, double BB[NROUNDS], differential_t trail[NROUNDS]) |
Automatic search for XOR differential trails in block cipher XTEA.
double xtea_xor_init_estimate | ( | uint32_t | next_round, |
uint32_t | lsh_const, | ||
uint32_t | rsh_const, | ||
uint32_t | npairs, | ||
gsl_matrix * | A[2][2][2], | ||
double | B[NROUNDS], | ||
differential_t | trail[NROUNDS], | ||
std::set< differential_t, struct_comp_diff_dx_dy > * | diff_set_dx_dy, | ||
std::multiset< differential_t, struct_comp_diff_p > * | diff_mset_p, | ||
uint32_t | round_key[64], | ||
uint32_t | round_delta[64] | ||
) |
Compute an initial estimate of the probability of a differential trail on rounds, by greedily extending the best found trail for rounds.
next_round | index of round to which a trail on rounds will be extended. |
lsh_const | LSH constant (TEA_LSH_CONST). |
rsh_const | RSH constant (TEA_RSH_CONST). |
npairs | number of chosen plaintext pairs (NPAIRS). |
A | transition probability matrices for (xdp_add_sf). |
B | array containing the best differential probabilities for i rounds: . |
trail | best found differential trail for n rounds. |
diff_set_dx_dy | pDDT as a set of differentials ordered by index . |
round_key | all round keys for the full XTEA. |
round_delta | all round constants for the full XTEA. |
void xtea_xor_threshold_search | ( | const int | n, |
const int | nrounds, | ||
const uint32_t | npairs, | ||
const uint32_t | round_key[64], | ||
const uint32_t | round_delta[64], | ||
gsl_matrix * | A[2][2][2], | ||
double | B[NROUNDS], | ||
double * | Bn, | ||
const differential_t | diff_in[NROUNDS], | ||
differential_t | trail[NROUNDS], | ||
uint32_t | lsh_const, | ||
uint32_t | rsh_const, | ||
std::multiset< differential_t, struct_comp_diff_p > * | diff_mset_p, | ||
std::set< differential_t, struct_comp_diff_dx_dy > * | diff_set_dx_dy, | ||
uint32_t | dxx_init, | ||
uint32_t * | dxx_init_in | ||
) |
Automatic search for XOR differential trails in block cipher TEA. using pDDT.
n | index of the current round: . |
nrounds | total number of rounds (NROUNDS). |
npairs | number of chosen plaintext pairs (NPAIRS). |
round_key | all round keys for the full XTEA. |
round_delta | all round constants for the full XTEA. |
A | transition probability matrices for (xdp_add_sf). |
B | array containing the best differential probabilities for i rounds: . |
Bn | the best found probability on rounds, updated dynamically. |
diff_in | array of differentials. |
trail | best found differential trail for nrounds . |
lsh_const | LSH constant (TEA_LSH_CONST). |
rsh_const | RSH constant (TEA_RSH_CONST). |
diff_mset_p | pDDT as a set of differentials ordered by probability p. |
diff_set_dx_dy | pDDT as a set of differentials ordered by index . |
dxx_init | initial left input difference to XTEA |
dxx_init_in | the initial left input difference to XTEA corresponding to the best found trail (initialized to dxx_init and updated dynamically). |
The outline of the array of bounds is the following:
More Details
The differential probability (DP) for one round of XTEA is computed as the product of the DP of (xtea_f) and the DP of the modular addition in F' (xtea_f2). The functions and are defined as: , . Thus the DP of one round of XTEA is essentiallly the DP of and is approximated as:
.
trail
and diff_in
contains elements of the form: . Although trail
and dif_in
do not contain the difference , the latter can be easily computed noting that , where is the input difference to from the previous round.For more details on the search algorithm see tea_add_threshold_search .
void xtea_xor_threshold_search_full | ( | const int | n, |
const int | nrounds, | ||
const uint32_t | npairs, | ||
const uint32_t | round_key[64], | ||
const uint32_t | round_delta[64], | ||
gsl_matrix * | A[2][2][2], | ||
double | B[NROUNDS], | ||
double * | Bn, | ||
const differential_t | diff_in[NROUNDS], | ||
differential_t | trail[NROUNDS], | ||
uint32_t | lsh_const, | ||
uint32_t | rsh_const, | ||
std::multiset< differential_t, struct_comp_diff_p > * | diff_mset_p, | ||
std::set< differential_t, struct_comp_diff_dx_dy > * | diff_set_dx_dy, | ||
uint32_t | dxx_init, | ||
uint32_t * | dxx_init_in | ||
) |
Full threshold search.
uint32_t xtea_xor_trail_search | ( | uint32_t | key[4], |
uint32_t | round_key[64], | ||
uint32_t | round_delta[64], | ||
std::set< differential_t, struct_comp_diff_dx_dy > * | diff_set_dx_dy, | ||
std::multiset< differential_t, struct_comp_diff_p > * | diff_mset_p, | ||
double | B[NROUNDS], | ||
differential_t | trail[NROUNDS] | ||
) |
Search for XOR differential trails in block cipher XTEA: wrapper function for tea_add_threshold_search.
key | cryptographic key of XTEA. |
round_key | all round keys for the full XTEA. |
round_delta | all round constants for the full XTEA. |
Algorithm Outline:
The procedure operates as follows:
uint32_t xtea_xor_trail_search_full | ( | uint32_t | key[4], |
uint32_t | round_key[64], | ||
uint32_t | round_delta[64], | ||
std::set< differential_t, struct_comp_diff_dx_dy > | diff_set_dx_dy, | ||
std::multiset< differential_t, struct_comp_diff_p > | diff_mset_p, | ||
double | BB[NROUNDS], | ||
differential_t | trail[NROUNDS] | ||
) |
Full threshold search using xtea_xor_threshold_search_full