![]() |
YAARX: Yet Another ARX Toolkit
0.1
|
The XOR differential probability (XDP) of the F-function of XTEA for a fixed key and round constants:
.
More...
Functions | |
| double | xdp_xtea_f_fk_exper (const uint32_t da, const uint32_t db, const uint32_t k, const uint32_t delta, const uint32_t lsh_const, const uint32_t rsh_const) |
| double | xdp_xtea_f_fk_approx (const uint32_t ninputs, const uint32_t da, const uint32_t db, const uint32_t k, const uint32_t delta, const uint32_t lsh_const, const uint32_t rsh_const) |
| bool | xdp_xtea_f_check_x (const uint32_t lsh_const, const uint32_t rsh_const, const uint32_t k, const uint32_t delta, const uint32_t dx, const uint32_t dy, const uint32_t x) |
| bool | xdp_xtea_f_is_sat (const uint32_t mask_i, const uint32_t lsh_const, const uint32_t rsh_const, const uint32_t k, const uint32_t delta, const uint32_t dx, const uint32_t dy, const uint32_t x) |
| uint32_t | xdp_xtea_f_assign_bit_x (const uint32_t n, const uint32_t i, const uint32_t mask_i, const uint32_t x, const uint32_t key, const uint32_t delta, const uint32_t lsh_const, const uint32_t rsh_const, const uint32_t dx, const uint32_t dy, uint32_t *x_cnt, double *prob) |
| double | xdp_xtea_f_fk (const uint32_t n, const uint32_t dx, const uint32_t dy, const uint32_t key, const uint32_t delta, const uint32_t lsh_const, const uint32_t rsh_const) |
| double | xdp_xtea_f2_fk_exper (const uint32_t daa, const uint32_t da, const uint32_t db, const uint32_t k, const uint32_t delta, const uint32_t lsh_const, const uint32_t rsh_const) |
| double | xdp_xtea_f2_fk_approx (const uint32_t ninputs, const uint32_t daa, const uint32_t da, const uint32_t db, const uint32_t k, const uint32_t delta, const uint32_t lsh_const, const uint32_t rsh_const) |
| bool | xdp_xtea_f2_check_x_xx (const uint32_t lsh_const, const uint32_t rsh_const, const uint32_t k, const uint32_t delta, const uint32_t dxx, const uint32_t dx, const uint32_t dy, const uint32_t xx, const uint32_t x) |
| bool | xdp_xtea_f2_is_sat (const uint32_t mask_i, const uint32_t lsh_const, const uint32_t rsh_const, const uint32_t k, const uint32_t delta, const uint32_t dxx, const uint32_t dx, const uint32_t dy, const uint32_t xx, const uint32_t x) |
| uint32_t | xdp_xtea_f2_assign_bit_x_xx (const uint32_t n, const uint32_t i, const uint32_t mask_i, const uint32_t xx, const uint32_t x, const uint32_t key, const uint32_t delta, const uint32_t lsh_const, const uint32_t rsh_const, const uint32_t dxx, const uint32_t dx, const uint32_t dy, uint64_t *x_cnt, double *prob) |
| double | xdp_xtea_f2_fk (const uint32_t n, const uint32_t dxx, const uint32_t dx, const uint32_t dy, const uint32_t key, const uint32_t delta, const uint32_t lsh_const, const uint32_t rsh_const) |
| double | nz_xdp_xtea_f (gsl_matrix *A[2][2][2], const uint32_t dx, uint32_t *dy, uint32_t lsh_const, uint32_t rsh_const) |
The XOR differential probability (XDP) of the F-function of XTEA for a fixed key and round constants:
.
| double nz_xdp_xtea_f | ( | gsl_matrix * | A[2][2][2], |
| const uint32_t | dx, | ||
| uint32_t * | dy, | ||
| uint32_t | lsh_const, | ||
| uint32_t | rsh_const | ||
| ) |
For the XTEA F-function (xtea_f), for fixed input difference dx, compute an output difference dy such that the differential
has non-zero probability.
| A | transition probability matrices for (xdp_add_sf). |
| dx | input difference. |
| dy | output difference. |
| lsh_const | LSH constant. |
| rsh_const | RSH constant. |

Algorithm sketch:
.
after the modular addition of xtea_f :
(see max_xdp_add).
and return
.
the inputs to the addition are implicitly assumed to be independent. Clearly they are not and so the returned probability is only an approximation. | uint32_t xdp_xtea_f2_assign_bit_x_xx | ( | const uint32_t | n, |
| const uint32_t | i, | ||
| const uint32_t | mask_i, | ||
| const uint32_t | xx, | ||
| const uint32_t | x, | ||
| const uint32_t | key, | ||
| const uint32_t | delta, | ||
| const uint32_t | lsh_const, | ||
| const uint32_t | rsh_const, | ||
| const uint32_t | dxx, | ||
| const uint32_t | dx, | ||
| const uint32_t | dy, | ||
| uint64_t * | x_cnt, | ||
| double * | prob | ||
| ) |
Counts the number of values xx and x for which the XOR differential
of the XTEA F-function with two inputs
(see xtea_f2) is satisfied. The algorithm operates by recursively assigning the bits of xx and x starting from bit position i and terminating at the MS bit n. The recursion proceeds to bit
only if the differential is satisfied on the i LS bits. This is checked by applying xdp_xtea_f2_is_sat.
| n | word size (terminating bit popsition). |
| i | current bit position. |
| mask_i | mask on the i LS bits of x. |
| xx | first input value. |
| x | second input value of size at least (i + rsh_const). |
| key | round key. |
| delta | round constant. |
| lsh_const | LSH constant. |
| rsh_const | RSH constant. |
| dxx | first input difference. |
| dx | second input difference. |
| dy | output difference. |
| x_cnt | number of values satisfying . |
| prob | the fixed-key XOR probability of F': . |
1 if
satisfies
; 0 otherwise. | bool xdp_xtea_f2_check_x_xx | ( | const uint32_t | lsh_const, |
| const uint32_t | rsh_const, | ||
| const uint32_t | k, | ||
| const uint32_t | delta, | ||
| const uint32_t | dxx, | ||
| const uint32_t | dx, | ||
| const uint32_t | dy, | ||
| const uint32_t | xx, | ||
| const uint32_t | x | ||
| ) |
Check if given input values xx and x satisfy the XOR differential
of the XTEA F-function with two inputs
(see xtea_f2).
| lsh_const | LSH constant. |
| rsh_const | RSH constant. |
| k | round key. |
| delta | round constant. |
| dxx | first input difference. |
| dx | second input difference. |
| dy | output difference. |
| xx | first input value. |
| x | second input value. |
. | double xdp_xtea_f2_fk | ( | const uint32_t | n, |
| const uint32_t | dxx, | ||
| const uint32_t | dx, | ||
| const uint32_t | dy, | ||
| const uint32_t | key, | ||
| const uint32_t | delta, | ||
| const uint32_t | lsh_const, | ||
| const uint32_t | rsh_const | ||
| ) |
Compute the fixed-key, fixed-constant XOR differential probability of of the XTEA F-function with two inputs
(see xtea_f2):
. Complexity:
.
| n | word size. |
| dxx | first input difference. |
| dx | second input difference. |
| dy | output difference. |
| key | round key. |
| delta | round constant. |
| lsh_const | LSH constant. |
| rsh_const | RSH constant. |
. | double xdp_xtea_f2_fk_approx | ( | const uint32_t | ninputs, |
| const uint32_t | daa, | ||
| const uint32_t | da, | ||
| const uint32_t | db, | ||
| const uint32_t | k, | ||
| const uint32_t | delta, | ||
| const uint32_t | lsh_const, | ||
| const uint32_t | rsh_const | ||
| ) |
An approximation of the XDP of the XTEA F-function with two inputs
(see xtea_f2), obtained over a number of input chosen plaintext pairs c hosen uniformly at random.
| ninputs | number of input chosen plaintext pairs. |
| daa | first input difference. |
| da | second input difference. |
| db | output difference. |
| k | round key. |
| delta | round constant. |
| lsh_const | LSH constant. |
| rsh_const | RSH constant. |
. | double xdp_xtea_f2_fk_exper | ( | const uint32_t | daa, |
| const uint32_t | da, | ||
| const uint32_t | db, | ||
| const uint32_t | k, | ||
| const uint32_t | delta, | ||
| const uint32_t | lsh_const, | ||
| const uint32_t | rsh_const | ||
| ) |
Compute the fixed-key through exhaustive search over all input values the fixed-constant XOR differential probability of the F-function of block cipher XTEA including the second modular addition and denoted by
(see xtea_f2):
. Complexity:
.
| daa | first input difference. |
| da | second input difference. |
| db | output difference. |
| k | round key. |
| delta | round constant. |
| lsh_const | LSH constant. |
| rsh_const | RSH constant. |
. | bool xdp_xtea_f2_is_sat | ( | const uint32_t | mask_i, |
| const uint32_t | lsh_const, | ||
| const uint32_t | rsh_const, | ||
| const uint32_t | k, | ||
| const uint32_t | delta, | ||
| const uint32_t | dxx, | ||
| const uint32_t | dx, | ||
| const uint32_t | dy, | ||
| const uint32_t | xx, | ||
| const uint32_t | x | ||
| ) |
Check if the XOR differential
of the XTEA F-function with two inputs
(see xtea_f2) is satisfied on the i LS bits of xx and x i.e. check if
| mask_i | i bit mask. |
| lsh_const | LSH constant. |
| rsh_const | RSH constant. |
| k | round key. |
| delta | round constant. |
| dxx | first input difference. |
| dx | second input difference. |
| dy | output difference. |
| xx | first input value. |
| x | second input value of size at least (i + rsh_const). |
x must be of size at least
bits where R is the RSH constant of F. | uint32_t xdp_xtea_f_assign_bit_x | ( | const uint32_t | n, |
| const uint32_t | i, | ||
| const uint32_t | mask_i, | ||
| const uint32_t | x, | ||
| const uint32_t | key, | ||
| const uint32_t | delta, | ||
| const uint32_t | lsh_const, | ||
| const uint32_t | rsh_const, | ||
| const uint32_t | dx, | ||
| const uint32_t | dy, | ||
| uint32_t * | x_cnt, | ||
| double * | prob | ||
| ) |
Counts the number of values x for which the differential
for the F-function of XTEA is satisfied. The function operates by recursively assigning the bits of x starting from bit position i and terminating at the MS bit n. The recursion proceeds to bit
only if the differential is satisfied on the i LS bits. This is checked by applying xdp_xtea_f_is_sat.
| n | word size (terminating bit popsition). |
| i | current bit position. |
| mask_i | mask on the i LS bits of x. |
| x | input value of size at least (i + rsh_const). |
| key | round key. |
| delta | round constant. |
| lsh_const | LSH constant. |
| rsh_const | RSH constant. |
| dx | input difference. |
| dy | output difference. |
| x_cnt | number of values satisfying . |
| prob | the fixed-key XOR probability of F: . |
1 if
satisfies
; 0 otherwise. | bool xdp_xtea_f_check_x | ( | const uint32_t | lsh_const, |
| const uint32_t | rsh_const, | ||
| const uint32_t | k, | ||
| const uint32_t | delta, | ||
| const uint32_t | dx, | ||
| const uint32_t | dy, | ||
| const uint32_t | x | ||
| ) |
Check if a given value x satisfies the XOR differential
for the XTEA F-function.
| lsh_const | LSH constant. |
| rsh_const | RSH constant. |
| k | round key. |
| delta | round constant. |
| dx | input difference. |
| dy | output difference. |
| x | input value. |
. | double xdp_xtea_f_fk | ( | const uint32_t | n, |
| const uint32_t | dx, | ||
| const uint32_t | dy, | ||
| const uint32_t | key, | ||
| const uint32_t | delta, | ||
| const uint32_t | lsh_const, | ||
| const uint32_t | rsh_const | ||
| ) |
Compute the fixed-key, fixed-constant XOR differential probability of the F-function of block cipher XTEA:
. Complexity:
.
| n | word size. |
| dx | input difference. |
| dy | output difference. |
| key | round key. |
| delta | round constant. |
| lsh_const | LSH constant. |
| rsh_const | RSH constant. |
. | double xdp_xtea_f_fk_approx | ( | const uint32_t | ninputs, |
| const uint32_t | da, | ||
| const uint32_t | db, | ||
| const uint32_t | k, | ||
| const uint32_t | delta, | ||
| const uint32_t | lsh_const, | ||
| const uint32_t | rsh_const | ||
| ) |
An approximation of the XDP of the XTEA F-function (xtea_f) obtained over a number of input chosen plaintext pairs chosen uniformly at random.
| ninputs | number of input chosen plaintext pairs. |
| da | input difference. |
| db | output difference. |
| k | round key. |
| delta | round constant. |
| lsh_const | LSH constant. |
| rsh_const | RSH constant. |
. | double xdp_xtea_f_fk_exper | ( | const uint32_t | da, |
| const uint32_t | db, | ||
| const uint32_t | k, | ||
| const uint32_t | delta, | ||
| const uint32_t | lsh_const, | ||
| const uint32_t | rsh_const | ||
| ) |
Compute the fixed-key, fixed-constant XOR differential probability of the F-function of block cipher XTEA:
through exhaustive search over all input values. Complexity:
.
| da | input difference. |
| db | output difference. |
| k | round key. |
| delta | round constant. |
| lsh_const | LSH constant. |
| rsh_const | RSH constant. |
. | bool xdp_xtea_f_is_sat | ( | const uint32_t | mask_i, |
| const uint32_t | lsh_const, | ||
| const uint32_t | rsh_const, | ||
| const uint32_t | k, | ||
| const uint32_t | delta, | ||
| const uint32_t | dx, | ||
| const uint32_t | dy, | ||
| const uint32_t | x | ||
| ) |
Check if the differential
for F (xtea_f) is satisfied on the i LS bits of x i.e. check if
.
x must be of size at least
bits where R is the RSH constant of F.| mask_i | i bit mask. |
| lsh_const | LSH constant. |
| rsh_const | RSH constant. |
| k | round key. |
| delta | round constant. |
| dx | input difference. |
| dy | output difference. |
| x | input value of size at least (i + rsh_const). |
.