From: Loup Vaillant Date: Wed, 11 Oct 2017 21:20:05 +0000 (+0200) Subject: Use helper function X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=faaca2a66261f38bddd79aec6e3b3a72bb376fe7;p=Monocypher.git Use helper function --- diff --git a/src/monocypher.c b/src/monocypher.c index 96151a5..5e094c8 100644 --- a/src/monocypher.c +++ b/src/monocypher.c @@ -1681,8 +1681,7 @@ void crypto_aead_lock(u8 mac[16], crypto_lock_init (&ctx, key, nonce); // authenticate additional data first, to allow overlapping buffers crypto_lock_auth (&ctx, ad, ad_size); - crypto_lock_encrypt(&ctx, cipher_text, plain_text, text_size); - crypto_lock_auth (&ctx, cipher_text, text_size); + crypto_lock_update (&ctx, cipher_text, plain_text, text_size); crypto_lock_final (&ctx, mac); }