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

Private GIT Repository
update
[Cipher_code.git] / OneRoundIoT / OneRound / one_round_hash_new3.cpp
index f7c622d2e90887a402b83fe2940f075bc198919d..47052ef02c5b46a6a35bde6dfd2a7b350f45a72f 100644 (file)
@@ -162,14 +162,32 @@ void hash_DSD_BIN(uchar* seq_in, uchar* RM1,int len, int *Pbox,int *PboxRM, ucha
 
 
     // Mix with dynamic RM
+
     
-    for(int a=0;a<h;a+=4) {
+     for(int a=0;a<h;a+=4) {
       RM1[a]=Sbox1[RM1[a]^seq_in[ind1+a]]^seq_in[ind2+a];
       RM1[a+1]=Sbox1[RM1[a+1]^seq_in[ind1+a+1]]^seq_in[ind2+a+1];
       RM1[a+2]=Sbox1[RM1[a+2]^seq_in[ind1+a+2]]^seq_in[ind2+a+2];
       RM1[a+3]=Sbox1[RM1[a+3]^seq_in[ind1+a+3]]^seq_in[ind2+a+3];
     }
+    
+    
+    /*  for(int a=0;a<h;a+=4) {
+      RM1[a]=RM1[a]^seq_in[ind1+a];
+      RM1[a+1]=RM1[a+1]^seq_in[ind1+a+1];
+      RM1[a+2]=RM1[a+2]^seq_in[ind1+a+2];
+      RM1[a+3]=RM1[a+3]^seq_in[ind1+a+3];
+    }
+
+  for(int a=0;a<h;a+=4) {
+      RM1[a]=Sbox1[RM1[a]]^seq_in[ind2+a];
+      RM1[a+1]=Sbox1[RM1[a+1]]^seq_in[ind2+a+1];
+      RM1[a+2]=Sbox1[RM1[a+2]]^seq_in[ind2+a+2];
+      RM1[a+3]=Sbox1[RM1[a+3]]^seq_in[ind2+a+3];
+    }
+    */
 
+    
 
      for(int a=0;a<h;a+=4) {
        RM1[a]=Sbox2[RM1[a]];