From 5529620ff3f926bd4a3faa2f966beca52943f7a8 Mon Sep 17 00:00:00 2001 From: couturie Date: Thu, 26 Jul 2018 14:42:45 +0200 Subject: [PATCH] update of openssl --- OneRoundIoT/execution_openssl_opi.txt | 16 ++--- OneRoundIoT/execution_openssl_rpi2.txt | 16 ++--- OneRoundIoT/openssl/openssl_evp.c | 95 ++++++++++++-------------- 3 files changed, 60 insertions(+), 67 deletions(-) diff --git a/OneRoundIoT/execution_openssl_opi.txt b/OneRoundIoT/execution_openssl_opi.txt index a7cd73f..28ef814 100644 --- a/OneRoundIoT/execution_openssl_opi.txt +++ b/OneRoundIoT/execution_openssl_opi.txt @@ -1,8 +1,8 @@ -16 24853009.422268 12073029.699382 24312060.119877 22712164.686998 -64 29239597.581647 21770893.460994 28834420.467964 27452341.069102 -256 28640940.011478 24345378.101055 29777684.534513 28019041.037202 -1024 28372088.498681 26600138.538540 30514757.151944 30254598.193300 -4096 27672973.807444 26390460.160040 30854932.730167 29810211.761870 -16384 27188968.272242 26364380.906928 29872238.408986 29781664.429377 -65536 26784903.402114 25893041.626707 29480177.539200 29574716.040163 -262144 26575001.832701 24080881.729320 28423938.509768 27758084.837318 +16 4266494.418846 3081416.483593 5602293.240846 5453685.258750 +64 10797497.763435 8711324.600519 13063803.677160 12830336.315220 +256 18197558.778266 15645778.566316 19590792.689739 19743147.990634 +1024 22145668.759662 20683142.757309 24273342.272811 24364963.773051 +4096 23391254.474360 22771376.612303 25764950.303487 25868119.833668 +16384 23568308.010499 23088957.270996 26007722.617563 26242546.688995 +65536 23535344.288671 22558828.551031 26023002.713085 26156724.424639 +262144 23360671.888226 21859806.457488 24964575.772754 25029872.028797 diff --git a/OneRoundIoT/execution_openssl_rpi2.txt b/OneRoundIoT/execution_openssl_rpi2.txt index 5b12456..fba26a2 100644 --- a/OneRoundIoT/execution_openssl_rpi2.txt +++ b/OneRoundIoT/execution_openssl_rpi2.txt @@ -1,8 +1,8 @@ -16 18108628.460942 7968801.288301 16880245.846543 15685451.701793 -64 21730879.436960 15744707.504760 21190747.888969 20964161.415561 -256 22942914.090862 19033481.473887 23130254.948512 23008809.907361 -1024 23447171.003305 21871361.530630 25182896.331411 25200482.341492 -4096 23530217.444970 22562944.638518 25651938.888494 25768193.779253 -16384 23515431.878772 22762755.837213 25758988.446117 25852516.057349 -65536 23516062.688510 22773816.544906 25778722.005436 25906567.785661 -262144 23352506.138671 22090784.060962 25643566.009893 25506546.662715 +16 3719175.371431 2666876.597505 4870392.460705 4705481.975792 +64 10011656.706117 8077062.133933 11838592.654523 11467872.840959 +256 17520838.436308 14297688.707592 19002369.744068 18828829.372910 +1024 21589008.873980 19894166.563513 23685133.884672 23666778.609453 +4096 23025294.475722 22155053.962862 25105363.224472 25130141.530436 +16384 23353759.159228 22672846.895401 25502056.915384 25578054.469604 +65536 23146658.501951 22451743.041700 25733501.605702 25864593.713096 +262144 23290039.900553 22401472.059140 25495580.916500 25474529.696408 diff --git a/OneRoundIoT/openssl/openssl_evp.c b/OneRoundIoT/openssl/openssl_evp.c index 6860932..9781826 100644 --- a/OneRoundIoT/openssl/openssl_evp.c +++ b/OneRoundIoT/openssl/openssl_evp.c @@ -16,6 +16,9 @@ typedef unsigned char uchar; int nb_test=1; int ctr=0; +double time_encrypt=0; +double time_decrypt=0; + double TimeStart() { struct timeval tstart; @@ -49,6 +52,9 @@ int encrypt(unsigned char *plaintext, int plaintext_len, unsigned char *key, int ciphertext_len; + + + /* Create and initialise the context */ if(!(ctx = EVP_CIPHER_CTX_new())) handleErrors(); @@ -57,58 +63,47 @@ 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(); + + double t=TimeStart(); + //256 //avant ecb - for(int i=0;i