[ create a new paste ] login | about

Link: http://codepad.org/nz55zSBj    [ raw code | output | fork ]

C, pasted on Mar 23:
void lk(unsigned char t[256]){
unsigned int o=0,x,a,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,c[17],d[2],l[17];
int i,j,read_size,n;
unsigned char e[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
unsigned char r[17]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
FILE *fp;
unsigned char str[16],s[256],m[32];


fp=fopen("key.bin","rb");
read_size=fread(gg,1,16,fp);
 for(i=1;i<16;i++)
   c[i]=gg[i];

 c[16]=1;
for(x=0;x<N;x++){

a16=gf[mltn(16,fg[x])];
a15=gf[mlt(gg[15],mltn(15,fg[x]))];
a14=gf[mlt(gg[14],mltn(14,fg[x]))];
a13=gf[mlt(gg[13],mltn(13,fg[x]))];
a12=gf[mlt(gg[12],mltn(12,fg[x]))];
a11=gf[mlt(gg[11],mltn(11,fg[x]))];
a10=gf[mlt(gg[10],mltn(10,fg[x]))];
a9=gf[mlt(gg[9],mltn(9,fg[x]))];
a8=gf[mlt(gg[8],mltn(8,fg[x]))];
a7=gf[mlt(gg[7],mltn(7,fg[x]))];
a6=gf[mlt(gg[6],mltn(6,fg[x]))];
a5=gf[mlt(mlt(mlt(fg[x],fg[x]),mlt(fg[x],fg[x])),mlt(gg[5],fg[x]))];
a4=gf[mlt(mlt(mlt(fg[x],fg[x]),mlt(fg[x],fg[x])),gg[4])];
a3=gf[mlt(mlt(fg[x],fg[x]),mlt(fg[x],gg[3]))];
a2=gf[mlt(mlt(fg[x],fg[x]),gg[2])];
a=gf[mlt(fg[x],gg[1])]^gg[0];
a=a^a2^a3^a4^a5^a6^a7^a8^a9^a10^a11^a12^a13^a14^a15^a16;

    while(a==0){
      printf("lx=%u trace 0\n",x);
      for(i=0;i<16;i++){
        s[i]=c1.m[i];
        s[i+16]=c2.m[i];
      }
      genkey(s,t);
      lk(t);
      fclose(fp);
    }
  
  c[0]=gg[0]^a;
  d[0]=x;
  d[1]=1;
  e[15]=1;
  for(i=0;i<15;i++)
    e[i]=0;
  i=K;
    while(i>0){
  r[i]=gf[mlt(fg[d[1]],fg[e[i-1]])];
  r[i-1]=gf[mlt(fg[d[0]],fg[e[i-1]])];
	j=K;
    while(j>-1){
    c[j]=r[j]^gf[fg[c[j]]];
    j=j-1;
    }
      r[i]=c[i];
      if(i-2>-1){
        e[i-2]=c[i-1];
      }
      i=i-1;
    }
  for(i=0;i<K;i++){
      h3[i][x]=gf[mlt(fg[e[K-1-i]],dv(1,fg[a]))];
  }
}


Output:
1
2
3
4
5
6
7
8
9
10
11
12
In function 'lk':
Line 11: error: 'gg' undeclared (first use in this function)
Line 11: error: (Each undeclared identifier is reported only once
Line 11: error: for each function it appears in.)
Line 16: error: 'N' undeclared (first use in this function)
Line 18: error: 'gf' undeclared (first use in this function)
Line 18: error: 'fg' undeclared (first use in this function)
Line 39: error: 'c1' undeclared (first use in this function)
Line 40: error: 'c2' undeclared (first use in this function)
Line 53: error: 'K' undeclared (first use in this function)
Line 69: error: 'h3' undeclared (first use in this function)
Line 71: error: expected declaration or statement at end of input


Create a new paste based on this one


Comments: