]> AND Private Git Repository - Cipher_code.git/blobdiff - OneRoundIoT/OneRound/one_round_hash_new.cpp
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
correction
[Cipher_code.git] / OneRoundIoT / OneRound / one_round_hash_new.cpp
index fbb517f053f291e54dccc1a584ff4e8374effb11..a72d301ec98184bfd327d62bb05e4bc958aa330e 100644 (file)
@@ -186,33 +186,42 @@ void hash_DSD_BIN(uchar* seq_in, uchar* RM1,int len, int *PboxRM, uchar *Sbox1,
 
     for(int a=0;a<h;a+=4) {
       Y[a]=Sbox1[Y[a]];
-      //Y[a]=circ(Y[a],3);
+      Y[a+1]=Sbox1[Y[a+1]];
+      Y[a+2]=Sbox1[Y[a+2]];
+      Y[a+3]=Sbox1[Y[a+3]];
     }
+  
+
+
+    
     
     Z[h-1]=Y[h-1]^Y[0];
     for(int a=h-1;a>0;a--) {
       Z[a-1]=Z[a]^Y[a];
     }
 
-    for(int a=0;a<h;a+=4) {
+    /*  for(int a=0;a<h;a+=4) {
       Z[a]=Sbox2[Z[a]];
-      //Z[a]=circ(Z[a],7);
-    }
+      Z[a+1]=Sbox2[Z[a+1]];
+      Z[a+2]=Sbox2[Z[a+2]];
+      Z[a+3]=Sbox2[Z[a+3]];
+
+      }*/
 
     
     
     for(int a=0;a<h;a+=4) {
-      /*     RM1[a]=Z[a];
+      RM1[a]=Z[a];
       RM1[a+1]=Z[a+1];
       RM1[a+2]=Z[a+2];
       RM1[a+3]=Z[a+3];
-      */
-
+      
+/*
       RM1[a]=Z[a]^RM1[PboxRM[a]];
       RM1[a+1]=Z[a+1]^RM1[PboxRM[a+1]];
       RM1[a+2]=Z[a+2]^RM1[PboxRM[a+2]];
       RM1[a+3]=Z[a+3]^RM1[PboxRM[a+3]];
-      
+*/    
     }
     
   }