YAARX: Yet Another ARX Toolkit
0.1
|
The maximum ADD differential probability of the sequence of operations: ADD, LROT, XOR (ARX): . More...
Functions | |
void | max_adp_arx_bounds_0 (uint32_t k, const uint32_t n, const uint32_t lrot_const, double *p, uint32_t *de, gsl_matrix *A[2][2][2][2], gsl_vector *B[ADP_ARX_NISTATES][WORD_SIZE+1], gsl_vector *C[ADP_ARX_NISTATES], const uint32_t dc, const uint32_t dd, uint32_t *de_max, double *p_max) |
void | max_adp_arx_bounds_i (uint32_t k, const uint32_t n, const uint32_t lrot_const, double *p, uint32_t *de, gsl_matrix *A[2][2][2][2], gsl_vector *B[WORD_SIZE+1], gsl_vector *C, const uint32_t dc, const uint32_t dd, uint32_t *de_max, double *p_max) |
void | max_adp_arx_bounds (gsl_matrix *A[2][2][2][2], gsl_vector *B[ADP_ARX_NISTATES][WORD_SIZE+1], const uint32_t lrot_const, const uint32_t dc, const uint32_t dd, uint32_t *de_max) |
void | max_adp_arx_print_bounds (gsl_vector *B[ADP_ARX_NISTATES][WORD_SIZE+1]) |
double | max_adp_arx (gsl_matrix *A[2][2][2][2], const uint32_t lrot_const, const uint32_t da, const uint32_t db, const uint32_t dd, uint32_t *de_max) |
double | max_adp_arx_exper (gsl_matrix *A[2][2][2][2], const uint32_t lrot_const, const uint32_t da, const uint32_t db, const uint32_t dd, uint32_t *de_max) |
The maximum ADD differential probability of the sequence of operations: ADD, LROT, XOR (ARX): .
double max_adp_arx | ( | gsl_matrix * | A[2][2][2][2], |
const uint32_t | lrot_const, | ||
const uint32_t | da, | ||
const uint32_t | db, | ||
const uint32_t | dd, | ||
uint32_t * | de_max | ||
) |
Compute the maximum probability output difference from ARX: – a wrapper function for max_adp_arx+bounds_0 .
A | transition probability matrices. |
lrot_const | the rotation constant of the LROT operation in ARX. |
da | first input difference (input to the ADD in ARX). |
db | second input difference (input to the ADD in ARX). |
dd | third input difference (input to the XOR in ARX). |
de_max | maximum probability output difference from ARX (computed). |
void max_adp_arx_bounds | ( | gsl_matrix * | A[2][2][2][2], |
gsl_vector * | B[ADP_ARX_NISTATES][WORD_SIZE+1], | ||
const uint32_t | lrot_const, | ||
const uint32_t | dc, | ||
const uint32_t | dd, | ||
uint32_t * | de_max | ||
) |
Compute an array of bounds to be used in the computation of the maximum differential probability.
A | transition probability matrices. |
B | array of bounds for every initial state: ADP_ARX_NISTATES and every bit position WORD_SIZE. |
lrot_const | LROT constant. |
dc | input difference to the LROT operation in ARX. |
dd | input difference to the XOR operation in ARX. |
de_max | maximum probability output difference from ARX (not used). |
Algorithm Outline:
Meaning of the bounds B:
For any ADP_ARX_MSIZE, the probability computed with the above algorithm is an upper bound on on the maximum probability of the differential , computed from initial state and terminating at final state . In other words, for any choice of the following bits of de: , the probability will never be bigger than . Furthermore, let be the multiplication of the corresponding transition probability matrices for the following bits of de: and let and . Then . Threfore is an upper bound on the proability . Note that , where .
void max_adp_arx_bounds_0 | ( | uint32_t | k, |
const uint32_t | n, | ||
const uint32_t | lrot_const, | ||
double * | p, | ||
uint32_t * | de, | ||
gsl_matrix * | A[2][2][2][2], | ||
gsl_vector * | B[ADP_ARX_NISTATES][WORD_SIZE+1], | ||
gsl_vector * | C[ADP_ARX_NISTATES], | ||
const uint32_t | dc, | ||
const uint32_t | dd, | ||
uint32_t * | de_max, | ||
double * | p_max | ||
) |
Compute the maximum probability output difference from ARX: , given upper bounds on the probabilities for every initial state ADP_ARX_NISTATES and every bit postion WORD_SIZE, computed with max_adp_arx_bounds .
k | current bit position: ; initialized to 0. |
n | word size (WORD_SIZE). |
lrot_const | LROT constant. |
p | the estimated probability at bit position . |
de | output difference. |
A | transition probability matrices (adp_arx_sf). |
B | array of bounds for every initial state: ADP_ARX_NISTATES and every bit position WORD_SIZE. |
C | a set of ADP_ARX_NISTATES unit row vectors of size ADP_ARX_MSIZE. Each one is initialized with 1 at one of the four initial states (ADP_ARX_ISTATES). |
dc | input difference to the LROT operation in ARX. |
dd | input difference to the XOR operation in ARX. |
de_max | maximum probability output difference from ARX (not used). |
p_max | the maximum probability. |
Algorithm Outline:
void max_adp_arx_bounds_i | ( | uint32_t | k, |
const uint32_t | n, | ||
const uint32_t | lrot_const, | ||
double * | p, | ||
uint32_t * | de, | ||
gsl_matrix * | A[2][2][2][2], | ||
gsl_vector * | B[WORD_SIZE+1], | ||
gsl_vector * | C, | ||
const uint32_t | dc, | ||
const uint32_t | dd, | ||
uint32_t * | de_max, | ||
double * | p_max | ||
) |
For a fixed initial state and bit position , compute an upper bound on the probability of the differential computed from initial state and terminating at final state , where ADP_ARX_NISTATES i.e. compute a bound on the probability , given the upper bounds on the probabilities of the differentials for , where , , and is a column unit vector of size ADP_ARX_MSIZE with 1 at position ,
k | current bit position: . |
n | word size (WORD_SIZE). |
lrot_const | LROT constant. |
p | the estimated probability at bit position . |
de | output difference. |
A | transition probability matrices. |
B | array of bounds for a fixed initial state , set by the caller and every bit position WORD_SIZE. |
C | unit row vector of size ADP_ARX_MSIZE, initialized with 1 at state index . |
dc | input difference to the LROT operation in ARX. |
dd | input difference to the XOR operation in ARX. |
de_max | maximum probability output difference from ARX (not used). |
p_max | the maximum probability. |
Algorithm Outline:
double max_adp_arx_exper | ( | gsl_matrix * | A[2][2][2][2], |
const uint32_t | lrot_const, | ||
const uint32_t | da, | ||
const uint32_t | db, | ||
const uint32_t | dd, | ||
uint32_t * | de_max | ||
) |
Compute the maximum differential probability by exhaustive search over all output differences. Complexity: .
A | transition probability matrices. |
lrot_const | the rotation constant of the LROT operation in ARX. |
da | first input difference. |
db | second input difference. |
dd | third input difference. |
de_max | maximum probability output difference. |
void max_adp_arx_print_bounds | ( | gsl_vector * | B[ADP_ARX_NISTATES][WORD_SIZE+1] | ) |
Print the array of bounds computed with max_adp_arx_bounds .
B | array of bounds for every initial state: ADP_ARX_NISTATES and every bit position WORD_SIZE. |