X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/Cipher_code.git/blobdiff_plain/48c6cd00416c7d3db8b6f9dc052903f61e040691..8447de27d254ebc4b598b4209d62a3ead3bbc343:/OneRoundIoT/openssl/openssl_evp_ebc.c diff --git a/OneRoundIoT/openssl/openssl_evp_ebc.c b/OneRoundIoT/openssl/openssl_evp_ebc.c index c7b2425..e4fea74 100644 --- a/OneRoundIoT/openssl/openssl_evp_ebc.c +++ b/OneRoundIoT/openssl/openssl_evp_ebc.c @@ -137,7 +137,7 @@ int decrypt(unsigned char *ciphertext, int ciphertext_len, unsigned char *key, } -int main (void) +int main (int argc, char** argv) { /* Set up the key and iv. Do I need to say to not hard code these in a * real application? :-) @@ -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