From 525c21ed10fc9d3f612acfd04b5d7091a8c0d6e0 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Mon, 18 Sep 2017 23:29:58 +0200 Subject: [PATCH] Tests --- test/default/xchacha20.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/default/xchacha20.c b/test/default/xchacha20.c index 5e3fcf32..a5719c8b 100644 --- a/test/default/xchacha20.c +++ b/test/default/xchacha20.c @@ -184,6 +184,7 @@ tv_stream_xchacha20(void) assert(crypto_stream_xchacha20_keybytes() == crypto_stream_xchacha20_KEYBYTES); assert(crypto_stream_xchacha20_noncebytes() == crypto_stream_xchacha20_NONCEBYTES); + assert(crypto_stream_xchacha20_messagebytes_max() == crypto_stream_xchacha20_MESSAGEBYTES_MAX); printf("tv_stream_xchacha20: ok\n"); } @@ -332,6 +333,11 @@ tv_box_xchacha20poly1305(void) assert(crypto_box_curve25519xchacha20poly1305_open_easy (m2, out, crypto_box_curve25519xchacha20poly1305_MACBYTES + m_len, nonce, small_order_p, sk) == -1); + assert(crypto_box_curve25519xchacha20poly1305_open_easy + (m2, out, crypto_box_curve25519xchacha20poly1305_MACBYTES - 1, + nonce, pk, sk) == -1); + assert(crypto_box_curve25519xchacha20poly1305_open_easy + (m2, out, 0, nonce, pk, sk) == -1); assert(crypto_box_curve25519xchacha20poly1305_open_easy (m2, out, crypto_box_curve25519xchacha20poly1305_MACBYTES + m_len, nonce, pk, sk) == 0);