Tests for automatic search for the best XOR differential trail in block cipher Speck .
More...
|
#define | MIN(X, Y) (((X) < (Y)) ? (X) : (Y)) |
|
#define | UPDATE_BOUND false |
|
#define | EPS (1.0 / (double)(1ULL << 2)) |
|
|
void | speck_best_diff_search_full (differential_3d_t T_best[NROUNDS], double *p_best) |
|
void | speck_add_diff_to_trail (differential_3d_t T[NROUNDS], const uint32_t i, const differential_3d_t new_diff) |
|
void | speck_remove_diff_from_trail (differential_3d_t T[NROUNDS], const uint32_t i) |
|
void | speck_init_diff_trail (differential_3d_t T[NROUNDS]) |
|
void | speck_print_diff_trail (differential_3d_t T[NROUNDS]) |
|
void | speck_print_differential (differential_3d_t T[NROUNDS]) |
|
void | speck_print_diff_trail_log2 (differential_3d_t T[NROUNDS]) |
|
void | speck_print_diff_trail_cstyle (differential_3d_t T[NROUNDS]) |
|
void | speck_print_diff_trail_cstyle_log2 (differential_3d_t T[NROUNDS]) |
|
void | speck_print_diff_trail_latex (differential_3d_t T[NROUNDS]) |
|
void | speck_print_diff_trail_latex_log2 (differential_3d_t T[NROUNDS]) |
|
void | speck_copy_diff_trail (const differential_3d_t from_T[NROUNDS], differential_3d_t to_T[NROUNDS]) |
|
void | speck_best_diff_search_i (const uint32_t iround, const uint32_t ibit, const WORD_T alpha_in, const WORD_T beta_in, const WORD_T gamma_in) |
|
void | speck_best_diff_search () |
|
void | speck_best_diff_search_log2_i (const uint32_t iround, const uint32_t ibit, const WORD_T alpha_in, const WORD_T beta_in, const WORD_T gamma_in) |
|
void | speck_best_diff_search_log2 () |
|
void | speck_convert_diff_trail_to_differentials (const uint32_t nrounds, const differential_3d_t trail[SPECK_TRAIL_LEN], differential_t diff_arr[SPECK_TRAIL_LEN], WORD_T *delta_L, WORD_T *delta_R) |
|
void | speck_compute_next_alpha_beta (const WORD_T beta_in, const WORD_T gamma_in, WORD_T *alpha_next, WORD_T *beta_next) |
|
void | speck_compute_prev_gamma_beta (const WORD_T alpha_in, const WORD_T beta_in, WORD_T *gamma_prev, WORD_T *beta_prev) |
|
void | test_speck_best_diff_search_full () |
|
void | test_xdp_add_lm () |
|
void | test_xdp_add_monotonous_decrease () |
|
void | test_mask () |
|
int | main () |
|
Tests for automatic search for the best XOR differential trail in block cipher Speck .
- Author
- V.Velichkov, vesse.nosp@m.lin..nosp@m.velic.nosp@m.hkov.nosp@m.@uni..nosp@m.lu
- Date
- 2012-2015
#define UPDATE_BOUND false |
If UPDATE_BOUND is false then the algorithm will find ALL trails with probability (g_Bn * EPS) or higher.
Add new element at position i in the trail T
void speck_best_diff_search_full |
( |
differential_3d_t |
T_best[NROUNDS], |
|
|
double * |
p_best |
|
) |
| |
Full search for the best differential trail of block cipher SPECK (non-recursive).
- Note
- Feasible for up to 4 bit words and up to 5 rounds.
-
The complexity is 2^{(n+2) w}, where n is the total number of rounds and w is the word size. Therefore this function is exponential in the word size and in the number of rounds.
- See Also
- speck_xor_threshold_search_simple
void speck_best_diff_search_i |
( |
const uint32_t |
iround, |
|
|
const uint32_t |
ibit, |
|
|
const WORD_T |
alpha_in, |
|
|
const WORD_T |
beta_in, |
|
|
const WORD_T |
gamma_in |
|
) |
| |
Search for the best differential trail of block cipher SPECK.
- Parameters
-
iround | current round: |
ibit | current bit position |
alpha | first input difference to the addition of round iround |
beta | second input difference to the addition of round iround |
gamma | output difference from the addition of round iround |
- See Also
- speck_xor_threshold_search_simple
If UPDATE_BOUND is false then the algorithm will find ALL trails with probability (g_Bn * EPS) or higher.
void speck_best_diff_search_log2_i |
( |
const uint32_t |
iround, |
|
|
const uint32_t |
ibit, |
|
|
const WORD_T |
alpha_in, |
|
|
const WORD_T |
beta_in, |
|
|
const WORD_T |
gamma_in |
|
) |
| |
Search for the best differential trail of block cipher SPECK using log base 2 probabilities.
- Note
- Same as speck_best_trail_search_i, but uses log base 2 probabilities. Therefore no multiplication is used and so this variant is more efficient.
- Parameters
-
iround | current round: |
ibit | current bit position |
alpha | first input difference to the addition of round iround |
beta | second input difference to the addition of round iround |
gamma | output difference from the addition of round iround |
Credits: Yann Le Corre
- See Also
- speck_best_trail_search_i
void speck_convert_diff_trail_to_differentials |
( |
const uint32_t |
nrounds, |
|
|
const differential_3d_t |
trail[SPECK_TRAIL_LEN], |
|
|
differential_t |
diff_arr[SPECK_TRAIL_LEN], |
|
|
WORD_T * |
delta_L, |
|
|
WORD_T * |
delta_R |
|
) |
| |
Convert a trail as returned from speck_best_diff_search_i (= sequence of input and output differences from the modular addition) to a sequence of one round differentials (= sequences of one round input and output differences).
Copy trail from_T to to_T
Print the trail T with log2 probabilities
Print the only the input and output diferences of trail T (i.e. the differential corresponding to T)
Remove element from position i in the trail T (sets differences and prob. to zero)
void test_xdp_add_monotonous_decrease |
( |
| ) |
|
Check that xdp is monotonously decreasing in the word size.