X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/Cipher_code.git/blobdiff_plain/8e7ce26ffa675a1249751a2a2e5d3b5c1cdc0553..4629a687773ce4bec8abd94d0577f541ce1438ed:/OneRoundIoT/openssl/openssl_evp.c diff --git a/OneRoundIoT/openssl/openssl_evp.c b/OneRoundIoT/openssl/openssl_evp.c index bd4243a..8bbd357 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,14 +76,25 @@ 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