X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/Cipher_code.git/blobdiff_plain/8cde42bc7104d1fd047cd3587809cdb72afabd34..e38c16ec01bf23e02c6bc0c7ee5d046f253125d1:/OneRoundIoT/EnhancedOneRound/enhanced_oneround.cpp 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