![]() |
YAARX: Yet Another ARX Toolkit
0.1
|
The maximum ADD differential probability of XOR with three inputs, where one of the inputs satisfies a set of ADD differences:
.
More...
#include "common.hh"#include "adp-xor3.hh"#include "max-adp-xor3.hh"#include "max-adp-xor3-set.hh"Functions | |
| void | max_adp_xor3_set_i (const int i, const uint32_t k, const uint32_t n, double *p, uint32_t *dd, gsl_matrix *A[2][2][2][2], gsl_vector *B[WORD_SIZE+1], gsl_vector *C[ADP_XOR3_SET_SIZE], const uint32_t da, const uint32_t db, const uint32_t dc[ADP_XOR3_SET_SIZE], uint32_t *dd_max, double *p_max) |
| double | max_adp_xor3_set (gsl_matrix *A[2][2][2][2], const uint32_t da, const uint32_t db, const uint32_t dc[ADP_XOR3_SET_SIZE], double p_dc[ADP_XOR3_SET_SIZE], uint32_t *dd_max) |
| double | max_adp_xor3_set_exper (gsl_matrix *A[2][2][2][2], const uint32_t da, const uint32_t db, const uint32_t dc[ADP_XOR3_SET_SIZE], double p_dc[ADP_XOR3_SET_SIZE], uint32_t *dd_max) |
The maximum ADD differential probability of XOR with three inputs, where one of the inputs satisfies a set of ADD differences:
.
| double max_adp_xor3_set | ( | gsl_matrix * | A[2][2][2][2], |
| const uint32_t | da, | ||
| const uint32_t | db, | ||
| const uint32_t | dc[ADP_XOR3_SET_SIZE], | ||
| double | p_dc[ADP_XOR3_SET_SIZE], | ||
| uint32_t * | dd_max | ||
| ) |
Compute the maximum differential probability over all output differences for a set of input differenecs:
.
Complexity c:
, where
is the size of the set of input differences
.
| A | transition probability matrices. |
| da | first input difference. |
| db | second input difference. |
| dc | set of input difference. |
| dd_max | maximum probability output difference. |
| p_dc | probabilities of the set of differentials corresponding to the set of differences (used for testing and debug only). |
.Algorithm Outline:
- the bounds ror the
differentials:
corresponding to the r-th input differences
in the set.
as the maximum of the bounds
at every bit position
for every S-function state
:
.
to compute the final maximum probability
.| double max_adp_xor3_set_exper | ( | gsl_matrix * | A[2][2][2][2], |
| const uint32_t | da, | ||
| const uint32_t | db, | ||
| const uint32_t | dc[ADP_XOR3_SET_SIZE], | ||
| double | p_dc[ADP_XOR3_SET_SIZE], | ||
| uint32_t * | dd_max | ||
| ) |
Compute the maximum differential probability by exhaustive search over all output differences. Complexity:
.
| A | transition probability matrices. |
| da | first input difference. |
| db | second input difference. |
| dc | set of input difference. |
| dd_max | maximum probability output difference. |
| p_dc | probabilities of the set of differentials corresponding to the set of differences; normally set to 1 (used for testing and debug only). |
.| void max_adp_xor3_set_i | ( | const int | i, |
| const uint32_t | k, | ||
| const uint32_t | n, | ||
| double * | p, | ||
| uint32_t * | dd, | ||
| gsl_matrix * | A[2][2][2][2], | ||
| gsl_vector * | B[WORD_SIZE+1], | ||
| gsl_vector * | C[ADP_XOR3_SET_SIZE], | ||
| const uint32_t | da, | ||
| const uint32_t | db, | ||
| const uint32_t | dc[ADP_XOR3_SET_SIZE], | ||
| uint32_t * | dd_max, | ||
| double * | p_max | ||
| ) |
Compute an upper bound
on the maximum probability of the differential
, starting from initial state i of the S-function and given the upper bounds
on the probabilities of the differentials
for
, where
is a finite set of input differences.
| i | index of the state of the S-function: A_size . |
| k | current bit position: . |
| n | word size. |
| p | the estimated probability at bit position k. |
| dd | output difference. |
| A | transition probability matrices. |
| B | array of size A_size rows by (n + 1) columns containing upper bounds on the maximum probabilities of all j bit differentials beginning from any state i: A_size . |
| C | unit row vector of size A_size rows, initialized with 1 at state index i. |
| da | first input difference. |
| db | second input difference. |
| dc | set of input differences. |
| dd_max | maximum probability output difference. |
| p_max | the maximum probability. |
Algorithm Outline:
The bound for the set of differences is computed as the sum of the bounds of the differentials obtained from each of the elements of the set:
, where
is an upper bound on the maximum probability of the differential corresponding to the r-th input difference
i.e.
computed as in max_adp_xor_i.