vendor/libsodium/test/default/secretbox_easy2.c in rbnacl-libsodium-1.0.5 vs vendor/libsodium/test/default/secretbox_easy2.c in rbnacl-libsodium-1.0.6
- old
+ new
@@ -17,12 +17,14 @@
randombytes_buf(k, sizeof k);
mlen = (size_t) randombytes_uniform((uint32_t) sizeof m);
randombytes_buf(m, (unsigned long long) mlen);
randombytes_buf(nonce, sizeof nonce);
crypto_secretbox_easy(c, m, (unsigned long long) mlen, nonce, k);
- crypto_secretbox_open_easy(m2, c,
- (unsigned long long) mlen + crypto_secretbox_MACBYTES,
- nonce, k);
+ if (crypto_secretbox_open_easy(m2, c,
+ (unsigned long long) mlen + crypto_secretbox_MACBYTES,
+ nonce, k) != 0) {
+ printf("crypto_secretbox_open_easy() failed\n");
+ }
printf("%d\n", memcmp(m, m2, mlen));
for (i = 0; i < mlen + crypto_secretbox_MACBYTES - 1; i++) {
if (crypto_secretbox_open_easy(m2, c, (unsigned long long) i,
nonce, k) == 0) {