YAARX: Yet Another ARX Toolkit
0.1
|
Header file for eadp-tea-f.cc. More...
Go to the source code of this file.
Functions | |
double | eadp_tea_f (gsl_matrix *A[2][2][2][2], const uint32_t da, const uint32_t db, double *prob_db, uint32_t lsh_const, uint32_t rsh_const) |
double | eadp_tea_f_exper (const uint32_t dx, const uint32_t dy, uint32_t lsh_const, uint32_t rsh_const) |
double | max_eadp_tea_f (gsl_matrix *A[2][2][2][2], const uint32_t da, uint32_t *dd_max, double *prob_max, uint32_t lsh_const, uint32_t rsh_const) |
double | max_eadp_tea_f_exper (gsl_matrix *A[2][2][2][2], const uint32_t da, uint32_t *dd_max, double *prob_max, uint32_t lsh_const, uint32_t rsh_const) |
void | nz_eadp_tea_f_i (const uint32_t k, const uint32_t n, gsl_matrix *A[2][2][2][2], gsl_vector *C, const uint32_t da, const uint32_t db, const uint32_t dc, uint32_t *dd, double *p, double *p_thres, uint32_t *ret_dd, double *ret_p, uint32_t *cnt, uint32_t max_cnt) |
double | nz_eadp_tea_f (gsl_matrix *A[2][2][2][2], double p_thres, uint32_t da, uint32_t *ret_dd) |
Header file for eadp-tea-f.cc.
double eadp_tea_f | ( | gsl_matrix * | A[2][2][2][2], |
const uint32_t | da, | ||
const uint32_t | db, | ||
double * | prob_db, | ||
uint32_t | lsh_const, | ||
uint32_t | rsh_const | ||
) |
Computing the expected additive differential probability (EADP) of the F-function of TEA, averaged over all round keys and constants. For fixed input and output differences resp. da
and db
, it is defined as:
.
Complexity: .
Algorithm sketch: is computed as the multiplication of ADP-s of the two non-linear (w.r.t. ADD differences) components of F, namely XOR and LSH:
where are the four possible ADD differences after RSH (see adp_rsh) and is the ADP of XOR with three inputs where one of the inputs may satisfy any difference from a given set (max_adp_xor3_set).
A | transition probability matrices for (adp_xor3_sf). |
da | input difference. |
db | output difference. |
prob_db | the expected DP of F. |
lsh_const | LSH constant. |
rsh_const | RSH constant. |
double eadp_tea_f_exper | ( | const uint32_t | dx, |
const uint32_t | dy, | ||
uint32_t | lsh_const, | ||
uint32_t | rsh_const | ||
) |
Computing the expected additive differential probability (EADP) of the F-function of TEA (see eadp_tea_f), experimentally over all round keys and constants.
Complexity: .
dx | input difference. |
dy | output difference. |
lsh_const | LSH constant. |
rsh_const | RSH constant. |
double max_eadp_tea_f | ( | gsl_matrix * | A[2][2][2][2], |
const uint32_t | da, | ||
uint32_t * | dd_max, | ||
double * | prob_max, | ||
uint32_t | lsh_const, | ||
uint32_t | rsh_const | ||
) |
For fixed input difference da
, compute an output difference dd
that has maximum expected additive differential probability (EADP) averaged over all round keys and constants of the F-function of TEA:
.
Complexity: .
Algorithm sketch: is computed as the multiplication of ADP-s of the two non-linear (w.r.t. XOR differences) components of F, namely XOR and LSH:
where are the four possible ADD differences after RSH (see adp_rsh) and is the maximum ADP over all outpt differences, of XOR with three inputs where one of the inputs may satisfy any difference from a given set (max_adp_xor3_set).
A | transition probability matrices for (adp_xor3_sf). |
da | input difference. |
dd_max | maximum probability output difference. |
prob_max | maximum expected DP of F over all output differences. |
lsh_const | LSH constant. |
rsh_const | RSH constant. |
double max_eadp_tea_f_exper | ( | gsl_matrix * | A[2][2][2][2], |
const uint32_t | da, | ||
uint32_t * | dd_max, | ||
double * | prob_max, | ||
uint32_t | lsh_const, | ||
uint32_t | rsh_const | ||
) |
Computing the maximum expected additive differential probability (EADP) of the F-function of TEA (see eadp_tea_f), experimentally over all round keys, round constants and output differences.
Complexity: .
A | transition probability matrices for (adp_xor3_sf). |
da | input difference. |
dd_max | output difference. |
prob_max | the maximum expected DP of F. |
lsh_const | LSH constant. |
rsh_const | RSH constant. |
double nz_eadp_tea_f | ( | gsl_matrix * | A[2][2][2][2], |
double | p_thres, | ||
uint32_t | da, | ||
uint32_t * | ret_dd | ||
) |
For fixed input diffference da
to the TEA F-function, generate an arbitrary output difference dd
for which the expected DP of F is above a fixed threshold i.e. .
A | transition probability matrices for (adp_xor3_sf). |
p_thres | probability threshold. |
da | first input difference to XOR3. |
ret_dd | output difference that is returned as result. |
void nz_eadp_tea_f_i | ( | const uint32_t | k, |
const uint32_t | n, | ||
gsl_matrix * | A[2][2][2][2], | ||
gsl_vector * | C, | ||
const uint32_t | da, | ||
const uint32_t | db, | ||
const uint32_t | dc, | ||
uint32_t * | dd, | ||
double * | p, | ||
double * | p_thres, | ||
uint32_t * | ret_dd, | ||
double * | ret_p, | ||
uint32_t * | cnt, | ||
uint32_t | max_cnt | ||
) |
For fixed input diffferences da
, db
and dc
, to the XOR operation with three inputs in the TEA F-function, generate an arbitrary output difference dd
for which the expected DP of F is nonzero i.e. .
Complexity c: .
Algorithm sketch:
The function works recursively starting from the LS bit k
= 0 and terminating at the MS bit n
. At every bit position i it assigns values to the i-th bit of the output difference dd
and evaluates the probability of the resulting partial (i+1)-bit differential: . The recursion proceeds only if this probability is not less than the threshold p_thres
. When i = n, the difference is stored as the result and the probability is returned.
p_thres
is initialized to 0.0, but is dynamically updated during the execution as soon as a higher value is found.k | current bit position in the recursion. |
n | word size. |
A | transition probability matrices for (adp_xor3_sf). |
C | unit column vector for computing (adp_xor3). |
da | first input difference to XOR3. |
db | second input difference to XOR3. |
dc | third input difference to XOR3. |
dd | output difference from XOR3 (and F). |
p | probability of the differential . |
p_thres | probability threshold. |
ret_dd | output difference that is returned as result. |
ret_p | the EDP . |
cnt | number of output differences generated so far. |
max_cnt | maximum number of output differences allowed (typically 1). |