X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/Cipher_code.git/blobdiff_plain/9e250c72f9c70af3a3a7448e50c23a7ad0ea1bd5..004b4e16d44ce3fd268c79727c388203909ffbb6:/OneRoundIoT/OneRound/one_round_par2.cpp?ds=sidebyside diff --git a/OneRoundIoT/OneRound/one_round_par2.cpp b/OneRoundIoT/OneRound/one_round_par2.cpp index e42a6d5..4a069b4 100644 --- a/OneRoundIoT/OneRound/one_round_par2.cpp +++ b/OneRoundIoT/OneRound/one_round_par2.cpp @@ -12,9 +12,9 @@ #include /*#include -#include -#include -#include + #include + #include + #include */ @@ -136,11 +136,11 @@ void prga(uchar *sc, int ldata, uchar *r) { void rotate(uchar *RM1, uchar *RM2, int size, int n) { int i; - for (i = 0; i< size-n; i++) - RM2[i+n] = RM1[i]; + for (i = 0; i< size-n; i++) + RM2[i+n] = RM1[i]; - for (i = 0; i< n; i++) - RM2[i] = RM1[size-n-1+i]; + for (i = 0; i< n; i++) + RM2[i] = RM1[size-n-1+i]; } @@ -148,16 +148,6 @@ template void encrypt_ctr(uchar* seq_in, uchar *seq_out, int len,uchar* RM1,int *Pbox, int *PboxRM, uchar *Sbox1, uchar *Sbox2, int enc, int num) { - uchar X[h2]; - uchar fX[h2*num]; - - - - - - for(int a=0;a void decrypt(uchar* seq_in, uchar *seq_out, int len,uchar* RM1,int *Pbox, int *PboxRM, uchar *Inv_Sbox1, uchar *Inv_Sbox2, int debug, int num) { /*uchar *fX=new uchar[h2]; - uchar *Inv_Sbox1=new uchar[256]; - uchar *Inv_Sbox2=new uchar[256]; + uchar *Inv_Sbox1=new uchar[256]; + uchar *Inv_Sbox2=new uchar[256]; */ - uchar fX[h2*num]; - uchar RM2[h2*num]; -#pragma omp parallel for - for(int it=0;it