YAARX: Yet Another ARX Toolkit
0.1
|
Automatic search for ADD differential trails in TEA using full DDT-s. More...
Functions | |
double | verify_trail (uint64_t npairs, differential_t trail[NROUNDS], uint32_t nrounds, uint32_t key[4], uint32_t delta, uint32_t lsh_const, uint32_t rsh_const) |
void | round_ddt (const int n, const int nrounds, differential_t **RSDDT_E, differential_t **RSDDT_O, differential_t *SDDT_O, double B[NROUNDS], double *Bn, const differential_t diff_in[NROUNDS], differential_t trail[NROUNDS]) |
void | tea_search_ddt (uint32_t key[4]) |
void | round_xddt (const int n, const int nrounds, differential_t ***XRSDDT_E, differential_t ***XRSDDT_O, differential_t **XSDDT_O, const double B[NROUNDS], double *Bn, differential_t diff_in[NROUNDS], differential_t trail[NROUNDS]) |
void | tea_search_xddt (uint32_t key[4]) |
void | round_xddt_bottom_up (const int n, const int nrounds, differential_t ***XRSDDT_E, differential_t ***XRSDDT_O, differential_t **XSDDT_E, differential_t **XSDDT_O, const double B[NROUNDS], double *Bn, differential_t diff_in[NROUNDS], differential_t trail[NROUNDS]) |
void | tea_search_xddt_bottom_up (uint32_t key[4]) |
Automatic search for ADD differential trails in TEA using full DDT-s.
void round_ddt | ( | const int | n, |
const int | nrounds, | ||
differential_t ** | RSDDT_E, | ||
differential_t ** | RSDDT_O, | ||
differential_t * | SDDT_O, | ||
double | B[NROUNDS], | ||
double * | Bn, | ||
const differential_t | diff_in[NROUNDS], | ||
differential_t | trail[NROUNDS] | ||
) |
Automatic search for ADD differential trails using precomputed full difference distribution tables (DDT) for a modified version of TEA that uses the same round constant in every round.
DDT_E
contains fixed-key probabilities for the round keys applied in all even rounds: ; DDT_O
contains fixed-key probabilities for the round keys applied in all odd rounds: .n | index of the current round: . |
RSDDT_E | a DDT for the keys of all even rounds with the elements in each row (i.e. for a fixed input difference) sorted in descending order of their probability (a Row-Sorted DDT_E ). |
RSDDT_O | a DDT for the keys of all odd rounds with the elements in each row (i.e. for a fixed input difference) sorted in descending order of their probability (a Row-Sorted DDT_O ). |
SDDT_O | a DDT for the keys of all odd rounds will all elements sorted in descending order of their probability (a Sorted DDT_O ). |
nrounds | total number of rounds (NROUNDS). |
B | array containing the best differential probabilities for i rounds: . |
Bn | the best probability on rounds, updated dynamically. |
diff_in | array of differentials. |
trail | best differential trail for nrounds . |
The outline of the array of bounds is the following:
void round_xddt | ( | const int | n, |
const int | nrounds, | ||
differential_t *** | XRSDDT_E, | ||
differential_t *** | XRSDDT_O, | ||
differential_t ** | XSDDT_O, | ||
const double | B[NROUNDS], | ||
double * | Bn, | ||
differential_t | diff_in[NROUNDS], | ||
differential_t | trail[NROUNDS] | ||
) |
Automatic search for ADD differential trails using precomputed full difference distribution tables (DDT) for the original version of TEA.
DDT_E
containing the fixed-key fixed- probabilities for the round keys applied in all even rounds: and DDT_O
containing the fixed-key fixed- probabilities for the round keys applied in all odd rounds: . Since is updated every second round, for rounds DDT-s will be computed.n | index of the current round: . |
nrounds | total number of rounds (NROUNDS). |
XRSDDT_E | an array of fixed-key fixed- DDT-s for all even rounds with the elements in each row (i.e. for a fixed input difference) sorted in descending order of their probability (an eXtended Row-Sorted DDT_E ). |
XRSDDT_O | an array of fixed-key fixed- DDT-s for all odd rounds with the elements in each row (i.e. for a fixed input difference) sorted in descending order of their probability (an eXtended Row-Sorted DDT_O ). |
XSDDT_O | an array of fixed-key fixed- DDT-s for all odd rounds will all elements sorted in descending order of their probability (an eXtended Sorted DDT_O ). |
B | array containing the best differential probabilities for i rounds: . |
Bn | the best probability on rounds, updated dynamically. |
diff_in | array of differentials. |
trail | best differential trail for nrounds . |
The outline of the array of bounds is the following:
void round_xddt_bottom_up | ( | const int | n, |
const int | nrounds, | ||
differential_t *** | XRSDDT_E, | ||
differential_t *** | XRSDDT_O, | ||
differential_t ** | XSDDT_E, | ||
differential_t ** | XSDDT_O, | ||
const double | B[NROUNDS], | ||
double * | Bn, | ||
differential_t | diff_in[NROUNDS], | ||
differential_t | trail[NROUNDS] | ||
) |
Automatic search for ADD differential trails using precomputed full difference distribution tables (DDT) for the original version of TEA.
round_xddt_bottom_up is conceptually the same as round_xddt, except that the search proceeds from the bottom up i.e. first finds the best 1-round trail for the last round , next finds the best 2-round trail for rounds , etc. finds the best -round trail for rounds and finally finds the best -round trail.
DDT_E
containing the fixed-key fixed- probabilities for the round keys applied in all even rounds: and DDT_O
containing the fixed-key fixed- probabilities for the round keys applied in all odd rounds: . Since is updated every second round, for rounds DDT-s will be computed.n | index of the current round: . |
nrounds | total number of rounds (NROUNDS). |
XRSDDT_E | an array of fixed-key fixed- DDT-s for all even rounds with the elements in each row (i.e. for a fixed input difference) sorted in descending order of their probability (an eXtended Row-Sorted DDT_E ). |
XRSDDT_O | an array of fixed-key fixed- DDT-s for all odd rounds with the elements in each row (i.e. for a fixed input difference) sorted in descending order of their probability (an eXtended Row-Sorted DDT_O ). |
XSDDT_O | an array of fixed-key fixed- DDT-s for all odd rounds will all elements sorted in descending order of their probability (an eXtended Sorted DDT_O ). |
XSDDT_E | an array of fixed-key fixed- DDT-s for all even rounds will all elements sorted in descending order of their probability (an eXtended Sorted DDT_E ). |
B | array containing the best differential probabilities for i rounds: . |
Bn | the best probability on rounds, updated dynamically. |
diff_in | array of differentials. |
trail | best differential trail for nrounds . |
The outline of the array of bounds is the following:
void tea_search_ddt | ( | uint32_t | key[4] | ) |
Search for ADD differential trails in a modified version of block cipher TEA that uses the same round constant in every round. Computes full difference distribution tables (DDT) for every key and the same round constant: a wrapper function for round_ddt.
key | cryptographic key of TEA. |
void tea_search_xddt | ( | uint32_t | key[4] | ) |
Search for ADD differential trails in the original version of block cipher TEA. Computes full difference distribution tables (DDT) for every key and every round constant: a wrapper function for round_xddt.
key | cryptographic key of TEA. |
void tea_search_xddt_bottom_up | ( | uint32_t | key[4] | ) |
Search for ADD differential trails in the original version of block cipher TEA. Computes full difference distribution tables (DDT) for every key and every round constant. Conceptually the same as tea_search_xddt, except that the search starts from the last round and proceeds up to the first (i.e. in a bottom-up amnner). This function is a wrapper for round_xddt_bottom_up.
key | cryptographic key of TEA. |
double verify_trail | ( | uint64_t | npairs, |
differential_t | trail[NROUNDS], | ||
uint32_t | nrounds, | ||
uint32_t | key[4], | ||
uint32_t | delta, | ||
uint32_t | lsh_const, | ||
uint32_t | rsh_const | ||
) |
Experimentally verify the probabilities of the 1-round differentials composing an N-round differential trail for block cipher TEA, against the exact probabilities from a DDT.