mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
IsOnCurve added
This commit is contained in:
@@ -43,6 +43,12 @@ namespace crypto
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsOnCurve (const CryptoPP::ECP::Point& p)
|
||||||
|
{
|
||||||
|
auto x2 = p.x.Squared(), y2 = p.y.Squared ();
|
||||||
|
return (y2 - x2 - CryptoPP::Integer::One() - d*x2*y2).Modulo (q).IsZero ();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
CryptoPP::Integer b, q, l, d;
|
CryptoPP::Integer b, q, l, d;
|
||||||
|
|||||||
Reference in New Issue
Block a user