//t=TimeStart();
//256
//avant ecb
+ for(int i=0;i<nb_test;i++)
+ {
+
if(ctr) {
if(1 != EVP_EncryptInit_ex(ctx, EVP_aes_128_ctr(), NULL, key, iv))
handleErrors();
double t=0;
t=TimeStart();
*/
- for(int i=0;i<nb_test;i++)
- {
if(1 != EVP_EncryptUpdate(ctx, ciphertext, &len, plaintext, plaintext_len))
handleErrors();
ciphertext_len = len;
- }
+
/* time+=TimeStop(t);
// if(index==nb_test-1)
printf("Time encrypt %f\n",time);
*/
if(1 != EVP_EncryptFinal_ex(ctx, ciphertext + len, &len)) handleErrors();
ciphertext_len += len;
-
+ }
/* Clean up */
EVP_CIPHER_CTX_free(ctx);
//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))
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);
*/
if(1 != EVP_DecryptFinal_ex(ctx, plaintext + len, &len)) handleErrors();
plaintext_len += len;
-
+ }
/* Clean up */