Use proper nonce length now that's it's a pointer in box_easy2 test.

This commit is contained in:
Frank Denis 2015-02-17 18:42:57 +01:00
parent ef7d825f1f
commit 3316db5c87

View File

@ -31,7 +31,7 @@ int main(void)
crypto_box_keypair(bobpk, bobsk); crypto_box_keypair(bobpk, bobsk);
mlen = (size_t) randombytes_uniform((uint32_t)sizeof m); mlen = (size_t) randombytes_uniform((uint32_t)sizeof m);
randombytes_buf(m, mlen); randombytes_buf(m, mlen);
randombytes_buf(nonce, sizeof nonce); randombytes_buf(nonce, crypto_box_NONCEBYTES);
crypto_box_easy(c, m, mlen, nonce, bobpk, alicesk); crypto_box_easy(c, m, mlen, nonce, bobpk, alicesk);
if (crypto_box_open_easy(m2, c, if (crypto_box_open_easy(m2, c,
(unsigned long long) mlen + crypto_box_MACBYTES, (unsigned long long) mlen + crypto_box_MACBYTES,