A
lgorithmique
N
umérique
D
istribuée
Private GIT Repository
projects
/
Cipher_code.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
new
[Cipher_code.git]
/
OneRoundIoT
/
OneRound
/
one_round_hash_new2.cpp
diff --git
a/OneRoundIoT/OneRound/one_round_hash_new2.cpp
b/OneRoundIoT/OneRound/one_round_hash_new2.cpp
index 25bcb1770c639a0db67fe7537e11b515b8a9a250..911d7f323dc886a057e2d9efe739629207446ad6 100644
(file)
--- a/
OneRoundIoT/OneRound/one_round_hash_new2.cpp
+++ b/
OneRoundIoT/OneRound/one_round_hash_new2.cpp
@@
-126,7
+126,7
@@
void prga(uchar *sc, int ldata, uchar *r) {
uchar j0=0;
for (int it=0; it<ldata; it++) {
uchar j0=0;
for (int it=0; it<ldata; it++) {
- i0 = ((i0+1)&0xF
E
); //%255);
+ i0 = ((i0+1)&0xF
F
); //%255);
j0 = (j0 + sc[i0])&0xFF;
uchar tmp = sc[i0];
sc[i0] = sc[j0];
j0 = (j0 + sc[i0])&0xFF;
uchar tmp = sc[i0];
sc[i0] = sc[j0];
@@
-212,9
+212,9
@@
int main(int argc, char** argv) {
}
}
- cout<<size_buf<<endl;
- int seed=time(NULL);
- cout<<seed<<endl;
+
//
cout<<size_buf<<endl;
+ int seed=
12;//
time(NULL);
+
//
cout<<seed<<endl;
srand48(seed);
uchar Secretkey[key_size];
srand48(seed);
uchar Secretkey[key_size];
@@
-275,7
+275,7
@@
int main(int argc, char** argv) {
}
}
}
}
- printf("seq 4 %d\n",seq[4]);
+
//
printf("seq 4 %d\n",seq[4]);
if(change==1) {
seq[4]++;
if(change==1) {
seq[4]++;
@@
-285,7
+285,7
@@
int main(int argc, char** argv) {
seq[9]++;
}
seq[9]++;
}
- printf("seq 4 %d\n",seq[4]);
+
//
printf("seq 4 %d\n",seq[4]);
@@
-293,7
+293,7
@@
int main(int argc, char** argv) {
int total_len=imsize;
int rp=1;
int len= total_len/h;
int total_len=imsize;
int rp=1;
int len= total_len/h;
- cout<<len<<endl;
+
//
cout<<len<<endl;
uchar *mix=new uchar[256];
uchar *mix=new uchar[256];
@@
-340,7
+340,7
@@
int main(int argc, char** argv) {
rc4keyperm(&DK[24], h, rp, PboxRM, 8);
time+=TimeStop(t);
rc4keyperm(&DK[24], h, rp, PboxRM, 8);
time+=TimeStop(t);
- cout<<"Time initializaton "<<time<<endl;
+
//
cout<<"Time initializaton "<<time<<endl;
@@
-356,7
+356,7
@@
int main(int argc, char** argv) {
RM2[i]=RM1[i];
}
RM2[i]=RM1[i];
}
- cout<<"imsize "<<imsize<<endl;
+
//
cout<<"imsize "<<imsize<<endl;
/* for(int i=0;i<imsize;i++){
cout<<(int)seq[i]<<" ";
/* for(int i=0;i<imsize;i++){
cout<<(int)seq[i]<<" ";
@@
-375,13
+375,13
@@
int main(int argc, char** argv) {
time+=TimeStop(t);
time+=TimeStop(t);
- cout<<"Hash Time "<<time<<endl;
+
//
cout<<"Hash Time "<<time<<endl;
cout<<(double)imsize*nb_test/time<<"\t";
cout<<(double)imsize*nb_test/time<<"\t";
- for(int i=0;i<h;i++){
+
/*
for(int i=0;i<h;i++){
cout<<(int)RM1[i]<<" ";
cout<<(int)RM1[i]<<" ";
- }
- cout<<endl;
+ }*/
+
//
cout<<endl;