}
else {
width=height=size_buf;
- imsize=width*height;
+ imsize=width*height*3;
//cout<<"imsize "<<imsize<<endl;
buffer=new uchar[imsize];
for(int i=0;i<imsize;i++) {
-
+ cout<<"imsize "<<imsize<<endl;
uchar* seq= new uchar[imsize];
uchar* seq2= new uchar[imsize];
}
}
else {
- for(int i=0;i<oneD;i++) {
+ for(int i=0;i<oneD*3;i++) {
seq[i]=buffer[i];
}
}
double t=TimeStart();
- rc4key(DK, Sbox1, 8);
-
-
- rc4key(&DK[8], Sbox2, 8);
-
- rc4key(&DK[16], sc, 16);
- prga(sc, h*h*2+256, RM);
+ for(int i=0;i<nb_test;i++) {
-
-
-
- rc4keyperm(&DK[72], len, rp, Pbox, 16);
+ rc4key(DK, Sbox1, 8);
- rc4keyperm(&DK[88], len/2, rp, PboxSRM2, 16);
+ rc4key(&DK[8], Sbox2, 8);
+
+ rc4key(&DK[16], sc, 16);
+ prga(sc, h*h*2+256, RM);
+
+
- for(int i=0;i<len/2;i++) {
- PboxSRM[i]=PboxSRM2[i]&(h-1);
- }
+
+ rc4keyperm(&DK[72], len, rp, Pbox, 16);
+
+
+ rc4keyperm(&DK[88], len/2, rp, PboxSRM2, 16);
+
+ for(int i=0;i<len/2;i++) {
+ PboxSRM[i]=PboxSRM2[i]&(h-1);
+ }
+
/*
for(int i=0;i<h*2;i++) {
for(int j=0;j<h;j++)
cout<<endl;
}
*/
+ }
-
-
- //time+=TimeStop(t);
- //cout<<"Time initializaton "<<time<<endl;
+ double time_init=0;
+ time_init+=TimeStop(t);
+ cout<<"Time initializaton nb times "<<nb_test<<" = "<<time_init<<endl;
time_encrypt+=TimeStop(t);
- //cout<<"Time encrypt "<<
+ cout<<"Time encrypt "<<time_encrypt<<endl;
cout<<(double)imsize*nb_test/time_encrypt<<"\t";