mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-13 01:20:22 +03:00
eliminate one extra multipilication
This commit is contained in:
parent
9cc592b564
commit
c9d95ff161
@ -378,7 +378,9 @@ namespace crypto
|
|||||||
auto x = RecoverX (y, ctx);
|
auto x = RecoverX (y, ctx);
|
||||||
if (BN_is_bit_set (x, 0) != isHighestBitSet)
|
if (BN_is_bit_set (x, 0) != isHighestBitSet)
|
||||||
BN_sub (x, q, x); // x = q - x
|
BN_sub (x, q, x); // x = q - x
|
||||||
EDDSAPoint p {x, y};
|
BIGNUM * z = BN_new (), * t = BN_new ();
|
||||||
|
BN_one (z); BN_mod_mul (t, x, y, q, ctx); // pre-calculate t
|
||||||
|
EDDSAPoint p {x, y, z, t};
|
||||||
if (!IsOnCurve (p, ctx))
|
if (!IsOnCurve (p, ctx))
|
||||||
LogPrint (eLogError, "Decoded point is not on 25519");
|
LogPrint (eLogError, "Decoded point is not on 25519");
|
||||||
return p;
|
return p;
|
||||||
|
Loading…
Reference in New Issue
Block a user