//gcc pixmap_io.c -c
//g++ -O3 one_round_hash_new.cpp pixmap_io.o -o one_round_hash_new -std=c++11
-//
+//comparison with cmac
#include <iostream>
uchar j0=0;
for (int it=0; it<ldata; it++) {
- i0 = ((i0+1)&0xFE); //%255);
+ i0 = ((i0+1)%255);
j0 = (j0 + sc[i0])&0xFF;
uchar tmp = sc[i0];
sc[i0] = sc[j0];
// Mix with dynamic RM
+
- for(int a=0;a<h;a+=4) {
+ for(int a=0;a<h;a+=4) {
RM1[a]=Sbox1[RM1[a]^seq_in[ind1+a]]^seq_in[ind2+a];
RM1[a+1]=Sbox1[RM1[a+1]^seq_in[ind1+a+1]]^seq_in[ind2+a+1];
RM1[a+2]=Sbox1[RM1[a+2]^seq_in[ind1+a+2]]^seq_in[ind2+a+2];
RM1[a+3]=Sbox1[RM1[a+3]^seq_in[ind1+a+3]]^seq_in[ind2+a+3];
}
+
+
+ /* for(int a=0;a<h;a+=4) {
+ RM1[a]=RM1[a]^seq_in[ind1+a];
+ RM1[a+1]=RM1[a+1]^seq_in[ind1+a+1];
+ RM1[a+2]=RM1[a+2]^seq_in[ind1+a+2];
+ RM1[a+3]=RM1[a+3]^seq_in[ind1+a+3];
+ }
+
+ for(int a=0;a<h;a+=4) {
+ RM1[a]=Sbox1[RM1[a]]^seq_in[ind2+a];
+ RM1[a+1]=Sbox1[RM1[a+1]]^seq_in[ind2+a+1];
+ RM1[a+2]=Sbox1[RM1[a+2]]^seq_in[ind2+a+2];
+ RM1[a+3]=Sbox1[RM1[a+3]]^seq_in[ind2+a+3];
+ }
+ */
+
for(int a=0;a<h;a+=4) {
RM1[a]=Sbox2[RM1[a]];
cout<<size_buf<<endl;
- int seed=time(NULL);
+ int seed=12;//time(NULL);
cout<<seed<<endl;
srand48(seed);