mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-10-01 04:03:50 +03:00
Add explicit checks for crypto_box_detached()
This commit is contained in:
1 parent
ad7b1c58a8
commit
25ea5b65db
2 files changed
+6
No files matched your search
@@ -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 +1,2 @@
|
||||
0
|
||||
0
|
||||
Reference in new issue
Block a user