form(k,k,pc1_table,56);for(inti=0;i<16;i++){rotatel(kl,28,loop_table[i]);rotatel(kr,28,loop_table[i]);transform(subkey[i],k,pc2_table,48);}}voidf_func(boolin[32],constboolki[48]){staticboolmr[48];transform(mr,in,e_table,48);xor(mr,ki,48);s_func(in,mr);transform(in,in,p_table,32);}voids_func(boolout[32],constboolin[48]){for(chari=0,j,k;i<8;i++,in+=6,out+=4){j=(in[0]<<1)+in[5];k=(in[1]<<3)+(in[2]<<2)+(in[3]<<1)+in[4];bytetobit(out,&s_box[i][j][k],4);}}voidtransform(bool*out,bool*in,constchar*table,intlen){staticbooltmp[256];for(inti=0;i<len;i++)tmp[i]=in[table[i]-1];memcpy(out,tmp,len);}voidxor(bool*ina,constbool*inb,intlen){for(inti=0;i<len;i++)ina[i]^=inb[i];}voidrotatel(bool*in,intlen,intloop){staticbooltmp[256];memcpy(tmp,in,loop);memcpy(in,in+loop,len-loop);memcpy(in+len-loop,tmp,loop);