]> AND Private Git Repository - Cipher_code.git/blobdiff - OneRoundIoT/openssl/openssl_evp.c
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
first version of IDA (many files are missing)
[Cipher_code.git] / OneRoundIoT / openssl / openssl_evp.c
index 77dba80e76e30107b4a1e6af9260456cd1e01b25..6860932ba85a2e8c9d5f7b3e64c1593a2980422c 100644 (file)
@@ -135,6 +135,9 @@ int decrypt(unsigned char *ciphertext, int ciphertext_len, unsigned char *key,
 
   //256
 
+  for(int i=0;i<nb_test;i++)
+  {  
+  
   //avant => ecb
   if(ctr) {
     if(1 != EVP_DecryptInit_ex(ctx, EVP_aes_128_ctr(), NULL, key, iv))
@@ -152,13 +155,12 @@ int decrypt(unsigned char *ciphertext, int ciphertext_len, unsigned char *key,
   double t=0;
   t=TimeStart();
 */
-  for(int i=0;i<nb_test;i++)
-  {  
+
     plaintext_len = 0;
     if(1 != EVP_DecryptUpdate(ctx, plaintext, &len, ciphertext, ciphertext_len))
       handleErrors();
     plaintext_len = len;
-  }
+
 /*  time+=TimeStop(t);
 //  if(index==nb_test-1)
     printf("Time decrypt %f\n",time);
@@ -170,7 +172,7 @@ int decrypt(unsigned char *ciphertext, int ciphertext_len, unsigned char *key,
    */
   if(1 != EVP_DecryptFinal_ex(ctx, plaintext + len, &len)) handleErrors();
   plaintext_len += len;
-
+  }
   
   
   /* Clean up */