X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/Cipher_code.git/blobdiff_plain/a3e6fe442440811ebd5f7288bf01d9782f3a7ea7..2cb56ac774844914304d141d67b1a94f34a0739a:/OneRoundIoT/OneRound/rc4_hash2.cpp?ds=sidebyside diff --git a/OneRoundIoT/OneRound/rc4_hash2.cpp b/OneRoundIoT/OneRound/rc4_hash2.cpp index 013d657..386ddf7 100644 --- a/OneRoundIoT/OneRound/rc4_hash2.cpp +++ b/OneRoundIoT/OneRound/rc4_hash2.cpp @@ -168,46 +168,35 @@ void hash_DSD_BIN(uchar* seq_in, uchar* RM1,int len, uchar *S, int h) { // Goal: Calculate the hash value // Output: RM (hash value) - -// uchar *X=new uchar[h2]; -// uchar *fX=new uchar[h2]; uchar X[h]; int ind1,ind2; 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; for(int it=0;it>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]); } @@ -309,10 +298,12 @@ int main(int argc, char** argv) { if(change==1) { seq[4]++; + seq[5]--; } if(change==2) { seq[9]++; + seq[10]--; } printf("seq 4 %d\n",seq[4]);