From: couturie <couturie@extinction>
Date: Fri, 18 Aug 2017 14:09:50 +0000 (+0200)
Subject: new
X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/Cipher_code.git/commitdiff_plain/ca940d4b9b6ef86858b8c2e8dcffce5602cbbbae?ds=sidebyside

new
---

diff --git a/OneRoundIoT/OneRound/one_round_new.cpp b/OneRoundIoT/OneRound/one_round_new.cpp
index 6d9f431..de1b0d2 100644
--- a/OneRoundIoT/OneRound/one_round_new.cpp
+++ b/OneRoundIoT/OneRound/one_round_new.cpp
@@ -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);