IsOnCurve added

This commit is contained in:
orignal 2015-04-08 14:07:45 -04:00
parent 8c92c50f9a
commit 49d59fc116

View file

@ -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;