From 656b608a022c716868f21e2aa84da15fb6aa4e86 Mon Sep 17 00:00:00 2001 From: couturie Date: Sat, 26 Aug 2017 13:47:03 +0200 Subject: [PATCH 1/1] new --- OneRoundIoT/openssl/openssl_evp.c | 55 ++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 16 deletions(-) diff --git a/OneRoundIoT/openssl/openssl_evp.c b/OneRoundIoT/openssl/openssl_evp.c index bd4243a..be8eb74 100644 --- a/OneRoundIoT/openssl/openssl_evp.c +++ b/OneRoundIoT/openssl/openssl_evp.c @@ -41,7 +41,7 @@ void handleErrors(void) int encrypt(unsigned char *plaintext, int plaintext_len, unsigned char *key, - unsigned char *iv, unsigned char *ciphertext, int ctr) + unsigned char *iv, unsigned char *ciphertext, int ctr, int index) { EVP_CIPHER_CTX *ctx; @@ -76,13 +76,24 @@ int encrypt(unsigned char *plaintext, int plaintext_len, unsigned char *key, * EVP_EncryptUpdate can be called multiple times if necessary */ - if(1 != EVP_EncryptUpdate(ctx, ciphertext, &len, plaintext, plaintext_len)) - handleErrors(); - ciphertext_len = len; - - + static double time=0; + double t=0; + t=TimeStart(); +// for(int i=0;i