From 25ea5b65db7cf6c759fcdb4cdecfa1f770dfb89d Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Fri, 11 Jul 2014 12:28:52 -0700 Subject: [PATCH] Add explicit checks for crypto_box_detached() --- test/default/box_easy2.c | 5 +++++ test/default/box_easy2.exp | 1 + 2 files changed, 6 insertions(+) diff --git a/test/default/box_easy2.c b/test/default/box_easy2.c index c8178e69..c8753ee6 100644 --- a/test/default/box_easy2.c +++ b/test/default/box_easy2.c @@ -12,6 +12,7 @@ unsigned char alicepk[crypto_box_PUBLICKEYBYTES]; unsigned char alicesk[crypto_box_SECRETKEYBYTES]; unsigned char bobpk[crypto_box_PUBLICKEYBYTES]; unsigned char bobsk[crypto_box_SECRETKEYBYTES]; +unsigned char mac[crypto_box_MACBYTES]; int main(void) { @@ -37,5 +38,9 @@ int main(void) return 1; } } + crypto_box_detached(c, mac, m, mlen, nonce, bobsk, alicepk); + crypto_box_open_detached(m2, c, mac, mlen, nonce, alicepk, bobsk); + printf("%d\n", memcmp(m, m2, mlen)); + return 0; } diff --git a/test/default/box_easy2.exp b/test/default/box_easy2.exp index 573541ac..aa47d0d4 100644 --- a/test/default/box_easy2.exp +++ b/test/default/box_easy2.exp @@ -1 +1,2 @@ 0 +0