diff --git a/test/default/generichash.c b/test/default/generichash.c index d5fc68cd..35e789a0 100644 --- a/test/default/generichash.c +++ b/test/default/generichash.c @@ -20,5 +20,18 @@ int main(void) } printf("\n"); } + + assert(crypto_generichash_bytes_min() > 0U); + assert(crypto_generichash_bytes_max() > 0U); + assert(crypto_generichash_bytes() > 0U); + assert(crypto_generichash_bytes() >= crypto_generichash_bytes_min()); + assert(crypto_generichash_bytes() <= crypto_generichash_bytes_max()); + assert(crypto_generichash_keybytes_min() >= 0U); + assert(crypto_generichash_keybytes_max() > 0U); + assert(crypto_generichash_keybytes() > 0U); + assert(crypto_generichash_keybytes() >= crypto_generichash_keybytes_min()); + assert(crypto_generichash_keybytes() <= crypto_generichash_keybytes_max()); + assert(strcmp(crypto_generichash_primitive(), "blake2b") == 0); + return 0; } diff --git a/test/default/hash.c b/test/default/hash.c index 39c9923f..283d07d3 100644 --- a/test/default/hash.c +++ b/test/default/hash.c @@ -11,5 +11,11 @@ int main(void) crypto_hash(h,x,sizeof x - 1U); for (i = 0;i < crypto_hash_BYTES;++i) printf("%02x",(unsigned int) h[i]); printf("\n"); + + assert(crypto_hash_bytes() > 0U); + assert(strcmp(crypto_hash_primitive(), "sha512") == 0); + assert(crypto_hash_sha256_bytes() > 0U); + assert(crypto_hash_sha512_bytes() == crypto_hash_bytes()); + return 0; } diff --git a/test/default/onetimeauth.c b/test/default/onetimeauth.c index cd5ff926..1de1e3ab 100644 --- a/test/default/onetimeauth.c +++ b/test/default/onetimeauth.c @@ -39,5 +39,11 @@ int main(void) printf(",0x%02x",(unsigned int) a[i]); if (i % 8 == 7) printf("\n"); } + assert(crypto_onetimeauth_bytes() > 0U); + assert(crypto_onetimeauth_keybytes() > 0U); + assert(strcmp(crypto_onetimeauth_primitive(), "poly1305") == 0); + assert(crypto_onetimeauth_poly1305_bytes() == crypto_onetimeauth_bytes()); + assert(crypto_onetimeauth_poly1305_keybytes() == crypto_onetimeauth_keybytes()); + return 0; }