Test crypto_secretbox_open_detached() with a NULL message pointer

This commit is contained in:
Frank Denis 2017-07-24 23:17:55 +02:00
parent c90ddae75e
commit e1b0448205

View File

@ -40,6 +40,10 @@ main(void)
} }
} }
crypto_secretbox_detached(c, mac, m, (unsigned long long) mlen, nonce, k); crypto_secretbox_detached(c, mac, m, (unsigned long long) mlen, nonce, k);
if (crypto_secretbox_open_detached(NULL, c, mac, (unsigned long long) mlen,
nonce, k) != 0) {
printf("crypto_secretbox_open_detached() with a NULL message pointer failed\n");
}
if (crypto_secretbox_open_detached(m2, c, mac, (unsigned long long) mlen, if (crypto_secretbox_open_detached(m2, c, mac, (unsigned long long) mlen,
nonce, k) != 0) { nonce, k) != 0) {
printf("crypto_secretbox_open_detached() failed\n"); printf("crypto_secretbox_open_detached() failed\n");