}
- cout<<size_buf<<endl;
+ // cout<<size_buf<<endl;
int seed=12;//time(NULL);
- cout<<seed<<endl;
+ //cout<<seed<<endl;
srand48(seed);
uchar Secretkey[key_size];
}
}
- printf("seq 4 %d\n",seq[4]);
+ //printf("seq 4 %d\n",seq[4]);
if(change==1) {
seq[4]++;
seq[9]++;
}
- printf("seq 4 %d\n",seq[4]);
+ // printf("seq 4 %d\n",seq[4]);
int total_len=imsize;
int rp=1;
int len= total_len/h;
- cout<<len<<endl;
+ //cout<<len<<endl;
uchar *mix=new uchar[256];
rc4keyperm(&DK[24], h, rp, PboxRM, 8);
time+=TimeStop(t);
- cout<<"Time initializaton "<<time<<endl;
+ //cout<<"Time initializaton "<<time<<endl;
RM2[i]=RM1[i];
}
- cout<<"imsize "<<imsize<<endl;
+ //cout<<"imsize "<<imsize<<endl;
/* for(int i=0;i<imsize;i++){
cout<<(int)seq[i]<<" ";
time+=TimeStop(t);
- cout<<"Hash Time "<<time<<endl;
+ //cout<<"Hash Time "<<time<<endl;
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<<endl;
+ }*/
+ // cout<<endl;
}
- cout<<size_buf<<endl;
+ // cout<<size_buf<<endl;
int seed=12;//time(NULL);
- cout<<seed<<endl;
+ // cout<<seed<<endl;
srand48(seed);
uchar Secretkey[key_size];
}
}
- printf("seq 4 %d\n",seq[4]);
+ //printf("seq 4 %d\n",seq[4]);
if(change==1) {
seq[4]++;
seq[9]++;
}
- printf("seq 4 %d\n",seq[4]);
+ // printf("seq 4 %d\n",seq[4]);
int total_len=imsize;
int rp=1;
int len= total_len/h;
- cout<<len<<endl;
+ //cout<<len<<endl;
uchar *mix=new uchar[256];
time+=TimeStop(t);
- cout<<"Time initializaton "<<time<<endl;
+ // cout<<"Time initializaton "<<time<<endl;
RM2[i]=RM1[i];
}
- cout<<"imsize "<<imsize<<endl;
+ // cout<<"imsize "<<imsize<<endl;
/* for(int i=0;i<imsize;i++){
cout<<(int)seq[i]<<" ";
time+=TimeStop(t);
- cout<<"Hash Time "<<time<<endl;
+ // cout<<"Hash Time "<<time<<endl;
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<<endl;
+ }*/
+ // cout<<endl;
--- /dev/null
+#python3 run_hash_throughput.py > exe_hash_throughtput.txt
+
+import subprocess
+import re
+
+
+
+print("#size \t h \t time")
+print("variant 1");
+h=8
+for k in range(1,6):
+ result=subprocess.check_output("one_round_hash_new2 lena1 nb100 h"+str(h),shell=True)
+ res=result.decode()
+ print(str(512*512*3)+"\t"+str(h)+"\t"+res)
+ h=h+h
+
+print("variant 2");
+h=8
+for k in range(1,6):
+ result=subprocess.check_output("one_round_hash_new3 lena1 nb100 h"+str(h),shell=True)
+ res=result.decode()
+ print(str(512*512*3)+"\t"+str(h)+"\t"+res)
+ h=h+h
+
+print("cmac");
+h=8
+for k in range(1,6):
+ result=subprocess.check_output("../openssl/openssl_evp_cmac lena1 nb100 h"+str(h),shell=True)
+ res=result.decode()
+ print(str(512*512*3)+"\t"+str(h)+"\t"+res)
+ h=h+h
+
+print("hmac");
+h=8
+for k in range(1,6):
+ result=subprocess.check_output("../openssl/openssl_evp_hmac lena1 nb100 h"+str(h),shell=True)
+ res=result.decode()
+ print(str(512*512*3)+"\t"+str(h)+"\t"+res)
+ h=h+h
if(1 != CMAC_Final(ctx, mact, &mactlen)) handleErrors();
ciphertext_len += len;
- printBytes(mact, mactlen);
+ // printBytes(mact, mactlen);
/* Clean up */
CMAC_CTX_free(ctx);
ciphertext_len += len;
- printBytes(hash_sha256, result_len);
+ // printBytes(hash_sha256, result_len);
/*
char *p = &hash_sha256_hex[0];