mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-12 20:36:38 +01:00
IsOnCurve added
This commit is contained in:
parent
8c92c50f9a
commit
49d59fc116
1 changed files with 6 additions and 0 deletions
|
@ -43,6 +43,12 @@ namespace crypto
|
|||
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:
|
||||
|
||||
CryptoPP::Integer b, q, l, d;
|
||||
|
|
Loading…
Add table
Reference in a new issue