From: couturie Date: Sat, 30 Sep 2017 17:05:43 +0000 (+0200) Subject: new X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/Cipher_code.git/commitdiff_plain/8ba8fb459047af4b6fcad29ecb87a2b40ab0146e new --- diff --git a/OneRoundIoT/openssl/openssl_evp.c b/OneRoundIoT/openssl/openssl_evp.c index 4e99565..90441f1 100644 --- a/OneRoundIoT/openssl/openssl_evp.c +++ b/OneRoundIoT/openssl/openssl_evp.c @@ -57,9 +57,9 @@ int encrypt(unsigned char *plaintext, int plaintext_len, unsigned char *key, * In this example we are using 256 bit AES (i.e. a 256 bit key). The * IV size for *most* modes is the same as the block size. For AES this * is 128 bits */ - static double time=0; - double t=0; - t=TimeStart(); + //static double time=0; + //double t=0; + //t=TimeStart(); //256 //avant ecb if(ctr) { @@ -70,8 +70,8 @@ int encrypt(unsigned char *plaintext, int plaintext_len, unsigned char *key, if(1 != EVP_EncryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv)) handleErrors(); - time+=TimeStop(t); - printf("Time init %f\n",time); + //time+=TimeStop(t); + //printf("Time init %f\n",time); // int cipherBlockSize = EVP_CIPHER_CTX_block_size(ctx); @@ -275,7 +275,8 @@ int main (int argc, char** argv) */ - double time=0; + double time_encrypt=0; + double time_decrypt=0; double t=TimeStart(); @@ -290,9 +291,10 @@ int main (int argc, char** argv) ciphertext, ctr, i ); } - time+=TimeStop(t); + time_encrypt+=TimeStop(t); - printf("Time encrypt %f\n",time); +// printf("Time encrypt %f\n",time); + printf("%f\t",(double)imsize*nb_test/time_encrypt); if(lena) { for(int i=0;i