From 54ba144ca7fa40eea15a30b68c1987042ed4e4f0 Mon Sep 17 00:00:00 2001 From: couturie <couturie@extinction> Date: Sat, 26 Aug 2017 09:35:30 +0200 Subject: [PATCH 1/1] new --- OneRoundIoT/OneRound/one_round_new.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/OneRoundIoT/OneRound/one_round_new.cpp b/OneRoundIoT/OneRound/one_round_new.cpp index 39def61..d64021d 100644 --- a/OneRoundIoT/OneRound/one_round_new.cpp +++ b/OneRoundIoT/OneRound/one_round_new.cpp @@ -123,7 +123,7 @@ void prga(uchar *sc, int ldata, uchar *r) { uchar j0=0; for (int it=0; it<ldata; it++) { - i0 = ((i0+1)%255); + i0 = ((i0+1)&0xFE); //%255); j0 = (j0 + sc[i0])&0xFF; uchar tmp = sc[i0]; sc[i0] = sc[j0]; @@ -381,18 +381,18 @@ int main(int argc, char** argv) { if(strncmp(argv[i],"lena",4)==0) lena = atoi(&(argv[i][4])); //Use Lena or buffer } - printf("nb times %d\n",nb_test); +/* printf("nb times %d\n",nb_test); printf("ctr %d\n",ctr); printf("h %d\n",h); printf("lena %d\n",lena); printf("size_buf %d\n",size_buf); - +*/ int h2=h*h; int seed=time(NULL); - cout<<seed<<endl; +// cout<<seed<<endl; srand48(seed); uchar Secretkey[key_size]; @@ -473,7 +473,7 @@ int main(int argc, char** argv) { } - cout<<"hash "<<endl; +// cout<<"hash "<<endl; for (int i = 0; i < 64 ; i++) { // DK[i]=digest[i]; DK[i]=mix[i]; @@ -524,7 +524,7 @@ int main(int argc, char** argv) { rc4keyperm(keyp, len, rp, Pbox, 16); - printf("len %d\n",len); +// printf("len %d\n",len); for(int i=0;i<len;i++) { // printf("%d \n",Pbox[i]); } @@ -672,7 +672,7 @@ int main(int argc, char** argv) { equal=false; } } - cout<<"RESULT CORRECT: "<<equal<<endl; +// cout<<"RESULT CORRECT: "<<equal<<endl; } -- 2.39.5