X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/Cipher_code.git/blobdiff_plain/493692c718afc65e4ab01b078bb6368235220599..e8291c5548e7edd0beb647e84f4a4585f32b5265:/OneRoundIoT/openssl/openssl_evp_chacha20_poly1305.c diff --git a/OneRoundIoT/openssl/openssl_evp_chacha20_poly1305.c b/OneRoundIoT/openssl/openssl_evp_chacha20_poly1305.c index dbe0bc3..a0e7d8d 100755 --- a/OneRoundIoT/openssl/openssl_evp_chacha20_poly1305.c +++ b/OneRoundIoT/openssl/openssl_evp_chacha20_poly1305.c @@ -72,11 +72,11 @@ int encrypt(unsigned char *plaintext, int plaintext_len, unsigned char *key, //256 //avant ecb if(ctr) { - if(1 != CMAC_Init(ctx, key, 16, EVP_chacha20_poly1305(), NULL)) + if(1 != CMAC_Init(ctx, key, 32, EVP_chacha20_poly1305(), NULL)) handleErrors(); } else - if(1 != CMAC_Init(ctx, key, 16, EVP_chacha20_poly1305(), NULL)) + if(1 != CMAC_Init(ctx, key, 32, EVP_chacha20_poly1305(), NULL)) handleErrors(); size_t mactlen; unsigned char mact[16] = {0};