![]() |
YAARX: Yet Another ARX Toolkit
0.1
|
Header file for adp-xor-pddt.cc. More...
Go to the source code of this file.
Functions | |
| uint32_t | adp_xor_ddt_exper (std::multiset< differential_3d_t, struct_comp_diff_3d_p > *diff_set, double p_thres) |
| void | adp_xor_pddt_i (const uint32_t k, const uint32_t n, const double p_thres, gsl_matrix *A[2][2][2], gsl_vector *C, uint32_t *da, uint32_t *db, uint32_t *dc, double *p, std::multiset< differential_3d_t, struct_comp_diff_3d_p > *diff_set) |
| void | adp_xor_ddt (uint32_t n, double p_thres) |
Header file for adp-xor-pddt.cc.
| void adp_xor_ddt | ( | uint32_t | n, |
| double | p_thres | ||
| ) |
Compute a partial DDT for
: wrapper function of adp_xor_pddt_i.
| n | word size. |
| p_thres | probability threshold. |
| uint32_t adp_xor_ddt_exper | ( | std::multiset< differential_3d_t, struct_comp_diff_3d_p > * | diff_set, |
| double | p_thres | ||
| ) |
Compute a partial DDT for
by exhasutive search over all input and output differences.
| diff_set | set of all differentials with probability not less than the threshold (the pDDT) |
| p_thres | probability threshold. |
| void adp_xor_pddt_i | ( | const uint32_t | k, |
| const uint32_t | n, | ||
| const double | p_thres, | ||
| gsl_matrix * | A[2][2][2], | ||
| gsl_vector * | C, | ||
| uint32_t * | da, | ||
| uint32_t * | db, | ||
| uint32_t * | dc, | ||
| double * | p, | ||
| std::multiset< differential_3d_t, struct_comp_diff_3d_p > * | diff_set | ||
| ) |
Recursively compute all ADD differentials
for XOR that have probability
larger than a fixed probability threshold p_thres.
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 bits of the differences da, db, dc 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 differential
is stored in an STL multiset structure (internally implemented as a Red-Black tree).
The complexity is strongly dependent on the threshold and is worst-case exponential in the word size:
.
p_thres = 0.0 then the full DDT is computed. | k | current bit position in the recursion. |
| n | word size. |
| p_thres | probability threshold. |
| A | transition probability matrices for . |
| C | unit column vector for computing (adp_xor). |
| da | first input difference. |
| db | second input difference. |
| dc | output difference. |
| p | probability of the differential . |
| diff_set | set of all differentials with probability not less than the threshold (the pDDT) |