X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/Cipher_code.git/blobdiff_plain/a3e6fe442440811ebd5f7288bf01d9782f3a7ea7..54769a8ee0ec8e6038b44fdbf9656585e7d3e31c:/OneRoundIoT/OneRound/rc4_hash2.cpp?ds=inline diff --git a/OneRoundIoT/OneRound/rc4_hash2.cpp b/OneRoundIoT/OneRound/rc4_hash2.cpp index 013d657..10f9823 100644 --- a/OneRoundIoT/OneRound/rc4_hash2.cpp +++ b/OneRoundIoT/OneRound/rc4_hash2.cpp @@ -176,7 +176,7 @@ void hash_DSD_BIN(uchar* seq_in, uchar* RM1,int len, uchar *S, int h) { uint64_t *rm=(uint64_t*)RM1; - uint64_t *xx=(uint64_t*)X; + // uint64_t *xx=(uint64_t*)X; uint64_t *ss=(uint64_t*)seq_in; @@ -185,29 +185,23 @@ void hash_DSD_BIN(uchar* seq_in, uchar* RM1,int len, uchar *S, int h) { //ind1=Pbox[it]*h; //ind2=Pbox[(it+len/2)]*h; - ind1=it*h/8; + ind1=(it*h)>>3; // Mix with dynamic RM uint64_t sum=0; - /* for(int a=0;a>3);a++) { + rm[a]=rm[a]^ss[ind1+a]; + sum+=rm[a]; } rm[0]=xorshift64(sum); - for(int a=1;a>3);a++) { rm[a]^=xorshift64(rm[a-1]); + //rm[a]^=splitmix64(rm[a-1]); }