Add explicit checks for crypto_box_detached()

This commit is contained in:
Frank Denis
2014-07-11 12:28:52 -07:00
parent ad7b1c58a8
commit 25ea5b65db
2 changed files with 6 additions and 0 deletions
+5
View File
@@ -12,6 +12,7 @@ unsigned char alicepk[crypto_box_PUBLICKEYBYTES];
unsigned char alicesk[crypto_box_SECRETKEYBYTES];
unsigned char bobpk[crypto_box_PUBLICKEYBYTES];
unsigned char bobsk[crypto_box_SECRETKEYBYTES];
unsigned char mac[crypto_box_MACBYTES];
int main(void)
{
@@ -37,5 +38,9 @@ int main(void)
return 1;
}
}
crypto_box_detached(c, mac, m, mlen, nonce, bobsk, alicepk);
crypto_box_open_detached(m2, c, mac, mlen, nonce, alicepk, bobsk);
printf("%d\n", memcmp(m, m2, mlen));
return 0;
}
+1
View File
@@ -1 +1,2 @@
0
0