From 2c1b507045f3c3a444afe61baa783fb703e35bc8 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sat, 13 Sep 2014 14:29:59 -0700 Subject: [PATCH] More constant tests --- test/default/auth.c | 8 ++++++-- test/default/box.c | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/test/default/auth.c b/test/default/auth.c index 96bb4c2b..f3933d46 100644 --- a/test/default/auth.c +++ b/test/default/auth.c @@ -20,8 +20,12 @@ int main(void) assert(crypto_auth_bytes() > 0U); assert(crypto_auth_keybytes() > 0U); assert(strcmp(crypto_auth_primitive(), "hmacsha512256") == 0); - assert(crypto_auth_hmacsha512256_bytes() > 0U); - assert(crypto_auth_hmacsha512256_keybytes() > 0U); + assert(crypto_auth_hmacsha256_bytes() > 0U); + assert(crypto_auth_hmacsha256_keybytes() > 0U); + assert(crypto_auth_hmacsha512_bytes() > 0U); + assert(crypto_auth_hmacsha512_keybytes() > 0U); + assert(crypto_auth_hmacsha512256_bytes() == crypto_auth_bytes()); + assert(crypto_auth_hmacsha512256_keybytes() == crypto_auth_keybytes()); return 0; } diff --git a/test/default/box.c b/test/default/box.c index 86e235d5..126d707b 100644 --- a/test/default/box.c +++ b/test/default/box.c @@ -60,5 +60,24 @@ int main(void) if (i % 8 == 7) printf("\n"); } printf("\n"); + + assert(crypto_box_seedbytes() > 0U); + assert(crypto_box_publickeybytes() > 0U); + assert(crypto_box_secretkeybytes() > 0U); + assert(crypto_box_beforenmbytes() > 0U); + assert(crypto_box_noncebytes() > 0U); + assert(crypto_box_zerobytes() > 0U); + assert(crypto_box_boxzerobytes() > 0U); + assert(crypto_box_macbytes() > 0U); + assert(strcmp(crypto_box_primitive(), "curve25519xsalsa20poly1305") == 0); + assert(crypto_box_curve25519xsalsa20poly1305_seedbytes() == crypto_box_seedbytes()); + assert(crypto_box_curve25519xsalsa20poly1305_publickeybytes() == crypto_box_publickeybytes()); + assert(crypto_box_curve25519xsalsa20poly1305_secretkeybytes() == crypto_box_secretkeybytes()); + assert(crypto_box_curve25519xsalsa20poly1305_beforenmbytes() == crypto_box_beforenmbytes()); + assert(crypto_box_curve25519xsalsa20poly1305_noncebytes() == crypto_box_noncebytes()); + assert(crypto_box_curve25519xsalsa20poly1305_zerobytes() == crypto_box_zerobytes()); + assert(crypto_box_curve25519xsalsa20poly1305_boxzerobytes() == crypto_box_boxzerobytes()); + assert(crypto_box_curve25519xsalsa20poly1305_macbytes() == crypto_box_macbytes()); + return 0; }