Add tests for the aes256gcm functions returning sizes

Which spotted a typo by the way.
This commit is contained in:
Frank Denis 2015-10-11 19:19:31 +02:00
parent 7082a3c8d1
commit 98550acafb
2 changed files with 6 additions and 1 deletions

View File

@ -24,7 +24,7 @@ size_t crypto_aead_aes256gcm_nsecbytes(void);
#define crypto_aead_aes256gcm_NPUBBYTES 12U #define crypto_aead_aes256gcm_NPUBBYTES 12U
SODIUM_EXPORT SODIUM_EXPORT
size_t crypto_aead_aes256gcm_pubbytes(void); size_t crypto_aead_aes256gcm_npubbytes(void);
#define crypto_aead_aes256gcm_ABYTES 16U #define crypto_aead_aes256gcm_ABYTES 16U
SODIUM_EXPORT SODIUM_EXPORT

View File

@ -3099,6 +3099,11 @@ main(void)
if (crypto_aead_aes256gcm_is_available()) { if (crypto_aead_aes256gcm_is_available()) {
tv(); tv();
} }
assert(crypto_aead_aes256gcm_keybytes() == crypto_aead_aes256gcm_KEYBYTES);
assert(crypto_aead_aes256gcm_nsecbytes() == crypto_aead_aes256gcm_NSECBYTES);
assert(crypto_aead_aes256gcm_npubbytes() == crypto_aead_aes256gcm_NPUBBYTES);
assert(crypto_aead_aes256gcm_abytes() == crypto_aead_aes256gcm_ABYTES);
assert(crypto_aead_aes256gcm_statebytes() > (size_t) 0U);
printf("OK\n"); printf("OK\n");
return 0; return 0;