2 //g++ -O3 one_round_test.cpp pixmap_io.o -o one_round_test -std=c++11
18 /*#include <cryptopp/hex.h>
19 #include <cryptopp/sha.h>
20 #include <cryptopp/osrng.h>
21 #include <cryptopp/secblock.h>
26 int load_RGB_pixmap(char *filename, int *width, int *height, unsigned char**R_data, unsigned char**G_data, unsigned char**B_data);
27 void store_RGB_pixmap(char *filename, unsigned char *R_data, unsigned char *G_data, unsigned char *B_data, int width, int height);
31 //using namespace CryptoPP;
45 typedef unsigned char uchar;
50 struct timeval tstart;
51 gettimeofday(&tstart,0);
52 return( (double) (tstart.tv_sec + tstart.tv_usec*1e-6) );
55 double TimeStop(double t)
59 gettimeofday(&tend,0);
60 t = (double) (tend.tv_sec + tend.tv_usec*1e-6) - t;
69 void inverse_tables(uchar *tab, int size_tab,uchar *inv_perm_tabs) {
71 for(int i=0;i<size_tab;i++) {
72 inv_perm_tabs[tab[i]] = i;
77 void inverse_tables_int(int *tab, int size_tab,int *inv_perm_tabs) {
79 for(int i=0;i<size_tab;i++) {
80 inv_perm_tabs[tab[i]] = i;
87 void rc4key(uchar *key, uchar *sc, int size_DK) {
89 for(int i=0;i<256;i++) {
95 for(int i0=0; i0<256; i0++) {
96 j0 = (j0 + sc[i0] + key[i0%size_DK] )&0xFF;
105 void rc4keyperm(uchar *key,int len, int rp,int *sc, int size_DK) {
111 for (int i=0;i<len;i++) {
114 for (int it = 0; it < rp; it++) {
116 for(int i0 = 0; i0<len; i0++) {
117 j0 = (j0 + sc[i0] + sc[j0] + key[i0%size_DK] )% len;
126 void prga(uchar *sc, int ldata, uchar *r) {
130 for (int it=0; it<ldata; it++) {
131 i0 = ((i0+1)&0xFE); //%255);
132 j0 = (j0 + sc[i0])&0xFF;
136 r[it]=sc[(sc[i0]+sc[j0])&0xFF];
140 inline uchar circ(uchar x,int n) {return (x << n) | (x >> (8 - n));}
142 void diff(uchar *Y, uchar *X, int h) {
145 Y[0] = X[1]^X[2]^X[3];
146 Y[1] = X[0]^X[2]^X[3];
147 Y[2] = X[0]^X[1]^X[3];
148 Y[3] = X[0]^X[1]^X[2];
151 /*Y[0] = X[0]^X[2]^X[3]^X[5]^X[6]^X[7];
152 Y[1] = X[0]^X[1]^X[3]^X[4]^X[6]^X[7];
153 Y[2] = X[0]^X[1]^X[2]^X[4]^X[5]^X[7];
154 Y[3] = X[1]^X[2]^X[3]^X[4]^X[5]^X[6];
155 Y[4] = X[0]^X[1]^X[5]^X[6]^X[7];
156 Y[5] = X[1]^X[2]^X[4]^X[6]^X[7];
157 Y[6] = X[2]^X[3]^X[4]^X[5]^X[7];
158 Y[7] = X[0]^X[3]^X[4]^X[5]^X[6];
171 Y[0] = X0^X2^X3^X5^X6^X7;
172 Y[1] = X0^X1^X3^X4^X6^X7;
173 Y[2] = X0^X1^X2^X4^X5^X7;
174 Y[3] = X1^X2^X3^X4^X5^X6;
175 Y[4] = X0^X1^X5^X6^X7;
176 Y[5] = X1^X2^X4^X6^X7;
177 Y[6] = X2^X3^X4^X5^X7;
178 Y[7] = X0^X3^X4^X5^X6;
184 Y[0] = X[3] ^ X[4] ^ X[6] ^ X[8] ^ X[9] ^ X[13] ^ X[14];
185 Y[1] = X[2] ^ X[5] ^ X[7] ^ X[8] ^ X[9] ^ X[12] ^ X[15];
186 Y[2] = X[1] ^ X[4] ^ X[6] ^ X[10] ^ X[11] ^ X[12] ^ X[15];
187 Y[3] = X[0] ^ X[5] ^ X[7] ^ X[10] ^ X[11] ^ X[13] ^ X[14];
188 Y[4] = X[0] ^ X[2] ^ X[5] ^ X[8] ^ X[11] ^ X[14] ^ X[15];
189 Y[5] = X[1] ^ X[3] ^ X[4] ^ X[9] ^ X[10] ^ X[14] ^ X[15];
190 Y[6] = X[0] ^ X[2] ^ X[7] ^ X[9] ^ X[10] ^ X[12] ^ X[13];
191 Y[7] = X[1] ^ X[3] ^ X[6] ^ X[8] ^ X[11] ^ X[12] ^ X[13];
192 Y[8] = X[0] ^ X[1] ^ X[4] ^ X[7] ^ X[10] ^ X[13] ^ X[15];
193 Y[9] = X[0] ^ X[1] ^ X[5] ^ X[6] ^ X[11] ^ X[12] ^ X[14];
194 Y[10] = X[2] ^ X[3] ^ X[5] ^ X[6] ^ X[8] ^ X[13] ^ X[15];
195 Y[11] = X[2] ^ X[3] ^ X[4] ^ X[7] ^ X[9] ^ X[12] ^ X[14];
196 Y[12] = X[1] ^ X[2] ^ X[6] ^ X[7] ^ X[9] ^ X[11] ^ X[12];
197 Y[13] = X[0] ^ X[3] ^ X[6] ^ X[7] ^ X[8] ^ X[10] ^ X[13];
198 Y[14] = X[0] ^ X[3] ^ X[4] ^ X[5] ^ X[9] ^ X[11] ^ X[14];
199 Y[15] = X[1] ^ X[2] ^ X[4] ^ X[5] ^ X[8] ^ X[10] ^ X[15];
220 Y[0] = X3 ^ X4 ^ X6 ^ X8 ^ X9 ^ X13 ^ X14;
221 Y[1] = X2 ^ X5 ^ X7 ^ X8 ^ X9 ^ X12 ^ X15;
222 Y[2] = X1 ^ X4 ^ X6 ^ X10 ^ X11 ^ X12 ^ X15;
223 Y[3] = X0 ^ X5 ^ X7 ^ X10 ^ X11 ^ X13 ^ X14;
224 Y[4] = X0 ^ X2 ^ X5 ^ X8 ^ X11 ^ X14 ^ X15;
225 Y[5] = X1 ^ X3 ^ X4 ^ X9 ^ X10 ^ X14 ^ X15;
226 Y[6] = X0 ^ X2 ^ X7 ^ X9 ^ X10 ^ X12 ^ X13;
227 Y[7] = X1 ^ X3 ^ X6 ^ X8 ^ X11 ^ X12 ^ X13;
228 Y[8] = X0 ^ X1 ^ X4 ^ X7 ^ X10 ^ X13 ^ X15;
229 Y[9] = X0 ^ X1 ^ X5 ^ X6 ^ X11 ^ X12 ^ X14;
230 Y[10] = X2 ^ X3 ^ X5 ^ X6 ^ X8 ^ X13 ^ X15;
231 Y[11] = X2 ^ X3 ^ X4 ^ X7 ^ X9 ^ X12 ^ X14;
232 Y[12] = X1 ^ X2 ^ X6 ^ X7 ^ X9 ^ X11 ^ X12;
233 Y[13] = X0 ^ X3 ^ X6 ^ X7 ^ X8 ^ X10 ^ X13;
234 Y[14] = X0 ^ X3 ^ X4 ^ X5 ^ X9 ^ X11 ^ X14;
235 Y[15] = X1 ^ X2 ^ X4 ^ X5 ^ X8 ^ X10 ^ X15;
243 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];
244 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];
245 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];
246 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];
247 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];
248 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];
249 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];
250 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];
251 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];
252 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];
253 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];
254 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];
255 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];
256 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];
257 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];
258 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];
259 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];
260 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];
261 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];
262 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];
263 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];
264 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];
265 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];
266 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];
267 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];
268 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];
269 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];
270 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];
271 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];
272 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];
273 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];
274 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];
311 Y[0]=X0^X1^X2^X3^X4^X7^X8^X10^X12^X15^X16^X17^X18^X20^X21^X24^X25^X28^X30;
312 Y[1]=X0^ X1^X2^X3^X5^X6^X9^X11^X13^X14^X16^X17^X19^X20^X21^ X24^X25^X29^X31;
313 Y[2]=X0^X1^X2^X3^X5^X6^X8^X10^X13^X14^X16^X18^X19^X22^X23^X26^X27^X28^X30;
314 Y[3]=X0^X1^X2^X3^X4^X7^X9^X11^X12^X15^X17^X18^X19^X22^X23^X26^X27^X29^X31;
315 Y[4]=X0^X3^X5^X6^X7^X10^X11^ X12^X13^X14^ X15^X16^X19^X21^X23^ X25^X27^X30^X31;
316 Y[5]=X1^X2^X4^X6^X7^X10^X11^X12^X13^X14^X16 ^X17^X18^X20^X22^X24^X26^X30^X31;
317 Y[6]=X1^X2^X4^X5^X7^X8^X9^X12^X13^X14^X15^ X17^X18^X21^X23^X25^X27^X28^X29;
318 Y[7]=X0^X3^X4^X5^X6^X9 ^X9^X12^X13^X14^X15^X16^X19^X20^X22^X24^X26^X28^X29;
319 Y[8]=X0^X2^X6^X7^X8^X10^X11^X14^X15^X16^X18^X21^X22^X25^X26;
320 Y[9]=X1^ X3^X6^X7^X9^X10^X11^X14^X15^X17^X19^X20^X23^X24^X27;
321 Y[10]=X0^X2^X4^X5^X8^X9^X10^X12^X13^X16^X18^X20^X23^ X24^X27;
322 Y[11]=X1^X3^X4^X5^X8^X9^X11^X12^X13^X17^X19^X21^X22^X25^X26;
323 Y[12]=X0^X3^X4^X5^X6^X7^X10^X11^X13^X14^X15^X16^X19^X21^X23^X25^X27^X30^X31;
324 Y[13]=X1^X2^X4^X5^X6^X7^X10^X11^X12^X14^X15^X17^ X18^X20^X22^X24^X26^X30^X31;
325 Y[14]=X1^X2^X4^X5^X6^X7^X8^X9^X12^X13^X15^X17^X18^X21^X23^X25^X27^X28^X29;
326 Y[15]=X0^X3^X4^X5^X6^X7^X8^X9^X12^X13^X14^X16^X19^X20^X22^ X24^X26^X28^X29;
327 Y[16]=X0^X1^X2^X4^X8 ^X8^X10^X13 ^X15^X16^X17^X18^X19^X20^X21^X24^X25^X28^X30;
328 Y[17]=X0^X1^X3^X5^X6^X9^X11^X13^X14^X16^X17^X18^X19^X20^X21^X24^X25^X29^X31;
329 Y[18]=X0^X2^X3^X5^X6^X8^X10^X13^X14^X16^X17^X18^X19^X22^X23^X26^X27^X28^X30;
330 Y[19]=X1^X2^X3^X4^X7^X9^X11^X12^X15^X16^X17^X18^X19^X22^X23^X26^X28 ^X29^X31;
331 Y[20]=X0^X1^X5^X7^X10 ^X10^X13^X15^X16^X17^X20^X21^X23^X29^X30;
332 Y[21]=X0^X1^X4^X6^X8^X11^X12^X14^X16^X17^X20^X21^X22^X28^X31;
333 Y[22]=X2^X3^X5^X7^X8^X11^X13^X15^X18^X19^X21^X22^X23^X28^X31;
334 Y[23]=X2^X3^X4^X6^X9^X10^X12^X14^ X18^X19^X20^X22^X23^X29^X30;
335 Y[24]=X0^X1^X5^X7^X9^X10^X13^X15^X16^X17^X24^X25^X27^X29^X30;
336 Y[25]=X0^X1^X4^X6^X8^X11^X12^X14^X16^X17^X24^X25^X26^X28^X31;
337 Y[26]=X2^X3^X5^X7^X8^X11^X13^X15^X18^X19^X25^X26^X27^X28^ X31;
338 Y[27]=X2^X3^X4^X6^X9^X10^X12^X14^X18^X19^X24^X26^X27^X29^X30;
339 Y[28]=X0^X2^X6^X7^X14^X15^X16^X18^X21^X22^X25^X26^X28^X30^X31;
340 Y[29]=X2^X3^X6^X7^X14^X15^X17^X19^X20^X23^X24^X27^X29^X30^X31;
341 Y[30]=X1^X2^X4^X5^X12^X13^X16^X18^X20^X23^X24^X27^X28^X29^X30;
342 Y[31]=X2^X3^X4^X5^X12^X13^X17^X19^X21^X22^X25^X26^X28^X29^X31;
352 //the proposed hash function, which is based on DSD structure. Sensitivity is ensured by employing the binary diffusion
354 void hash_DSD_BIN(uchar* seq_in, uchar* RM1,int len, int *PboxRM, uchar *Sbox1, int h) {
357 // Goal: Calculate the hash value
358 // Output: RM (hash value)
360 // uchar *X=new uchar[h2];
361 // uchar *fX=new uchar[h2];
368 for(int it=0;it<len;it++) {
372 // Mix with dynamic RM
374 for(int a=0;a<h;a+=4) {
375 fX[a]=RM1[a]^seq_in[ind2+a];
376 fX[a+1]=RM1[a+1]^seq_in[ind2+a+1];
377 fX[a+2]=RM1[a+2]^seq_in[ind2+a+2];
378 fX[a+3]=RM1[a+3]^seq_in[ind2+a+3];
381 // First Diffusion Operation
385 // Substitution Operation
386 for(int a=0;a<h;a+=4) {
387 fX[a]=Sbox1[fX2[a]]; //Warning according to the size of h2, we can be outsize of Sbox1[a]
388 fX[a+1]=Sbox1[fX2[a+1]];
389 fX[a+2]=Sbox1[fX2[a+2]];
390 fX[a+3]=Sbox1[fX2[a+3]];
393 // Second Diffusion Operation
395 /*for(int a=0;a<h;a+=4) {
397 fX2[a+1]=circ(X[a+1],5);
398 fX2[a+2]=circ(X[a+2],1);
399 fX2[a+3]=circ(X[a+3],6);
404 // update RM and mix it with hashed block
405 for(int a=0;a<h;a+=4) {
406 RM1[a]=fX2[a]^RM1[PboxRM[a]];
407 RM1[a+1]=fX2[a+1]^RM1[PboxRM[a+1]];
408 RM1[a+2]=fX2[a+2]^RM1[PboxRM[a+2]];
409 RM1[a+3]=fX2[a+3]^RM1[PboxRM[a+3]];
412 for(int a=0;a<h;a+=4) {
413 RM1[a]=RM1[PboxRM[a]];
414 RM1[a+1]=RM1[PboxRM[a+1]];
415 RM1[a+2]=RM1[PboxRM[a+2]];
416 RM1[a+3]=RM1[PboxRM[a+3]];
419 for(int a=0;a<h;a+=4) {
420 RM1[a]=fX2[a]^RM1[a];
421 RM1[a+1]=fX2[a+1]^RM1[a+1];
422 RM1[a+2]=fX2[a+2]^RM1[a+2];
423 RM1[a+3]=fX2[a+3]^RM1[a+3];
443 int main(int argc, char** argv) {
452 for(int i=1; i<argc; i++){
453 if(strncmp(argv[i],"nb",2)==0) nb_test = atoi(&(argv[i][2])); //nb of test
454 if(strncmp(argv[i],"ctr",3)==0) ctr = atoi(&(argv[i][3])); //CTR ? 1 otherwise CBC like
455 if(strncmp(argv[i],"h",1)==0) h = atoi(&(argv[i][1])); //size of block
456 if(strncmp(argv[i],"sizebuf",7)==0) size_buf = atoi(&(argv[i][7])); //SIZE of the buffer
457 if(strncmp(argv[i],"lena",4)==0) lena = atoi(&(argv[i][4])); //Use Lena or buffer
458 if(strncmp(argv[i],"c",1)==0) change = atoi(&(argv[i][1])); //Use Lena or buffer
462 cout<<size_buf<<endl;
468 uchar Secretkey[key_size];
470 uchar counter[key_size];
472 for(int i=0;i<key_size;i++) {
473 Secretkey[i]=lrand48()&0xFF;
474 counter[i]=lrand48()&0xFF;
487 uchar *data_R, *data_G, *data_B;
492 load_RGB_pixmap("lena.ppm", &width, &height, &data_R, &data_G, &data_B);
493 imsize=width*height*3;
494 // load_RGB_pixmap("No_ecb_mode_picture.ppm", &width, &height, &data_R, &data_G, &data_B);
498 buffer=new uchar[imsize];
499 for(int i=0;i<imsize;i++) {
507 uchar* seq= new uchar[imsize];
508 uchar* seq2= new uchar[imsize];
513 for(int i=0;i<oneD;i++) {
515 seq[oneD+i]=data_G[i];
516 seq[2*oneD+i]=data_B[i];
521 for(int i=0;i<oneD;i++) {
539 int total_len=imsize;
541 int len= total_len/h;
545 uchar *mix=new uchar[256];
550 for (int i = 0; i < 256 ; i++) {
551 mix[i]=Secretkey[i]^counter[i];
555 // cout<<"hash "<<endl;
556 for (int i = 0; i < 64 ; i++) {
564 int *PboxRM=new int[h];
574 double t=TimeStart();
575 rc4key(DK, Sbox1, 8);
578 rc4key(&DK[8], sc, 8);
585 rc4keyperm(&DK[16], h, rp, PboxRM, 8);
588 cout<<"Time initializaton "<<time<<endl;
600 for(int i=0;i<h;i++){
604 cout<<"imsize "<<imsize<<endl;
606 /* for(int i=0;i<imsize;i++){
607 cout<<(int)seq[i]<<" ";
614 for(int i=0;i<nb_test;i++)
616 hash_DSD_BIN(seq, RM1,len,PboxRM,Sbox1,h);
623 cout<<"Hash Time "<<time<<endl;
624 cout<<(double)imsize*nb_test/time<<"\t";
626 for(int i=0;i<h;i++){
627 cout<<(int)RM1[i]<<" ";