From 7c1b0a1b44332b0834fd4030e477612a3e2db712 Mon Sep 17 00:00:00 2001 From: couturie Date: Thu, 17 Aug 2017 20:32:03 +0200 Subject: [PATCH 1/1] new --- OneRoundIoT/openssl/openssl_evp_ebc.c | 29 +++++++++++++++------------ 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/OneRoundIoT/openssl/openssl_evp_ebc.c b/OneRoundIoT/openssl/openssl_evp_ebc.c index c7b2425..45f579b 100644 --- a/OneRoundIoT/openssl/openssl_evp_ebc.c +++ b/OneRoundIoT/openssl/openssl_evp_ebc.c @@ -152,7 +152,15 @@ int main (void) /* Message to be encrypted */ - + int nb_test=1; + if(argc==2) + nb_test=atoi(argv[1]); + if(nb_test<=0 || nb_test>10000) { + printf("nb tests is not correct\n"); + exit(0); + } + else + printf("nb tests = %d\n\n",nb_test); @@ -164,11 +172,11 @@ int main (void) int width; int height; uchar *data_R, *data_G, *data_B; -// load_RGB_pixmap("lena.ppm", &width, &height, &data_R, &data_G, &data_B); + load_RGB_pixmap("lena.ppm", &width, &height, &data_R, &data_G, &data_B); // load_RGB_pixmap("No_ecb_mode_picture.ppm", &width, &height, &data_R, &data_G, &data_B); - load_RGB_pixmap("4096.ppm", &width, &height, &data_R, &data_G, &data_B); +// load_RGB_pixmap("4096.ppm", &width, &height, &data_R, &data_G, &data_B); int size=width*height*3; int oneD=width*height; @@ -190,11 +198,7 @@ int main (void) int decryptedtext_len, ciphertext_len; - /* Initialise the library */ - ERR_load_crypto_strings(); - OpenSSL_add_all_algorithms(); - OPENSSL_config(NULL); - + int ss=0; double time=0; double t=TimeStart(); @@ -205,16 +209,15 @@ int main (void) int i; - for(i=0;i<100;i++) + for(i=0;i