From 2b28ebca4ad3d5461f91c6580748b04e5a7eb1e6 Mon Sep 17 00:00:00 2001 From: couturie Date: Wed, 6 Sep 2017 16:14:53 +0200 Subject: [PATCH] new --- OneRoundIoT/OneRound/one_round_par2.cpp | 417 +++++++++++++----------- 1 file changed, 224 insertions(+), 193 deletions(-) diff --git a/OneRoundIoT/OneRound/one_round_par2.cpp b/OneRoundIoT/OneRound/one_round_par2.cpp index e42a6d5..f579622 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