]> AND Private Git Repository - Cipher_code.git/blobdiff - Old_one_round/one_round_light_v2.cpp
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
old one round authentication
[Cipher_code.git] / Old_one_round / one_round_light_v2.cpp
index d660bc468aba3a749b3f75b2f8b3ede473bc90ac..96a6fdac4d8c40a2ec8411d3e44cd5ca1343132f 100644 (file)
@@ -201,7 +201,7 @@ void encrypt(uchar* seq,int len,uchar* RM1,uchar *RM2,uchar *RM3,int *Pbox, ucha
     for(int a=0;a<h2;a+=4) {
       seq[ind1+a]=Sbox2[fX[a]];
       seq[ind1+a+1]=Sbox2[fX[a+1]];
-      seq[ind1+a+2]=Sbox2[fX[a+3]];
+      seq[ind1+a+2]=Sbox2[fX[a+2]];
       seq[ind1+a+3]=Sbox2[fX[a+3]];
     }
     for(int a=0;a<h2;a+=4){
@@ -352,7 +352,7 @@ void decrypt(uchar* seq,int len,uchar* RM1,uchar *RM2,uchar *RM3,int *Pbox, ucha
       fX[a]=fX[a]^gY[a];
       fX[a+1]=fX[a+1]^gY[a+1];
       fX[a+2]=fX[a+2]^gY[a+2];
-      fX[a+3]=fX[a+2]^gY[a+3];
+      fX[a+3]=fX[a+3]^gY[a+3];
     }
 
      for(int a=0;a<h2;a+=4) {