mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 11:17:49 +02:00
handle case when encoded key is (p-1)/2
This commit is contained in:
parent
4d7b86ca26
commit
36eaaa748c
2 changed files with 14 additions and 1 deletions
|
@ -100,7 +100,7 @@ namespace crypto
|
|||
|
||||
BIGNUM * r = BN_CTX_get (ctx); BN_bin2bn (encoded1, 32, r);
|
||||
|
||||
if (BN_cmp (r, p12) < 0) // r < (p-1)/2
|
||||
if (BN_cmp (r, p12) <= 0) // r < (p-1)/2
|
||||
{
|
||||
// v = -A/(1+u*r^2)
|
||||
BIGNUM * v = BN_CTX_get (ctx); BN_mod_sqr (v, r, p, ctx);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue