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

Private GIT Repository
new
[Cipher_code.git] / OneRoundIoT / NEW / scprng.cpp
index 884036454b060689f9b2786526b55efd95db5883..3b2eb6bfee2dc53740f36a4c95c8a7e856230a26 100644 (file)
@@ -202,11 +202,17 @@ void scprng(uint64_t *plain, uint64_t* cipher, int bufsize, int nb_bloc, uint64_
     for(int j=0;j<bufsize;j++) {
       //Val[j]=splitmix64_stateless(Val[j])^Val[Pbox[j]];
       //Val[j]=xorshift64(Val[j])^Val[Pbox[j]];  //fail
     for(int j=0;j<bufsize;j++) {
       //Val[j]=splitmix64_stateless(Val[j])^Val[Pbox[j]];
       //Val[j]=xorshift64(Val[j])^Val[Pbox[j]];  //fail
-      Val[j]=xorshift64(Val[j])^Val[Pbox[j]]^Val[Pbox2[j]];  
+//      Val[j]=xorshift64(Val[j])^Val[Pbox[j]]^Val[Pbox2[j]];
+      Val[j]=xorshift64(Val[j]);
+      
       //Val[j]=xoroshiro128plus(&xoro[j])^Val[Pbox[j]];
       //Val[j]=jsf(&ctx[j])^Val[Pbox[j]];  //good
       //Val[j]=sfc(&sfcd[j])^Val[Pbox[j]];  //good
     }
       //Val[j]=xoroshiro128plus(&xoro[j])^Val[Pbox[j]];
       //Val[j]=jsf(&ctx[j])^Val[Pbox[j]];  //good
       //Val[j]=sfc(&sfcd[j])^Val[Pbox[j]];  //good
     }
+    for(int j=0;j<bufsize;j++) {
+      Val[j]=Val[j]^Val[Pbox[j]]^Val[Pbox2[j]];
+    }
+
     
     for(int j=0;j<bufsize;j++) {
       cipher[nb*bufsize+j]=Val[j]^plain[nb*bufsize+j];
     
     for(int j=0;j<bufsize;j++) {
       cipher[nb*bufsize+j]=Val[j]^plain[nb*bufsize+j];