1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
char *CalculS1( char *K, char *R15, char *R15fo){
char *E;
char *E1;
char *xoK;
char *xoK1;
char *S;
char *s;
char *s1;
char *S1;
char *Xof;
E=permute(R15,expansion_table,48);//correspond à E(R15)
E1=permute(R15fo, expansion_table,48);//correspond à E(R*15)
xoK=Xor1(E,K);//correspond à E(R15)+K16
xoK1=Xor1(E1,K);//correspond à E(R*15)+K16
S=Blocks5Bits(xoK,S_1,48,32);//correspond à S1(E(R15)+K16)
S1=Blocks5Bits(xoK1,S_1,48,32);//correspond à S1(E(R*15)+K16)
s=Reduction4(S);//j'extrai les 4 premier bits
s1=Reduction4(S1);//j'extrai les 4 premier bits
Xof= Xor1(s,s1);//correspond à S1(E(R15)+K16)+(S1(E(R*15)+K16)
return Xof;
} |
Partager