X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/Cipher_code.git/blobdiff_plain/1dc7a9dac04700865be873c50f6347d48e501ea0..27b3be6422ff306284e39782fb676dba2fbfdb94:/OneRoundIoT/OneRound/one_round_new.cpp diff --git a/OneRoundIoT/OneRound/one_round_new.cpp b/OneRoundIoT/OneRound/one_round_new.cpp index 6a26c6e..165fb19 100644 --- a/OneRoundIoT/OneRound/one_round_new.cpp +++ b/OneRoundIoT/OneRound/one_round_new.cpp @@ -181,7 +181,7 @@ void encrypt_ctr(uchar* seq_in, uchar *seq_out, int len,uchar* RM1,int *Pbox, in printf("\n"); }*/ - *(int*)&fX[0]=it; + *(int*)&fX[0]^=it; /* if(it<513) { for(int a=0;a(seq, seq2,len,RM1,Pbox,PboxRM,Sbox1,Sbox2,0); + } + break; + case 64: + for(i=0;i(seq, seq2,len,RM1,Pbox,PboxRM,Sbox1,Sbox2,1); + else + encrypt<64*64>(seq, seq2,len,RM1,Pbox,PboxRM,Sbox1,Sbox2,0); + } break; } @@ -550,12 +589,14 @@ int main(int argc, char** argv) { cout<<"Time encrypt "<(seq2,seq,len,RM2,Pbox,PboxRM,Sbox1,Sbox2,0); } break; + case 64: + for(i=0;i(seq2, seq,len,RM2,Pbox,PboxRM,Sbox1,Sbox2,0); + else + decrypt<64*64>(seq2,seq,len,RM2,Pbox,PboxRM,Sbox1,Sbox2,0); + } + break; } time+=TimeStop(t); cout<<"Time decrypt "<