From 5e0085b777f407569dd7e1ab957f629f0f3546e3 Mon Sep 17 00:00:00 2001 From: couturie Date: Thu, 24 Aug 2017 22:29:25 +0200 Subject: [PATCH 1/1] new --- OneRoundIoT/OneRound/one_round_new.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/OneRoundIoT/OneRound/one_round_new.cpp b/OneRoundIoT/OneRound/one_round_new.cpp index b394646..fd1ff8a 100644 --- a/OneRoundIoT/OneRound/one_round_new.cpp +++ b/OneRoundIoT/OneRound/one_round_new.cpp @@ -241,11 +241,16 @@ template void encrypt(uchar* seq_in, uchar *seq_out, int len,uchar* RM1,int *Pbox, int *PboxRM, uchar *Sbox1, uchar *Sbox2, int debug) { - uchar *X=new uchar[h2]; +/* uchar *X=new uchar[h2]; uchar *fX=new uchar[h2]; unsigned int *lX=(unsigned int*)X; unsigned int *lseq_in=(unsigned int*)seq_in; - +*/ + uchar X[h2]; + uchar fX[h2]; + unsigned int *lX=(unsigned int*)X; + unsigned int *lseq_in=(unsigned int*)seq_in; + for(int it=0;it void decrypt(uchar* seq_in, uchar *seq_out, int len,uchar* RM1,int *Pbox, int *PboxRM, uchar *Sbox1, uchar *Sbox2, int debug) { - uchar *fX=new uchar[h2]; + /*uchar *fX=new uchar[h2]; + uchar *Inv_Sbox1=new uchar[256]; + uchar *Inv_Sbox2=new uchar[256]; + */ + uchar fX[h2]; + uchar Inv_Sbox1[256]; + uchar Inv_Sbox2[256]; - uchar *Inv_Sbox1=new uchar[256]; + inverse_tables(Sbox1,256,Inv_Sbox1); - uchar *Inv_Sbox2=new uchar[256]; + inverse_tables(Sbox2,256,Inv_Sbox2); -- 2.39.5