int key_size=256;
int nb_test=1;
int ctr=0;
+int h=64;
-const int h=16;
-const int h2=h*h;
+
+int h2=h*h;
for(int i=1; i<argc; i++){
if(strncmp(argv[i],"nb",2)==0) nb_test = atoi(&(argv[i][2])); //nb of test
if(strncmp(argv[i],"ctr",3)==0) ctr = atoi(&(argv[i][3])); //CTR ? 1 otherwise CBC like
+ if(strncmp(argv[i],"h",1)==0) h = atoi(&(argv[i][1])); //CTR ? 1 otherwise CBC like
}
printf("nb times %d\n",nb_test);
printf("ctr %d\n",ctr);
+ printf("h %d\n",h);
+
+ h2=h*h;
/*
if(argc==2)
int i;
for(i=0;i<nb_test;i++)
{
-// encrypt(seq, seq2,len,RM1,Pbox,PboxRM,Sbox1,Sbox2,0);
- encrypt_ctr(seq, seq2,len,RM1,Pbox,PboxRM,Sbox1,Sbox2,1);
+ if(ctr)
+ encrypt_ctr(seq, seq2,len,RM1,Pbox,PboxRM,Sbox1,Sbox2,1);
+ else
+ encrypt(seq, seq2,len,RM1,Pbox,PboxRM,Sbox1,Sbox2,0);
+
}
time+=TimeStop(t);
time=0;
t=TimeStart();
for(i=0;i<nb_test;i++) {
-// decrypt(seq2,seq,len,RM2,Pbox,PboxRM,Sbox1,Sbox2,0);
- encrypt_ctr(seq2, seq,len,RM2,Pbox,PboxRM,Sbox1,Sbox2,0);
+ if(ctr)
+ encrypt_ctr(seq2, seq,len,RM2,Pbox,PboxRM,Sbox1,Sbox2,0);
+ else
+ decrypt(seq2,seq,len,RM2,Pbox,PboxRM,Sbox1,Sbox2,0);
+
}
time+=TimeStop(t);