X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/Cipher_code.git/blobdiff_plain/bdb76e61a70ac6da625d817bf7179e36436fa6cb..f225228275940ffb8cd10ee63028c0063b3e1810:/OneRoundIoT/openssl/openssl_evp.c diff --git a/OneRoundIoT/openssl/openssl_evp.c b/OneRoundIoT/openssl/openssl_evp.c index 6860932..0a4b949 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