From 8a13d49e7c75bb6aded0b7e038d4d8513d6c47cb Mon Sep 17 00:00:00 2001
From: =?utf8?q?Rapha=C3=ABl=20Couturier?= <raphael.couturier@univ-fcomte.fr>
Date: Sun, 1 Mar 2020 14:45:09 +0100
Subject: [PATCH 1/1] new

---
 OneRoundIoT/OneRound/rc4_hash3.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/OneRoundIoT/OneRound/rc4_hash3.cpp b/OneRoundIoT/OneRound/rc4_hash3.cpp
index de5b40c..243fc1e 100644
--- a/OneRoundIoT/OneRound/rc4_hash3.cpp
+++ b/OneRoundIoT/OneRound/rc4_hash3.cpp
@@ -182,14 +182,14 @@ void hash_DSD_BIN(uchar* seq_in, uchar* RM1,int len, uchar *S, int h) {
   
   for(int it=0;it<len;it++) {
     // Mix with dynamic RM
-    rm[0]=rm[0]^ss[ind1];
+    rm[0]=rm[h-1]^ss[ind1];
     rm[0]=xorshift64(rm[0] );
     for(a=1;a<h;a++) {
-      rm[a]=rm[a]^ss[ind1+a];
-      rm[a]=xorshift64(rm[a] ^ rm[a-1]);
+      rm[a]=rm[a-1]^ss[ind1+a];
+      rm[a]=xorshift64(rm[a]);
     }
     //    printf("argh %d\n",a);
-    rm[0]=xorshift64(rm[a-1]);
+    //rm[0]=xorshift64(rm[a-1]);
 
 
     ind1+=h;
-- 
2.39.5