X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/Cipher_code.git/blobdiff_plain/656b608a022c716868f21e2aa84da15fb6aa4e86..b7fb3820a92dbb613e535763a5f83d3a74440513:/OneRoundIoT/openssl/openssl_evp.c?ds=sidebyside diff --git a/OneRoundIoT/openssl/openssl_evp.c b/OneRoundIoT/openssl/openssl_evp.c index be8eb74..90441f1 100644 --- a/OneRoundIoT/openssl/openssl_evp.c +++ b/OneRoundIoT/openssl/openssl_evp.c @@ -57,7 +57,9 @@ 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(); //256 //avant ecb if(ctr) { @@ -68,6 +70,10 @@ int encrypt(unsigned char *plaintext, int plaintext_len, unsigned char *key, if(1 != EVP_EncryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv)) handleErrors(); + //time+=TimeStop(t); + //printf("Time init %f\n",time); + + // int cipherBlockSize = EVP_CIPHER_CTX_block_size(ctx); // printf("INFO(evp_encrypt): block size: %d\n", cipherBlockSize); @@ -76,25 +82,24 @@ int encrypt(unsigned char *plaintext, int plaintext_len, unsigned char *key, * EVP_EncryptUpdate can be called multiple times if necessary */ - +/* static double time=0; double t=0; t=TimeStart(); - -// for(int i=0;i