X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/Cipher_code.git/blobdiff_plain/493692c718afc65e4ab01b078bb6368235220599..fd03c6c18761aedcf1616b4dadc316fbb07ebde3:/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};