From 05585a79ffb5b7fff73a9e201706f94bbdd4a9f2 Mon Sep 17 00:00:00 2001
From: =?utf8?q?Rapha=C3=ABl=20Couturier?= <raphael.couturier@univ-fcomte.fr>
Date: Sun, 15 Aug 2021 21:10:17 +0200
Subject: [PATCH] new

---
 OneRoundHash/oneroundhash.cpp | 82 +++++++++++++++++++++++++----------
 1 file changed, 60 insertions(+), 22 deletions(-)

diff --git a/OneRoundHash/oneroundhash.cpp b/OneRoundHash/oneroundhash.cpp
index 4365439..864961d 100644
--- a/OneRoundHash/oneroundhash.cpp
+++ b/OneRoundHash/oneroundhash.cpp
@@ -1085,19 +1085,22 @@ int main(int argc, char** argv) {
 
   int i;
   switch(h) {
-    /*  case 16: 
+
+  case 16: 
     for(i=0;i<nb_test;i++)
     {
-      if(cbcprng)
-	encrypt_cbc_prng<16>(seq, seq2,len,RM,Pbox,PboxSRM,Sbox1,Sbox2,IV,myrand,0);
-      if(cbcrm)
-	encrypt_cbc_rm<16>(seq, seq2,len,RM,Pbox,PboxSRM,Sbox1,Sbox2,IV,0);
-      if(ecbrm)
-	encrypt_ecb_rm<16>(seq, seq2,len,RM,Pbox,PboxSRM,Sbox1,Sbox2,IV,0);
-      if(ecbprng)
-	encrypt_ecb_prng<16>(seq, seq2,len,RM,Pbox,PboxSRM,Sbox1,Sbox2,IV,myrand,0);
-    }
-    break;*/
+      if(v1b)
+	encrypt_authenticate_algorithm<16>(seq, seq2, len, RM, Pbox, PboxSRM, Sbox1, Sbox2, IV1, MAC, myrand);
+      if(v2b1)
+	encrypt_authenticate_algorithm_2Blocks<16>(seq, seq2,len,RM,Pbox,PboxSRM,Sbox1,Sbox2,IV1,IV2,MAC,myrand);
+      if(v2b2)
+	encrypt_authenticate_algorithm_2Blocks_V2<16>(seq, seq2,len,RM,Pbox,PboxSRM,Sbox1,Sbox2,IV1,IV2,MAC,myrand);
+      if(v2b3)
+	encrypt_authenticate_algorithm_2Blocks_V3<16>(seq, seq2,len,RM,Pbox,PboxSRM,Sbox1,Sbox2,IV1,MAC,myrand);
+    }
+    break;
+
+    
   case 32: 
     for(i=0;i<nb_test;i++)
     {
@@ -1111,6 +1114,23 @@ int main(int argc, char** argv) {
 	encrypt_authenticate_algorithm_2Blocks_V3<32>(seq, seq2,len,RM,Pbox,PboxSRM,Sbox1,Sbox2,IV1,MAC,myrand);
     }
     break;
+
+  case 64: 
+    for(i=0;i<nb_test;i++)
+    {
+      if(v1b)
+	encrypt_authenticate_algorithm<64>(seq, seq2, len, RM, Pbox, PboxSRM, Sbox1, Sbox2, IV1, MAC, myrand);
+      if(v2b1)
+	encrypt_authenticate_algorithm_2Blocks<64>(seq, seq2,len,RM,Pbox,PboxSRM,Sbox1,Sbox2,IV1,IV2,MAC,myrand);
+      if(v2b2)
+	encrypt_authenticate_algorithm_2Blocks_V2<64>(seq, seq2,len,RM,Pbox,PboxSRM,Sbox1,Sbox2,IV1,IV2,MAC,myrand);
+      if(v2b3)
+	encrypt_authenticate_algorithm_2Blocks_V3<64>(seq, seq2,len,RM,Pbox,PboxSRM,Sbox1,Sbox2,IV1,MAC,myrand);
+    }
+    break;
+
+
+
   }
 
 
@@ -1144,18 +1164,19 @@ int main(int argc, char** argv) {
   time_decrypt=0;
   t=TimeStart();
   switch(h) {
-    /*  case 16:
+  case 16:
     for(i=0;i<nb_test;i++) {
-      if(cbcprng)
-	decrypt_cbc_prng<16>(seq2,seq,len,RM,Pbox,PboxSRM,Sbox1,Sbox2,Inv_Sbox1,Inv_Sbox2,IV,myrand,0);
-      if(cbcrm)
-	decrypt_cbc_rm<16>(seq2,seq,len,RM,Pbox,PboxSRM,Sbox1,Sbox2,Inv_Sbox1,Inv_Sbox2,IV,0);
-      if(ecbrm)
-	decrypt_ecb_rm<16>(seq2,seq,len,RM,Pbox,PboxSRM,Sbox1,Sbox2,Inv_Sbox1,Inv_Sbox2,IV,0);
-      if(ecbprng)
-	decrypt_ecb_prng<16>(seq2,seq,len,RM,Pbox,PboxSRM,Sbox1,Sbox2,Inv_Sbox1,Inv_Sbox2,IV,myrand,0);
-    }
-    break;*/
+      if(v1b)
+	decrypt_authenticate_algorithm<16>(seq2, seq,len,RM,Pbox,PboxSRM,Inv_Sbox1,Inv_Sbox2,Sbox1,Sbox2,IV1,MAC,myrand);
+      if(v2b1)
+	decrypt_authenticate_algorithm_2Blocks<16>(seq2, seq,len,RM,Pbox,PboxSRM,Inv_Sbox1,Inv_Sbox2,Sbox1,Sbox2,IV1,IV2,MAC,myrand);
+      if(v2b2)
+	decrypt_authenticate_algorithm_2Blocks_V2<16>(seq2, seq,len,RM,Pbox,PboxSRM,Inv_Sbox1,Inv_Sbox2,Sbox1,Sbox2,IV1,IV2,MAC,myrand);
+      if(v2b3)
+	decrypt_authenticate_algorithm_2Blocks_V3<16>(seq2, seq,len,RM,Pbox,PboxSRM,Inv_Sbox1,Inv_Sbox2,Sbox1,Sbox2,IV1,MAC,myrand);
+    }
+    break;
+
   case 32:
     for(i=0;i<nb_test;i++) {
       if(v1b)
@@ -1168,6 +1189,23 @@ int main(int argc, char** argv) {
 	decrypt_authenticate_algorithm_2Blocks_V3<32>(seq2, seq,len,RM,Pbox,PboxSRM,Inv_Sbox1,Inv_Sbox2,Sbox1,Sbox2,IV1,MAC,myrand);
     }
     break;
+
+  case 64:
+    for(i=0;i<nb_test;i++) {
+      if(v1b)
+	decrypt_authenticate_algorithm<64>(seq2, seq,len,RM,Pbox,PboxSRM,Inv_Sbox1,Inv_Sbox2,Sbox1,Sbox2,IV1,MAC,myrand);
+      if(v2b1)
+	decrypt_authenticate_algorithm_2Blocks<64>(seq2, seq,len,RM,Pbox,PboxSRM,Inv_Sbox1,Inv_Sbox2,Sbox1,Sbox2,IV1,IV2,MAC,myrand);
+      if(v2b2)
+	decrypt_authenticate_algorithm_2Blocks_V2<64>(seq2, seq,len,RM,Pbox,PboxSRM,Inv_Sbox1,Inv_Sbox2,Sbox1,Sbox2,IV1,IV2,MAC,myrand);
+      if(v2b3)
+	decrypt_authenticate_algorithm_2Blocks_V3<64>(seq2, seq,len,RM,Pbox,PboxSRM,Inv_Sbox1,Inv_Sbox2,Sbox1,Sbox2,IV1,MAC,myrand);
+    }
+    break;
+
+
+
+
   }
 
 
-- 
2.39.5