X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/Cipher_code.git/blobdiff_plain/f49f8917e590f55bb5f21c8220ff517c19588aa6..6f0f24afe704f7af545d4bfc470232e92d7d7945:/OneRoundIoT/OneRound/one_round_hash.cpp?ds=sidebyside

diff --git a/OneRoundIoT/OneRound/one_round_hash.cpp b/OneRoundIoT/OneRound/one_round_hash.cpp
index 373892c..9733449 100644
--- a/OneRoundIoT/OneRound/one_round_hash.cpp
+++ b/OneRoundIoT/OneRound/one_round_hash.cpp
@@ -12,6 +12,8 @@
 #include<string.h>
 #include <fstream>
 #include <sys/time.h>
+#include <glib.h>
+
 
 /*#include <cryptopp/hex.h>
 #include <cryptopp/sha.h>
@@ -126,7 +128,7 @@ void prga(uchar *sc, int ldata, uchar *r) {
   uchar j0=0;
 
   for (int it=0; it<ldata; it++) {
-    i0 = ((i0+1)&0xFE); //%255);
+    i0 = ((i0+1)%255);
     j0 = (j0 + sc[i0])&0xFF;
     uchar tmp = sc[i0];
     sc[i0] = sc[j0];