More constant tests

This commit is contained in:
Frank Denis 2014-09-13 14:29:59 -07:00
parent ab37bd3e0b
commit 2c1b507045
2 changed files with 25 additions and 2 deletions

View File

@ -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;
}

View File

@ -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;
}