YAARX: Yet Another ARX Toolkit  0.1
 All Data Structures Files Functions Variables Macros Pages
adp-arx.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 ADP_ARX_H
28 #define ADP_ARX_H
29 
30 #ifndef ADP_ARX_MSIZE
31 #define ADP_ARX_MSIZE 8
32 #endif
33 #ifndef ADP_ARX_NMATRIX
34 #define ADP_ARX_NMATRIX 8
35 #endif
36 #ifndef ADP_ARX_NINPUTS
37 #define ADP_ARX_NINPUTS 2
38 #endif
39 #ifndef ADP_ARX_COLSUM
40 #define ADP_ARX_COLSUM 4
41 #endif
42 
46 #ifndef ADP_ARX_NSPOS
47 #define ADP_ARX_NSPOS 2
48 #endif
49 #ifndef ADP_ARX_NORM
50 #define ADP_ARX_NORM 1.0 /(double)ADP_ARX_COLSUM
51 #endif
52 
59 #ifndef ADP_ARX_NISTATES
60 #define ADP_ARX_NISTATES 4
61 #endif
62 
69 #ifndef ADP_ARX_NFSTATES
70 #define ADP_ARX_NFSTATES 2
71 #endif
72 
73 extern uint32_t ADP_ARX_ISTATES[ADP_ARX_NISTATES];
74 
76 
77 void adp_arx_alloc_matrices(gsl_matrix* A[2][2][2][2]);
78 
79 void adp_arx_free_matrices(gsl_matrix* A[2][2][2][2]);
80 
81 void adp_arx_normalize_matrices(gsl_matrix* A[2][2][2][2]);
82 
83 void adp_arx_print_matrices(gsl_matrix* A[2][2][2][2]);
84 
85 void adp_arx_sf(gsl_matrix* A[2][2][2][2]);
86 
87 double adp_arx(gsl_matrix* A[2][2][2][2], uint32_t rot_const,
88  uint32_t da, uint32_t db, uint32_t dd, uint32_t de);
89 
90 double adp_arx_exper(uint32_t r, uint32_t da, uint32_t db, uint32_t dd, uint32_t de);
91 
92 
93 
94 #endif // #ifndef ADP_ARX_H
void adp_arx_print_matrices(gsl_matrix *A[2][2][2][2])
Definition: adp-arx.cc:130
void adp_arx_alloc_matrices(gsl_matrix *A[2][2][2][2])
Definition: adp-arx.cc:55
uint32_t ADP_ARX_FSTATES[ADP_ARX_NISTATES][ADP_ARX_NFSTATES]
Definition: adp-arx.cc:48
uint32_t ADP_ARX_ISTATES[ADP_ARX_NISTATES]
Definition: adp-arx.cc:40
#define ADP_ARX_NFSTATES
Definition: adp-arx.hh:70
void adp_arx_free_matrices(gsl_matrix *A[2][2][2][2])
Definition: adp-arx.cc:76
double adp_arx(gsl_matrix *A[2][2][2][2], uint32_t rot_const, uint32_t da, uint32_t db, uint32_t dd, uint32_t de)
Definition: adp-arx.cc:367
double adp_arx_exper(uint32_t r, uint32_t da, uint32_t db, uint32_t dd, uint32_t de)
Definition: adp-arx.cc:453
void adp_arx_normalize_matrices(gsl_matrix *A[2][2][2][2])
Definition: adp-arx.cc:97
void adp_arx_sf(gsl_matrix *A[2][2][2][2])
Definition: adp-arx.cc:260
#define ADP_ARX_NISTATES
Definition: adp-arx.hh:60