YAARX: Yet Another ARX Toolkit
0.1
|
Tests for rc5-tests.cc . More...
#include "common.hh"
#include "xdp-add.hh"
#include "adp-xor.hh"
#include "max-adp-xor.hh"
#include "adp-rot.hh"
#include "rc5-ref.hh"
#include "rc5-lwcs.hh"
#include "rc5-eq.hh"
#include "rc5-dc.hh"
#include "rc5-alex.hh"
#include "add-approx.hh"
#include "rc5-blind-oracle.hh"
Macros | |
#define | FMT_DEC(n) std::dec << std::setw((n)) << std::setfill(' ') |
#define | FMT_HEX(n) std::hex << std::setw((n)) << std::setfill('0') |
Functions | |
void | rc5_good_pairs_global_arr_to_vec (std::vector< pair_t > *good_pairs_vec, uint32_t arr_len) |
void | test_rc5_lwcs (int argc, const char *argv[]) |
void | test_rc5_differential () |
void | test_rc5_equal_rot_differential () |
void | rc5_xdp_add_last_round_print_matrices_sage (gsl_matrix *A[2][2][2], gsl_matrix *B[2][2][2][2]) |
void | test_rc5_last_round_matrices () |
void | test_rc5 () |
void | test_rc5_encrypt_get_intermediate_values () |
void | test_rc5_good_pairs_goup_filter_debug () |
uint32_t | rc5_good_pairs_count (const std::vector< pair_t > good_pairs_vec) |
void | test_rc5_fib_main () |
void | test_rc5_filter_go_up_debug_main () |
void | test_rc5_last_round_eq_key_contradictions_all_inputs (const gsl_matrix *A[2][2][2], const gsl_matrix *AA[2][2][2][2]) |
void | test_rc5_last_round_eq_key () |
void | test_rc5_last_round_eq_x_find_solutions_exper () |
void | test_rc5_last_round_eq_x_find_solutions_rec () |
void | test_rc5_last_round_eq_x_find_solutions_rec_all () |
void | test_rc5_last_round_eq_x_bit_seq_match () |
void | test_rc5_last_round_eq_x_bit_seq_match_all () |
void | test_rc5_last_round_eq_x_bit_seq_match_rand () |
void | test_rc5_key_struct () |
void | test_rc5_xdp_add_last_round () |
void | test_rc5_xdp_add_first_round_all () |
void | test_rc5_xdp_add_last_round_all () |
void | test_rc5_xdp_add_last_round_compare_prob_vs_hw_all () |
void | test_rc5_xdp_add_mid_round_compare_prob_vs_hw_all () |
void | test_rc5_xdp_add_last_round_diff_set_out_all () |
void | test_rc5_xdp_add_last_round_diff_set_out_wrapper () |
void | test_rc5_xdp_add_last_round_diff_set_out () |
void | test_rc5_mid_round_matrices () |
void | test_rc5_xdp_add_mid_round_all () |
void | test_rc5_mid_round_eq_xy_find_solutions_all () |
void | test_rc5_xdp_add_mid_round_diff_set_out () |
void | test_rc5_xdp_add_mid_round_diff_set_out_all () |
void | test_rc5_equal_rot_attack_compute_average_prob_hw () |
void | test_add_sub_approx () |
void | test_add_sub_approx_any_order () |
void | test_add_block_approx () |
void | test_add_block_approx_all () |
void | test_xdp_add_approx () |
void | test_xdp_add_approx_all () |
void | test_xdp_add_fixed_x_approx () |
void | test_xdp_add_fixed_x_approx_all () |
void | test_xdp_sub_approx () |
void | test_xdp_sub_approx_all () |
void | test_xdp_sub_fixed_x_approx () |
void | test_xdp_sub_fixed_x_approx_all () |
void | test_add_bitwise () |
void | test_sub_bitwise () |
void | test_rc5_filtered_pairs_read_from_file () |
void | test_rc5_filtered_pairs_process_from_file () |
void | test_rc5_last_round_rot_const_keyrec () |
void | test_rc5_log_file_read () |
void | test_rc5_compute_structures () |
void | test_rc5_filtered_pairs_slide_win_vote () |
void | test_rc5_filtered_pairs_neutral_bits () |
void | test_rc5_good_pairs_collect () |
void | parse_rand_val_from_stdin (const char *str, WORD_T *n) |
void | parse_key_from_stdin (const char *str, uint8_t *n) |
void | test_rc5_get_bit_seq () |
void | test_rc5_blind_oracle_various () |
void | test_yaarx_matrices_4d () |
void | test_rc5_adp_lrot () |
void | test_rc5_split_struct_v2 (WORD_T sub_struct_id, WORD_T sub_struct_nbits) |
int | main (int argc, const char *argv[]) |
Variables | |
uint32_t | g_arr_len |
double | g_min_prob_arr [(2 *NROUNDS)+3] |
double | g_max_hw_arr [(2 *NROUNDS)+3] |
uint32_t | g_add_approx_arr [(2 *NROUNDS)+3][WORD_SIZE] |
uint32_t | RC5_DIFF [13][2] |
Tests for rc5-tests.cc .
int main | ( | int | argc, |
const char * | argv[] | ||
) |
Main function of the tests.
GoUP linear as in the original BK paper (for comparison purpouses only!)
GoUP_NL ADD expand from our paper
uint32_t rc5_good_pairs_count | ( | const std::vector< pair_t > | good_pairs_vec | ) |
Find one or several good pairs and from them try to "learn" (ie. construct) more.
void rc5_good_pairs_global_arr_to_vec | ( | std::vector< pair_t > * | good_pairs_vec, |
uint32_t | arr_len | ||
) |
Transforms the elements of the global array g_good_pairs into a vector.
void rc5_xdp_add_last_round_print_matrices_sage | ( | gsl_matrix * | A[2][2][2], |
gsl_matrix * | B[2][2][2][2] | ||
) |
Print the matrices for rc5_xdp_add_last_round in a format readable by the computer algebra system Sage (http://www.sagemath.org/).
A | transition probability matrices for rc5_xdp_add_last_round . |
LAST round: A[y][yy][dx] : LAST round (y, yy, dx - fixed) FIRST round: A[x][xx][dy] : FIRST round (x, xx, dy - fixed)
LAST round: B[x][y][yy][dx] : LAST round (y, yy, dx - fixed) FIRST round: B[y][x][xx][dy] : FIRST round (x, xx, dy - fixed)
void test_rc5_fib_main | ( | ) |
key | key |
rand_L,rand_R | random values used in the generation of the structures (i.e. the A words) |
rc5_structures_nbits |
sub_struct_id | sequence number of a sub structure: used in order to parallelize the filtration on the HPC cluster (mostly relevant for 64-bit) |
sub_struct_nbits | total number of bits of the substructures (2^{sub_struct_nbits} > sub_struct_id) |
void test_rc5_filtered_pairs_process_from_file | ( | ) |
Read a list of filtered pairs from a file and process it
void test_rc5_filtered_pairs_read_from_file | ( | ) |
Read a list of filtered pairs from a file
void test_rc5_get_bit_seq | ( | ) |
Compute "good" constants for the structures. Compute a random "good" constant for the structures. Note: obsolete version. See test_rc5_compute_struct_const_rand First find a number of good pairs. Next from them construct the rand_LR constants by extracting the common 1s and 0s between all pairs. Compute a vector of constants rand_L, rand_R
void test_rc5_good_pairs_collect | ( | ) |
Collect good pairs for multiple keys. The data is intended to be used for plotting the distribution of neutral regions.
void test_rc5_last_round_rot_const_keyrec | ( | ) |
Test the key recovery precedure
void test_rc5_xdp_add_last_round_compare_prob_vs_hw_all | ( | ) |
Compare probability threshold vs. Hamming weight threshold
void test_rc5_xdp_add_mid_round_compare_prob_vs_hw_all | ( | ) |
Compare probability threshold vs. Hamming weight threshold
uint32_t RC5_DIFF[13][2] |