From: couturie Date: Sun, 21 Oct 2018 15:43:01 +0000 (+0200) Subject: update of enhanced one round cbc X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/Cipher_code.git/commitdiff_plain/e38c16ec01bf23e02c6bc0c7ee5d046f253125d1 update of enhanced one round cbc --- diff --git a/OneRoundIoT/EnhancedOneRound/enhanced_oneround.cpp b/OneRoundIoT/EnhancedOneRound/enhanced_oneround.cpp index 04986d7..954a127 100644 --- a/OneRoundIoT/EnhancedOneRound/enhanced_oneround.cpp +++ b/OneRoundIoT/EnhancedOneRound/enhanced_oneround.cpp @@ -320,18 +320,32 @@ void encrypt_cbc(uchar* seq_in, uchar *seq_out, int len,uchar* RM, int *Pbox, in uchar *RM2; int h2=h*h; + + + + for(int a=0;a>=8; + IV1[a+1]=(mm&255); + mm>>=8; + IV1[a+2]=(mm&255); + mm>>=8; + IV1[a+3]=(mm&255); } for(int a=0;a>=8; + IV2[a+1]=(mm&255); + mm>>=8; + IV2[a+2]=(mm&255); + mm>>=8; + IV2[a+3]=(mm&255); } @@ -430,23 +444,34 @@ void decrypt_cbc(uchar* seq_in, uchar *seq_out, int len, uchar* RM, int *Pbox, i uchar *RM1; uchar *RM2; - - int h2=h*h; for(int a=0;a>=8; + IV1[a+1]=(mm&255); + mm>>=8; + IV1[a+2]=(mm&255); + mm>>=8; + IV1[a+3]=(mm&255); } for(int a=0;a>=8; + IV2[a+1]=(mm&255); + mm>>=8; + IV2[a+2]=(mm&255); + mm>>=8; + IV2[a+3]=(mm&255); } + + + for(int it=0;it