30 #define XDP_ROT_AND_MSIZE 4
31 #define XDP_ROT_AND_NISTATES 2 // number of initial states
32 #define XDP_ROT_AND_MAX_DIFF_CNT (1ULL << 7)//70ULL//(1ULL << 3)//70ULL//(1ULL << 6)//(1ULL << 7)//(1ULL << 8)
33 #define XDP_ROT_AND_P_THRES 0.06//0.016//0.0.06//0.12//0.2//0.1//0.05//0.01//(1.0 / (double)(1UL << 4))//0.1//0.1//0.05
34 #define XDP_ROT_AND_P_LOW_THRES 0.0//(1.0 / (double)(1UL << 6))
35 #define XDP_ROT_AND_MAX_HW 4
36 #define TRAIL_MAX_HW 32
37 #define XDP_ROT_PDDT_GEN_RANDOM false
39 double xdp_rot_and_exper(uint32_t da, uint32_t dc,
40 uint32_t rot_const_1, uint32_t rot_const_2);
41 void xdp_rot_and_alloc_matrices(gsl_matrix* A[
WORD_SIZE]);
42 void xdp_rot_and_free_matrices(gsl_matrix* A[
WORD_SIZE]);
43 void xdp_rot_and_print_graph(gsl_matrix* A[
WORD_SIZE]);
44 void xdp_rot_and_print_matrix(gsl_matrix* A);
45 void xdp_rot_and_print_vector(gsl_vector* R);
46 void xdp_rot_and_compute_subgraph(gsl_matrix* A,
47 uint32_t da_in, uint32_t db_in, uint32_t dc_in,
48 uint32_t da_out, uint32_t db_out, uint32_t dc_out);
49 void xdp_rot_and_compute_graph(gsl_matrix* A[
WORD_SIZE], uint32_t i_start, uint32_t cycle_len,
50 uint32_t da_idx[WORD_SIZE], uint32_t db_idx[WORD_SIZE],
51 const uint32_t da,
const uint32_t db,
const uint32_t dc);
52 double xdp_rot_and(
const uint32_t delta,
const uint32_t dc,
53 const uint32_t s,
const uint32_t t);
54 void xdp_rot_and_index_debug(uint32_t s, uint32_t t);
55 void xdp_rot_and_xcond_init(uint32_t XCOND[2][2][2][2]);
58 uint32_t da_i, uint32_t db_i, uint32_t dc_i,
59 uint32_t x_i, uint32_t y_i);
60 double xdp_rot_and_constraints(
const uint32_t delta,
const uint32_t dc,
61 const uint32_t s_in,
const uint32_t t_in);
62 uint32_t xdp_rot_compute_indices(uint32_t s, uint32_t t,
bool b_is_marked[
WORD_SIZE],
63 uint32_t i_start, uint32_t start_idx,
64 uint32_t da_idx[WORD_SIZE], uint32_t db_idx[WORD_SIZE]);
65 void xdp_rot_and_compute_graph_i(gsl_matrix* A[
WORD_SIZE], uint32_t i_start, uint32_t cycle_len,
66 uint32_t da_idx[WORD_SIZE], uint32_t db_idx[WORD_SIZE],
67 const uint32_t da,
const uint32_t db,
const uint32_t dc);
68 void xdp_rot_and_normalize_matrix(gsl_matrix* A,
double f);
69 void max_xdp_rot_and_bounds_0(uint32_t k,
const uint32_t k_start,
const uint32_t n,
double* p, uint32_t* dc,
70 gsl_matrix* A, gsl_vector* B[XDP_ROT_AND_NISTATES][
WORD_SIZE], gsl_vector* C[2],
71 uint32_t da_idx[WORD_SIZE], uint32_t db_idx[WORD_SIZE],
72 const uint32_t da,
const uint32_t db,
73 uint32_t* dc_max,
double* p_max);
75 gsl_matrix* A, gsl_vector* B[
WORD_SIZE], gsl_vector* C,
76 uint32_t da_idx[WORD_SIZE], uint32_t db_idx[WORD_SIZE],
77 const uint32_t da,
const uint32_t db,
78 uint32_t* dc_max,
double* p_max);
79 void max_xdp_rot_and_bounds(gsl_vector* B[XDP_ROT_AND_NISTATES][
WORD_SIZE],
80 uint32_t i_start, uint32_t cycle_len,
81 uint32_t da_idx[WORD_SIZE], uint32_t db_idx[WORD_SIZE],
82 const uint32_t da,
const uint32_t db, uint32_t* dc_max);
83 void max_xdp_rot_and_print_bounds(gsl_vector* B[XDP_ROT_AND_NISTATES][
WORD_SIZE]);
84 double max_xdp_rot_and_exper(uint32_t da, uint32_t* dc_max,
85 uint32_t s, uint32_t t);
86 double max_xdp_rot_and(
const uint32_t delta, uint32_t* dc,
87 const uint32_t s,
const uint32_t t);
88 uint64_t
xdp_rot_and_pddt(std::set<differential_t, struct_comp_diff_dx_dy>* hways_diff_set_dx_dy,
89 std::multiset<differential_t, struct_comp_diff_p>* hways_diff_mset_p,
90 const uint32_t s,
const uint32_t t,
const uint64_t max_cnt,
const double p_thres);
91 void xdp_rot_and_print_mset_hw(std::multiset<differential_t, struct_comp_diff_hw> hways_diff_mset_hw);
92 void xdp_rot_and_print_mset_p(std::multiset<differential_t, struct_comp_diff_p> hways_diff_mset_p);
93 void xdp_rot_and_print_set_dx_dy(std::set<differential_t, struct_comp_diff_dx_dy> hways_diff_set_dx_dy);
95 std::set<differential_t, struct_comp_diff_dx_dy>* diff_set_dx_dy,
96 std::multiset<differential_t, struct_comp_diff_p>* diff_mset_p,
97 std::set<differential_t, struct_comp_diff_dx_dy>* hways_diff_set_dx_dy,
98 std::multiset<differential_t, struct_comp_diff_p>* hways_diff_mset_p,
99 std::set<differential_t, struct_comp_diff_dx_dy>* croads_diff_set_dx_dy,
100 std::multiset<differential_t, struct_comp_diff_p>* croads_diff_mset_p,
101 const uint32_t s,
const uint32_t t,
const uint32_t u,
102 const uint64_t max_cnt,
const double p_thres,
bool b_backto_hway);
104 std::set<differential_t, struct_comp_diff_dx_dy> diff_set_dx_dy);
105 void xdp_rot_and_ddt(std::set<differential_t, struct_comp_diff_dx_dy>* hways_diff_set_dx_dy,
106 std::multiset<differential_t, struct_comp_diff_p>* hways_diff_mset_p,
107 const uint32_t s,
const uint32_t t,
const double p_thres);
108 #endif // #ifndef XDP_ROT_AND_H
bool xdp_rot_and_is_dx_in_set_dx_dy(uint32_t dy, uint32_t dx, uint32_t dx_prev, uint32_t lrot_const_u, std::set< differential_t, struct_comp_diff_dx_dy > diff_set_dx_dy)
Definition: xdp-rot-and.cc:1144
#define WORD_SIZE
Definition: common.hh:119
uint64_t xdp_rot_and_pddt(std::set< differential_t, struct_comp_diff_dx_dy > *hways_diff_set_dx_dy, std::multiset< differential_t, struct_comp_diff_p > *hways_diff_mset_p, const uint32_t s, const uint32_t t, const uint64_t max_cnt, const double p_thres)
Definition: xdp-rot-and.cc:1242
uint32_t E[SALSA_STATE+SALSA_STATE][5]
Definition: salsa.cc:50
uint64_t xdp_rot_and_dx_pddt(const uint32_t delta, const uint32_t delta_prev, std::set< differential_t, struct_comp_diff_dx_dy > *diff_set_dx_dy, std::multiset< differential_t, struct_comp_diff_p > *diff_mset_p, std::set< differential_t, struct_comp_diff_dx_dy > *hways_diff_set_dx_dy, std::multiset< differential_t, struct_comp_diff_p > *hways_diff_mset_p, std::set< differential_t, struct_comp_diff_dx_dy > *croads_diff_set_dx_dy, std::multiset< differential_t, struct_comp_diff_p > *croads_diff_mset_p, const uint32_t s, const uint32_t t, const uint32_t u, const uint64_t max_cnt, const double p_thres, bool b_backto_hway)
Definition: xdp-rot-and.cc:1407
void max_xdp_rot_and_bounds_i(uint32_t k, const uint32_t k_start, const uint32_t n, double *p, uint32_t *dc, gsl_matrix *A, gsl_vector *B[WORD_SIZE], gsl_vector *C, uint32_t da_idx[WORD_SIZE], uint32_t db_idx[WORD_SIZE], const uint32_t da, const uint32_t db, uint32_t *dc_max, double *p_max)
Definition: xdp-rot-and.cc:888