Check return code of crypto_generichash_init()

This commit is contained in:
Frank Denis 2014-09-16 21:41:33 -07:00
parent 31d842a432
commit 595e98a224

View File

@ -15,8 +15,12 @@ int main(void)
for (i = 0; i < MAXLEN; ++i) {
in[i] = i;
crypto_generichash_init(&st, k, 1 + i % crypto_generichash_KEYBYTES_MAX,
1 + i % crypto_generichash_BYTES_MAX);
if (crypto_generichash_init(&st, k,
1 + i % crypto_generichash_KEYBYTES_MAX,
1 + i % crypto_generichash_BYTES_MAX) != 0) {
printf("crypto_generichash_init()\n");
return 1;
}
crypto_generichash_update(&st, in, i);
crypto_generichash_update(&st, in, i);
crypto_generichash_update(&st, in, i);