YAARX: Yet Another ARX Toolkit  0.1
 All Data Structures Files Functions Variables Macros Pages
adp-xor3.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_XOR3_H
28 #define ADP_XOR3_H
29 
30 #ifndef ADP_XOR3_MSIZE
31 #define ADP_XOR3_MSIZE 16
32 #endif
33 #ifndef ADP_XOR3_NMATRIX
34 #define ADP_XOR3_NMATRIX 16
35 #endif
36 #ifndef ADP_XOR3_NINPUTS
37 #define ADP_XOR3_NINPUTS 3
38 #endif
39 #ifndef ADP_XOR3_ISTATE
40 #define ADP_XOR3_ISTATE 8
41 #endif
42 #ifndef ADP_XOR3_COLSUM
43 #define ADP_XOR3_COLSUM 8
44 #endif
45 #ifndef ADP_XOR3_NORM
46 #define ADP_XOR3_NORM 1.0 /(double)ADP_XOR3_COLSUM
47 #endif
48 
49 void adp_xor3_alloc_matrices(gsl_matrix* A[2][2][2][2]);
50 
51 void adp_xor3_free_matrices(gsl_matrix* A[2][2][2][2]);
52 
53 void adp_xor3_print_matrices(gsl_matrix* A[2][2][2][2]);
54 
55 void adp_xor3_print_matrices_sage(gsl_matrix* A[2][2][2][2]);
56 
57 void adp_xor3_normalize_matrices(gsl_matrix* A[2][2][2][2]);
58 
59 int adp_xor3_states_to_index(int s1, int s2, int s3, int s4);
60 
61 void adp_xor3_sf(gsl_matrix* A[2][2][2][2]);
62 
63 double adp_xor3(gsl_matrix* A[2][2][2][2], uint32_t da, uint32_t db, uint32_t dc, uint32_t dd);
64 
65 double adp_xor3_exper(const uint32_t da, const uint32_t db, const uint32_t dc, const uint32_t dd);
66 
67 #endif // #ifndef ADP_XOR3_H
void adp_xor3_print_matrices(gsl_matrix *A[2][2][2][2])
Definition: adp-xor3.cc:84
void adp_xor3_print_matrices_sage(gsl_matrix *A[2][2][2][2])
Definition: adp-xor3.cc:121
void adp_xor3_normalize_matrices(gsl_matrix *A[2][2][2][2])
Definition: adp-xor3.cc:196
double adp_xor3(gsl_matrix *A[2][2][2][2], uint32_t da, uint32_t db, uint32_t dc, uint32_t dd)
Definition: adp-xor3.cc:359
void adp_xor3_sf(gsl_matrix *A[2][2][2][2])
Definition: adp-xor3.cc:256
void adp_xor3_free_matrices(gsl_matrix *A[2][2][2][2])
Definition: adp-xor3.cc:62
int adp_xor3_states_to_index(int s1, int s2, int s3, int s4)
Definition: adp-xor3.cc:234
double adp_xor3_exper(const uint32_t da, const uint32_t db, const uint32_t dc, const uint32_t dd)
Definition: adp-xor3.cc:443
void adp_xor3_alloc_matrices(gsl_matrix *A[2][2][2][2])
Definition: adp-xor3.cc:40