YAARX: Yet Another ARX Toolkit  0.1
 All Data Structures Files Functions Variables Macros Pages
xdp-tea-f-fk.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012-2013 Luxembourg University,
3  * Laboratory of Algorithmics, Cryptology and Security (LACS).
4  *
5  * This file is part of the YAARX toolkit. YAARX stands for
6  * Yet Another ARX toolkit for analysis of ARX cryptographic algorithms.
7  *
8  * YAARX is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * YAARX is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with YAARX. If not, see <http://www.gnu.org/licenses/>.
20  */
27 #ifndef XDP_TEA_F_FK_H
28 #define XDP_TEA_F_FK_H
29 
30 double xdp_f_fk_exper(const uint32_t da, const uint32_t db,
31  const uint32_t k0, const uint32_t k1, const uint32_t delta,
32  uint32_t lsh_const, uint32_t rsh_const);
33 
34 double max_xdp_f_fk_dx_exper(uint32_t* max_dx, const uint32_t dy,
35  const uint32_t k0, const uint32_t k1, const uint32_t delta,
36  uint32_t lsh_const, uint32_t rsh_const);
37 
38 double max_xdp_f_fk_dy_exper(const uint32_t dx, uint32_t* max_dy,
39  const uint32_t k0, const uint32_t k1, const uint32_t delta,
40  uint32_t lsh_const, uint32_t rsh_const);
41 
42 bool xdp_f_is_sat(const uint32_t mask_i, const uint32_t lsh_const, const uint32_t rsh_const,
43  const uint32_t k0, const uint32_t k1, const uint32_t delta,
44  const uint32_t dx, const uint32_t dy, int32_t x);
45 
46 
47 bool xdp_f_check_x(const uint32_t lsh_const, const uint32_t rsh_const,
48  const uint32_t k0, const uint32_t k1, const uint32_t delta,
49  const uint32_t dx, const uint32_t dy, const uint32_t x);
50 
51 uint32_t xdp_f_assign_bit_x(const uint32_t n, const uint32_t i, const uint32_t mask_i, const uint32_t x,
52  const uint32_t lsh_const, const uint32_t rsh_const,
53  const uint32_t k0, const uint32_t k1, const uint32_t delta,
54  const uint32_t dx, const uint32_t dy, uint32_t* x_cnt, double* prob);
55 
56 double xdp_f_fk(const uint32_t n, const uint32_t dx, const uint32_t dy,
57  const uint32_t k0, const uint32_t k1, const uint32_t delta,
58  const uint32_t lsh_const, const uint32_t rsh_const);
59 
60 uint32_t xdp_f_assign_bit_x_dx(const uint32_t n, const uint32_t i, const uint32_t mask_i, const uint32_t x,
61  const uint32_t lsh_const, const uint32_t rsh_const,
62  const uint32_t k0, const uint32_t k1, const uint32_t delta,
63  const uint32_t dx, const uint32_t dy, uint64_t* x_cnt,
64  double* ret_prob, uint32_t* ret_dx);
65 
66 double max_dx_xdp_f_fk(const uint32_t n, uint32_t* ret_dx, const uint32_t dy,
67  const uint32_t k0, const uint32_t k1, const uint32_t delta,
68  const uint32_t lsh_const, const uint32_t rsh_const);
69 
70 uint32_t xdp_f_assign_bit_x_dy(const uint32_t n, const uint32_t i, const uint32_t mask_i, const uint32_t x,
71  const uint32_t lsh_const, const uint32_t rsh_const,
72  const uint32_t k0, const uint32_t k1, const uint32_t delta,
73  const uint32_t dx, const uint32_t dy, uint64_t* x_cnt,
74  double* ret_prob, uint32_t* ret_dy);
75 
76 double max_dy_xdp_f_fk(const uint32_t n, const uint32_t dx, uint32_t* ret_dy,
77  const uint32_t k0, const uint32_t k1, const uint32_t delta,
78  const uint32_t lsh_const, const uint32_t rsh_const);
79 
80 #endif // #ifndef XDP_TEA_F_FK_H
double max_xdp_f_fk_dy_exper(const uint32_t dx, uint32_t *max_dy, const uint32_t k0, const uint32_t k1, const uint32_t delta, uint32_t lsh_const, uint32_t rsh_const)
Definition: xdp-tea-f-fk.cc:131
bool xdp_f_check_x(const uint32_t lsh_const, const uint32_t rsh_const, const uint32_t k0, const uint32_t k1, const uint32_t delta, const uint32_t dx, const uint32_t dy, const uint32_t x)
Definition: xdp-tea-f-fk.cc:205
double max_dx_xdp_f_fk(const uint32_t n, uint32_t *ret_dx, const uint32_t dy, const uint32_t k0, const uint32_t k1, const uint32_t delta, const uint32_t lsh_const, const uint32_t rsh_const)
Definition: xdp-tea-f-fk.cc:457
uint32_t xdp_f_assign_bit_x_dx(const uint32_t n, const uint32_t i, const uint32_t mask_i, const uint32_t x, const uint32_t lsh_const, const uint32_t rsh_const, const uint32_t k0, const uint32_t k1, const uint32_t delta, const uint32_t dx, const uint32_t dy, uint64_t *x_cnt, double *ret_prob, uint32_t *ret_dx)
Definition: xdp-tea-f-fk.cc:372
double max_xdp_f_fk_dx_exper(uint32_t *max_dx, const uint32_t dy, const uint32_t k0, const uint32_t k1, const uint32_t delta, uint32_t lsh_const, uint32_t rsh_const)
Definition: xdp-tea-f-fk.cc:96
uint32_t xdp_f_assign_bit_x(const uint32_t n, const uint32_t i, const uint32_t mask_i, const uint32_t x, const uint32_t lsh_const, const uint32_t rsh_const, const uint32_t k0, const uint32_t k1, const uint32_t delta, const uint32_t dx, const uint32_t dy, uint32_t *x_cnt, double *prob)
Definition: xdp-tea-f-fk.cc:243
double max_dy_xdp_f_fk(const uint32_t n, const uint32_t dx, uint32_t *ret_dy, const uint32_t k0, const uint32_t k1, const uint32_t delta, const uint32_t lsh_const, const uint32_t rsh_const)
Definition: xdp-tea-f-fk.cc:637
bool xdp_f_is_sat(const uint32_t mask_i, const uint32_t lsh_const, const uint32_t rsh_const, const uint32_t k0, const uint32_t k1, const uint32_t delta, const uint32_t dx, const uint32_t dy, int32_t x)
Definition: xdp-tea-f-fk.cc:172
double xdp_f_fk_exper(const uint32_t da, const uint32_t db, const uint32_t k0, const uint32_t k1, const uint32_t delta, uint32_t lsh_const, uint32_t rsh_const)
Definition: xdp-tea-f-fk.cc:53
double xdp_f_fk(const uint32_t n, const uint32_t dx, const uint32_t dy, const uint32_t k0, const uint32_t k1, const uint32_t delta, const uint32_t lsh_const, const uint32_t rsh_const)
Definition: xdp-tea-f-fk.cc:307
uint32_t xdp_f_assign_bit_x_dy(const uint32_t n, const uint32_t i, const uint32_t mask_i, const uint32_t x, const uint32_t lsh_const, const uint32_t rsh_const, const uint32_t k0, const uint32_t k1, const uint32_t delta, const uint32_t dx, const uint32_t dy, uint64_t *x_cnt, double *ret_prob, uint32_t *ret_dy)
Definition: xdp-tea-f-fk.cc:552