int key_size=256;
-
+int nb_test=1;
const int h=16;
const int h2=h*h;
for (int i = 48; i < 64; i++)
keyp[i-48] = DK[i];
- cout<<len<<endl;
+// cout<<len<<endl;
int *Pbox=new int[len];
int *PboxRM=new int[h2];
printf("len %d\n",len);
for(int i=0;i<len;i++) {
- printf("%d \n",Pbox[i]);
+// printf("%d \n",Pbox[i]);
}
rc4keyperm(RM2, h2, rp, PboxRM, h2);
double t=TimeStart();
int i;
- for(i=0;i<100;i++)
+ for(i=0;i<nb_test;i++)
{
encrypt(seq, seq2,len,RM1,Pbox,PboxRM,Sbox1,Sbox2,0);
}
time=0;
t=TimeStart();
- for(i=0;i<100;i++) {
+ for(i=0;i<nb_test;i++) {
decrypt(seq2,seq,len,RM2,Pbox,PboxRM,Sbox1,Sbox2,0);
}
-int main() {
+int main(int argc, char** argv) {
cout << "Hello, World!" << endl;
+ if(argc==2)
+ nb_test=atoi(argv[1]);
+ if(nb_test<=0 || nb_test>10000) {
+ printf("nb tests is not correct\n");
+ exit(0);
+ }
+ else
+ printf("nb tests = %d\n\n",nb_test);
int seed=time(NULL);
cout<<seed<<endl;