]> AND Private Git Repository - Cipher_code.git/commitdiff
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
new
authorcouturie <couturie@extinction>
Fri, 18 Aug 2017 14:09:50 +0000 (16:09 +0200)
committercouturie <couturie@extinction>
Fri, 18 Aug 2017 14:09:50 +0000 (16:09 +0200)
OneRoundIoT/OneRound/one_round_new.cpp

index 6d9f431031a209bf115f49f62146ffc8079c9398..de1b0d2c27589c814fddeb6c2e0ca8e56f3a0b42 100644 (file)
@@ -473,8 +473,11 @@ int main(int argc, char** argv) {
   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);
@@ -492,8 +495,11 @@ int main(int argc, char** argv) {
   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);