From faaca2a66261f38bddd79aec6e3b3a72bb376fe7 Mon Sep 17 00:00:00 2001 From: Loup Vaillant Date: Wed, 11 Oct 2017 23:20:05 +0200 Subject: [PATCH] Use helper function --- src/monocypher.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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); } -- 2.47.3