2 //g++ -O3 one_round_test.cpp pixmap_io.o -o one_round_test -std=c++11
16 /*#include <cryptopp/hex.h>
17 #include <cryptopp/sha.h>
18 #include <cryptopp/osrng.h>
19 #include <cryptopp/secblock.h>
24 int load_RGB_pixmap(char *filename, int *width, int *height, unsigned char**R_data, unsigned char**G_data, unsigned char**B_data);
25 void store_RGB_pixmap(char *filename, unsigned char *R_data, unsigned char *G_data, unsigned char *B_data, int width, int height);
29 //using namespace CryptoPP;
43 typedef unsigned char uchar;
48 struct timeval tstart;
49 gettimeofday(&tstart,0);
50 return( (double) (tstart.tv_sec + tstart.tv_usec*1e-6) );
53 double TimeStop(double t)
57 gettimeofday(&tend,0);
58 t = (double) (tend.tv_sec + tend.tv_usec*1e-6) - t;
67 void inverse_tables(uchar *tab, int size_tab,uchar *inv_perm_tabs) {
69 for(int i=0;i<size_tab;i++) {
70 inv_perm_tabs[tab[i]] = i;
75 void inverse_tables_int(int *tab, int size_tab,int *inv_perm_tabs) {
77 for(int i=0;i<size_tab;i++) {
78 inv_perm_tabs[tab[i]] = i;
85 void rc4key(uchar *key, uchar *sc, int size_DK) {
87 for(int i=0;i<256;i++) {
93 for(int i0=0; i0<256; i0++) {
94 j0 = (j0 + sc[i0] + key[i0%size_DK] )&0xFF;
103 void rc4keyperm(uchar *key,int len, int rp,int *sc, int size_DK) {
109 for (int i=0;i<len;i++) {
112 for (int it = 0; it < rp; it++) {
114 for(int i0 = 0; i0<len; i0++) {
115 j0 = (j0 + sc[i0] + sc[j0] + key[i0%size_DK] )% len;
124 void prga(uchar *sc, int ldata, uchar *r) {
128 for (int it=0; it<ldata; it++) {
129 i0 = ((i0+1)&0xFE); //%255);
130 j0 = (j0 + sc[i0])&0xFF;
134 r[it]=sc[(sc[i0]+sc[j0])&0xFF];
138 inline uchar circ(uchar x,int n) {return (x << n) | (x >> (8 - n));}
140 void diff(uchar *Y, uchar *X, int h) {
143 Y[0] = X[1]^X[2]^X[3];
144 Y[1] = X[0]^X[2]^X[3];
145 Y[2] = X[0]^X[1]^X[3];
146 Y[3] = X[0]^X[1]^X[2];
149 /*Y[0] = X[0]^X[2]^X[3]^X[5]^X[6]^X[7];
150 Y[1] = X[0]^X[1]^X[3]^X[4]^X[6]^X[7];
151 Y[2] = X[0]^X[1]^X[2]^X[4]^X[5]^X[7];
152 Y[3] = X[1]^X[2]^X[3]^X[4]^X[5]^X[6];
153 Y[4] = X[0]^X[1]^X[5]^X[6]^X[7];
154 Y[5] = X[1]^X[2]^X[4]^X[6]^X[7];
155 Y[6] = X[2]^X[3]^X[4]^X[5]^X[7];
156 Y[7] = X[0]^X[3]^X[4]^X[5]^X[6];
169 Y[0] = X0^X2^X3^X5^X6^X7;
170 Y[1] = X0^X1^X3^X4^X6^X7;
171 Y[2] = X0^X1^X2^X4^X5^X7;
172 Y[3] = X1^X2^X3^X4^X5^X6;
173 Y[4] = X0^X1^X5^X6^X7;
174 Y[5] = X1^X2^X4^X6^X7;
175 Y[6] = X2^X3^X4^X5^X7;
176 Y[7] = X0^X3^X4^X5^X6;
182 Y[0] = X[3] ^ X[4] ^ X[6] ^ X[8] ^ X[9] ^ X[13] ^ X[14];
183 Y[1] = X[2] ^ X[5] ^ X[7] ^ X[8] ^ X[9] ^ X[12] ^ X[15];
184 Y[2] = X[1] ^ X[4] ^ X[6] ^ X[10] ^ X[11] ^ X[12] ^ X[15];
185 Y[3] = X[0] ^ X[5] ^ X[7] ^ X[10] ^ X[11] ^ X[13] ^ X[14];
186 Y[4] = X[0] ^ X[2] ^ X[5] ^ X[8] ^ X[11] ^ X[14] ^ X[15];
187 Y[5] = X[1] ^ X[3] ^ X[4] ^ X[9] ^ X[10] ^ X[14] ^ X[15];
188 Y[6] = X[0] ^ X[2] ^ X[7] ^ X[9] ^ X[10] ^ X[12] ^ X[13];
189 Y[7] = X[1] ^ X[3] ^ X[6] ^ X[8] ^ X[11] ^ X[12] ^ X[13];
190 Y[8] = X[0] ^ X[1] ^ X[4] ^ X[7] ^ X[10] ^ X[13] ^ X[15];
191 Y[9] = X[0] ^ X[1] ^ X[5] ^ X[6] ^ X[11] ^ X[12] ^ X[14];
192 Y[10] = X[2] ^ X[3] ^ X[5] ^ X[6] ^ X[8] ^ X[13] ^ X[15];
193 Y[11] = X[2] ^ X[3] ^ X[4] ^ X[7] ^ X[9] ^ X[12] ^ X[14];
194 Y[12] = X[1] ^ X[2] ^ X[6] ^ X[7] ^ X[9] ^ X[11] ^ X[12];
195 Y[13] = X[0] ^ X[3] ^ X[6] ^ X[7] ^ X[8] ^ X[10] ^ X[13];
196 Y[14] = X[0] ^ X[3] ^ X[4] ^ X[5] ^ X[9] ^ X[11] ^ X[14];
197 Y[15] = X[1] ^ X[2] ^ X[4] ^ X[5] ^ X[8] ^ X[10] ^ X[15];
218 Y[0] = X3 ^ X4 ^ X6 ^ X8 ^ X9 ^ X13 ^ X14;
219 Y[1] = X2 ^ X5 ^ X7 ^ X8 ^ X9 ^ X12 ^ X15;
220 Y[2] = X1 ^ X4 ^ X6 ^ X10 ^ X11 ^ X12 ^ X15;
221 Y[3] = X0 ^ X5 ^ X7 ^ X10 ^ X11 ^ X13 ^ X14;
222 Y[4] = X0 ^ X2 ^ X5 ^ X8 ^ X11 ^ X14 ^ X15;
223 Y[5] = X1 ^ X3 ^ X4 ^ X9 ^ X10 ^ X14 ^ X15;
224 Y[6] = X0 ^ X2 ^ X7 ^ X9 ^ X10 ^ X12 ^ X13;
225 Y[7] = X1 ^ X3 ^ X6 ^ X8 ^ X11 ^ X12 ^ X13;
226 Y[8] = X0 ^ X1 ^ X4 ^ X7 ^ X10 ^ X13 ^ X15;
227 Y[9] = X0 ^ X1 ^ X5 ^ X6 ^ X11 ^ X12 ^ X14;
228 Y[10] = X2 ^ X3 ^ X5 ^ X6 ^ X8 ^ X13 ^ X15;
229 Y[11] = X2 ^ X3 ^ X4 ^ X7 ^ X9 ^ X12 ^ X14;
230 Y[12] = X1 ^ X2 ^ X6 ^ X7 ^ X9 ^ X11 ^ X12;
231 Y[13] = X0 ^ X3 ^ X6 ^ X7 ^ X8 ^ X10 ^ X13;
232 Y[14] = X0 ^ X3 ^ X4 ^ X5 ^ X9 ^ X11 ^ X14;
233 Y[15] = X1 ^ X2 ^ X4 ^ X5 ^ X8 ^ X10 ^ X15;
241 Y[0]=X[0]^X[1]^X[2]^X[3]^X[4]^X[7]^X[8]^X[10]^X[12]^X[15]^X[16]^X[17]^X[18]^X[20]^X[21]^X[24]^X[25]^X[28]^X[30];
242 Y[1]=X[0]^ X[1]^X[2]^X[3]^X[5]^X[6]^X[9]^X[11]^X[13]^X[14]^X[16]^X[17]^X[19]^X[20]^X[21]^ X[24]^X[25]^X[29]^X[31];
243 Y[2]=X[0]^X[1]^X[2]^X[3]^X[5]^X[6]^X[8]^X[10]^X[13]^X[14]^X[16]^X[18]^X[19]^X[22]^X[23]^X[26]^X[27]^X[28]^X[30];
244 Y[3]=X[0]^X[1]^X[2]^X[3]^X[4]^X[7]^X[9]^X[11]^X[12]^X[15]^X[17]^X[18]^X[19]^X[22]^X[23]^X[26]^X[27]^X[29]^X[31];
245 Y[4]=X[0]^X[3]^X[5]^X[6]^X[7]^X[10]^X[11]^ X[12]^X[13]^X[14]^ X[15]^X[16]^X[19]^X[21]^X[23]^ X[25]^X[27]^X[30]^X[31];
246 Y[5]=X[1]^X[2]^X[4]^X[6]^X[7]^X[10]^X[11]^X[12]^X[13]^X[14]^X[16 ]^X[17]^X[18]^X[20]^X[22]^X[24]^X[26]^X[30]^X[31];
247 Y[6]=X[1]^X[2]^X[4]^X[5]^X[7]^X[8]^X[9]^X[12]^X[13]^X[14]^X[15]^ X[17]^X[18]^X[21]^X[23]^X[25]^X[27]^X[28]^X[29];
248 Y[7]=X[0]^X[3]^X[4]^X[5]^X[6]^X[9 ]^X[9]^X[12]^X[13]^X[14]^X[15]^X[16]^X[19]^X[20]^X[22]^X[24]^X[26]^X[28]^X[29];
249 Y[8]=X[0]^X[2]^X[6]^X[7]^X[8]^X[10]^X[11]^X[14]^X[15]^X[16]^X[18]^X[21]^X[22]^X[25]^X[26];
250 Y[9]=X[1]^ X[3]^X[6]^X[7]^X[9]^X[10]^X[11]^X[14]^X[15]^X[17]^X[19]^X[20]^X[23]^X[24]^X[27];
251 Y[10]=X[0]^X[2]^X[4]^X[5]^X[8]^X[9]^X[10]^X[12]^X[13]^X[16]^X[18]^X[20]^X[23]^ X[24]^X[27];
252 Y[11]=X[1]^X[3]^X[4]^X[5]^X[8]^X[9]^X[11]^X[12]^X[13]^X[17]^X[19]^X[21]^X[22]^X[25]^X[26];
253 Y[12]=X[0]^X[3]^X[4]^X[5]^X[6]^X[7]^X[10]^X[11]^X[13]^X[14]^X[15]^X[16]^X[19]^X[21]^X[23]^X[25]^X[27]^X[30]^X[31];
254 Y[13]=X[1]^X[2]^X[4]^X[5]^X[6]^X[7]^X[10]^X[11]^X[12]^X[14]^X[15]^X[17]^ X[18]^X[20]^X[22]^X[24]^X[26]^X[30]^X[31];
255 Y[14]=X[1]^X[2]^X[4]^X[5]^X[6]^X[7]^X[8]^X[9]^X[12]^X[13]^X[15]^X[17]^X[18]^X[21]^X[23]^X[25]^X[27]^X[28]^X[29];
256 Y[15]=X[0]^X[3]^X[4]^X[5]^X[6]^X[7]^X[8]^X[9]^X[12]^X[13]^X[14]^X[16]^X[19]^X[20]^X[22]^ X[24]^X[26]^X[28]^X[29];
257 Y[16]=X[0]^X[1]^X[2]^X[4]^X[8 ]^X[8]^X[10]^X[13 ]^X[15]^X[16]^X[17]^X[18]^X[19]^X[20]^X[21]^X[24]^X[25]^X[28]^X[30];
258 Y[17]=X[0]^X[1]^X[3]^X[5]^X[6]^X[9]^X[11]^X[13]^X[14]^X[16]^X[17]^X[18]^X[19]^X[20]^X[21]^X[24]^X[25]^X[29]^X[31];
259 Y[18]=X[0]^X[2]^X[3]^X[5]^X[6]^X[8]^X[10]^X[13]^X[14]^X[16]^X[17]^X[18]^X[19]^X[22]^X[23]^X[26]^X[27]^X[28]^X[30];
260 Y[19]=X[1]^X[2]^X[3]^X[4]^X[7]^X[9]^X[11]^X[12]^X[15]^X[16]^X[17]^X[18]^X[19]^X[22]^X[23]^X[26]^X[28 ]^X[29]^X[31];
261 Y[20]=X[0]^X[1]^X[5]^X[7]^X[10 ]^X[10]^X[13]^X[15]^X[16]^X[17]^X[20]^X[21]^X[23]^X[29]^X[30];
262 Y[21]=X[0]^X[1]^X[4]^X[6]^X[8]^X[11]^X[12]^X[14]^X[16]^X[17]^X[20]^X[21]^X[22]^X[28]^X[31];
263 Y[22]=X[2]^X[3]^X[5]^X[7]^X[8]^X[11]^X[13]^X[15]^X[18]^X[19]^X[21]^X[22]^X[23]^X[28]^X[31];
264 Y[23]=X[2]^X[3]^X[4]^X[6]^X[9]^X[10]^X[12]^X[14]^ X[18]^X[19]^X[20]^X[22]^X[23]^X[29]^X[30];
265 Y[24]=X[0]^X[1]^X[5]^X[7]^X[9]^X[10]^X[13]^X[15]^X[16]^X[17]^X[24]^X[25]^X[27]^X[29]^X[30];
266 Y[25]=X[0]^X[1]^X[4]^X[6]^X[8]^X[11]^X[12]^X[14]^X[16]^X[17]^X[24]^X[25]^X[26]^X[28]^X[31];
267 Y[26]=X[2]^X[3]^X[5]^X[7]^X[8]^X[11]^X[13]^X[15]^X[18]^X[19]^X[25]^X[26]^X[27]^X[28]^ X[31];
268 Y[27]=X[2]^X[3]^X[4]^X[6]^X[9]^X[10]^X[12]^X[14]^X[18]^X[19]^X[24]^X[26]^X[27]^X[29]^X[30];
269 Y[28]=X[0]^X[2]^X[6]^X[7]^X[14]^X[15]^X[16]^X[18]^X[21]^X[22]^X[25]^X[26]^X[28]^X[30]^X[31];
270 Y[29]=X[2]^X[3]^X[6]^X[7]^X[14]^X[15]^X[17]^X[19]^X[20]^X[23]^X[24]^X[27]^X[29]^X[30]^X[31];
271 Y[30]=X[1]^X[2]^X[4]^X[5]^X[12]^X[13]^X[16]^X[18]^X[20]^X[23]^X[24]^X[27]^X[28]^X[29]^X[30];
272 Y[31]=X[2]^X[3]^X[4]^X[5]^X[12]^X[13]^X[17]^X[19]^X[21]^X[22]^X[25]^X[26]^X[28]^X[29]^X[31];
309 Y[0]=X0^X1^X2^X3^X4^X7^X8^X10^X12^X15^X16^X17^X18^X20^X21^X24^X25^X28^X30;
310 Y[1]=X0^ X1^X2^X3^X5^X6^X9^X11^X13^X14^X16^X17^X19^X20^X21^ X24^X25^X29^X31;
311 Y[2]=X0^X1^X2^X3^X5^X6^X8^X10^X13^X14^X16^X18^X19^X22^X23^X26^X27^X28^X30;
312 Y[3]=X0^X1^X2^X3^X4^X7^X9^X11^X12^X15^X17^X18^X19^X22^X23^X26^X27^X29^X31;
313 Y[4]=X0^X3^X5^X6^X7^X10^X11^ X12^X13^X14^ X15^X16^X19^X21^X23^ X25^X27^X30^X31;
314 Y[5]=X1^X2^X4^X6^X7^X10^X11^X12^X13^X14^X16 ^X17^X18^X20^X22^X24^X26^X30^X31;
315 Y[6]=X1^X2^X4^X5^X7^X8^X9^X12^X13^X14^X15^ X17^X18^X21^X23^X25^X27^X28^X29;
316 Y[7]=X0^X3^X4^X5^X6^X9 ^X9^X12^X13^X14^X15^X16^X19^X20^X22^X24^X26^X28^X29;
317 Y[8]=X0^X2^X6^X7^X8^X10^X11^X14^X15^X16^X18^X21^X22^X25^X26;
318 Y[9]=X1^ X3^X6^X7^X9^X10^X11^X14^X15^X17^X19^X20^X23^X24^X27;
319 Y[10]=X0^X2^X4^X5^X8^X9^X10^X12^X13^X16^X18^X20^X23^ X24^X27;
320 Y[11]=X1^X3^X4^X5^X8^X9^X11^X12^X13^X17^X19^X21^X22^X25^X26;
321 Y[12]=X0^X3^X4^X5^X6^X7^X10^X11^X13^X14^X15^X16^X19^X21^X23^X25^X27^X30^X31;
322 Y[13]=X1^X2^X4^X5^X6^X7^X10^X11^X12^X14^X15^X17^ X18^X20^X22^X24^X26^X30^X31;
323 Y[14]=X1^X2^X4^X5^X6^X7^X8^X9^X12^X13^X15^X17^X18^X21^X23^X25^X27^X28^X29;
324 Y[15]=X0^X3^X4^X5^X6^X7^X8^X9^X12^X13^X14^X16^X19^X20^X22^ X24^X26^X28^X29;
325 Y[16]=X0^X1^X2^X4^X8 ^X8^X10^X13 ^X15^X16^X17^X18^X19^X20^X21^X24^X25^X28^X30;
326 Y[17]=X0^X1^X3^X5^X6^X9^X11^X13^X14^X16^X17^X18^X19^X20^X21^X24^X25^X29^X31;
327 Y[18]=X0^X2^X3^X5^X6^X8^X10^X13^X14^X16^X17^X18^X19^X22^X23^X26^X27^X28^X30;
328 Y[19]=X1^X2^X3^X4^X7^X9^X11^X12^X15^X16^X17^X18^X19^X22^X23^X26^X28 ^X29^X31;
329 Y[20]=X0^X1^X5^X7^X10 ^X10^X13^X15^X16^X17^X20^X21^X23^X29^X30;
330 Y[21]=X0^X1^X4^X6^X8^X11^X12^X14^X16^X17^X20^X21^X22^X28^X31;
331 Y[22]=X2^X3^X5^X7^X8^X11^X13^X15^X18^X19^X21^X22^X23^X28^X31;
332 Y[23]=X2^X3^X4^X6^X9^X10^X12^X14^ X18^X19^X20^X22^X23^X29^X30;
333 Y[24]=X0^X1^X5^X7^X9^X10^X13^X15^X16^X17^X24^X25^X27^X29^X30;
334 Y[25]=X0^X1^X4^X6^X8^X11^X12^X14^X16^X17^X24^X25^X26^X28^X31;
335 Y[26]=X2^X3^X5^X7^X8^X11^X13^X15^X18^X19^X25^X26^X27^X28^ X31;
336 Y[27]=X2^X3^X4^X6^X9^X10^X12^X14^X18^X19^X24^X26^X27^X29^X30;
337 Y[28]=X0^X2^X6^X7^X14^X15^X16^X18^X21^X22^X25^X26^X28^X30^X31;
338 Y[29]=X2^X3^X6^X7^X14^X15^X17^X19^X20^X23^X24^X27^X29^X30^X31;
339 Y[30]=X1^X2^X4^X5^X12^X13^X16^X18^X20^X23^X24^X27^X28^X29^X30;
340 Y[31]=X2^X3^X4^X5^X12^X13^X17^X19^X21^X22^X25^X26^X28^X29^X31;
350 //the proposed hash function, which is based on DSD structure. Sensitivity is ensured by employing the binary diffusion
352 void hash_DSD_BIN(uchar* seq_in, uchar* RM1,int len, int *PboxRM, uchar *Sbox1, int h) {
355 // Goal: Calculate the hash value
356 // Output: RM (hash value)
358 // uchar *X=new uchar[h2];
359 // uchar *fX=new uchar[h2];
366 for(int it=0;it<len;it++) {
370 // Mix with dynamic RM
372 for(int a=0;a<h;a+=4) {
373 fX[a]=RM1[a]^seq_in[ind2+a];
374 fX[a+1]=RM1[a+1]^seq_in[ind2+a+1];
375 fX[a+2]=RM1[a+2]^seq_in[ind2+a+2];
376 fX[a+3]=RM1[a+3]^seq_in[ind2+a+3];
379 // First Diffusion Operation
383 // Substitution Operation
384 for(int a=0;a<h;a+=4) {
385 fX[a]=Sbox1[fX2[a]]; //Warning according to the size of h2, we can be outsize of Sbox1[a]
386 fX[a+1]=Sbox1[fX2[a+1]];
387 fX[a+2]=Sbox1[fX2[a+2]];
388 fX[a+3]=Sbox1[fX2[a+3]];
391 // Second Diffusion Operation
393 /*for(int a=0;a<h;a+=4) {
395 fX2[a+1]=circ(X[a+1],5);
396 fX2[a+2]=circ(X[a+2],1);
397 fX2[a+3]=circ(X[a+3],6);
402 // update RM and mix it with hashed block
403 for(int a=0;a<h;a+=4) {
404 RM1[a]=fX2[a]^RM1[PboxRM[a]];
405 RM1[a+1]=fX2[a+1]^RM1[PboxRM[a+1]];
406 RM1[a+2]=fX2[a+2]^RM1[PboxRM[a+2]];
407 RM1[a+3]=fX2[a+3]^RM1[PboxRM[a+3]];
410 for(int a=0;a<h;a+=4) {
411 RM1[a]=RM1[PboxRM[a]];
412 RM1[a+1]=RM1[PboxRM[a+1]];
413 RM1[a+2]=RM1[PboxRM[a+2]];
414 RM1[a+3]=RM1[PboxRM[a+3]];
417 for(int a=0;a<h;a+=4) {
418 RM1[a]=fX2[a]^RM1[a];
419 RM1[a+1]=fX2[a+1]^RM1[a+1];
420 RM1[a+2]=fX2[a+2]^RM1[a+2];
421 RM1[a+3]=fX2[a+3]^RM1[a+3];
441 int main(int argc, char** argv) {
450 for(int i=1; i<argc; i++){
451 if(strncmp(argv[i],"nb",2)==0) nb_test = atoi(&(argv[i][2])); //nb of test
452 if(strncmp(argv[i],"ctr",3)==0) ctr = atoi(&(argv[i][3])); //CTR ? 1 otherwise CBC like
453 if(strncmp(argv[i],"h",1)==0) h = atoi(&(argv[i][1])); //size of block
454 if(strncmp(argv[i],"sizebuf",7)==0) size_buf = atoi(&(argv[i][7])); //SIZE of the buffer
455 if(strncmp(argv[i],"lena",4)==0) lena = atoi(&(argv[i][4])); //Use Lena or buffer
456 if(strncmp(argv[i],"c",1)==0) change = atoi(&(argv[i][1])); //Use Lena or buffer
460 cout<<size_buf<<endl;
466 uchar Secretkey[key_size];
468 uchar counter[key_size];
470 for(int i=0;i<key_size;i++) {
471 Secretkey[i]=lrand48()&0xFF;
472 counter[i]=lrand48()&0xFF;
485 uchar *data_R, *data_G, *data_B;
490 load_RGB_pixmap("lena.ppm", &width, &height, &data_R, &data_G, &data_B);
491 imsize=width*height*3;
492 // load_RGB_pixmap("No_ecb_mode_picture.ppm", &width, &height, &data_R, &data_G, &data_B);
496 buffer=new uchar[imsize];
497 for(int i=0;i<imsize;i++) {
505 uchar* seq= new uchar[imsize];
506 uchar* seq2= new uchar[imsize];
511 for(int i=0;i<oneD;i++) {
513 seq[oneD+i]=data_G[i];
514 seq[2*oneD+i]=data_B[i];
519 for(int i=0;i<oneD;i++) {
537 int total_len=imsize;
539 int len= total_len/h;
543 uchar *mix=new uchar[256];
548 for (int i = 0; i < 256 ; i++) {
549 mix[i]=Secretkey[i]^counter[i];
553 // cout<<"hash "<<endl;
554 for (int i = 0; i < 64 ; i++) {
562 int *PboxRM=new int[h];
572 double t=TimeStart();
573 rc4key(DK, Sbox1, 8);
576 rc4key(&DK[8], sc, 8);
583 rc4keyperm(&DK[16], h, rp, PboxRM, 8);
586 cout<<"Time initializaton "<<time<<endl;
598 for(int i=0;i<h;i++){
602 cout<<"imsize "<<imsize<<endl;
604 /* for(int i=0;i<imsize;i++){
605 cout<<(int)seq[i]<<" ";
612 for(int i=0;i<nb_test;i++)
614 hash_DSD_BIN(seq, RM1,len,PboxRM,Sbox1,h);
621 cout<<"Hash Time "<<time<<endl;
622 cout<<(double)imsize*nb_test/time<<"\t";
624 for(int i=0;i<h;i++){
625 cout<<(int)RM1[i]<<" ";