]> git.codecow.com Git - Monocypher.git/commitdiff
Use helper function
authorLoup Vaillant <loup@loup-vaillant.fr>
Wed, 11 Oct 2017 21:20:05 +0000 (23:20 +0200)
committerLoup Vaillant <loup@loup-vaillant.fr>
Fri, 13 Oct 2017 19:28:32 +0000 (21:28 +0200)
src/monocypher.c

index 96151a58753a8cccb34a2f5193e93345f264d1dc..5e094c841e118c640db5cdd70883d6237a9636ac 100644 (file)
@@ -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);
 }