mirror of
https://github.com/jedisct1/libsodium.git
synced 2024-12-23 20:15:19 -07:00
Test crypto_box_open_detached() with a weak PK
This commit is contained in:
parent
52bfc0325b
commit
982cde1a77
@ -113,6 +113,10 @@ main(void)
|
|||||||
ret = crypto_box_detached(c, mac, m, (unsigned long long) mlen, nonce,
|
ret = crypto_box_detached(c, mac, m, (unsigned long long) mlen, nonce,
|
||||||
alicepk, bobsk);
|
alicepk, bobsk);
|
||||||
assert(ret == 0);
|
assert(ret == 0);
|
||||||
|
if (crypto_box_open_detached(m2, c, mac, (unsigned long long) mlen, nonce,
|
||||||
|
small_order_p, alicesk) != -1) {
|
||||||
|
printf("crypto_box_open_detached() with a weak key passed\n");
|
||||||
|
}
|
||||||
if (crypto_box_open_detached(m2, c, mac, (unsigned long long) mlen, nonce,
|
if (crypto_box_open_detached(m2, c, mac, (unsigned long long) mlen, nonce,
|
||||||
bobpk, alicesk) != 0) {
|
bobpk, alicesk) != 0) {
|
||||||
printf("crypto_box_open_detached() failed\n");
|
printf("crypto_box_open_detached() failed\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user