aboutsummaryrefslogtreecommitdiffstats
path: root/checks/ecdsa.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-03-19 18:21:34 +0000
committerlloyd <[email protected]>2010-03-19 18:21:34 +0000
commit602fb0e763cfaa2caa62b3b239d021efc767d567 (patch)
tree062a11e60698bdad68ef28b21e34f964cbd41cc7 /checks/ecdsa.cpp
parentdab16b79c89e54e9551d30dcf54ca89432932dce (diff)
Replace PointGFp::check_invaraints, which would either return silently
or throw an exception, with PointGFp::on_the_curve, which returns a bool. Update callers. This showed several cases where check_invaraints was being called multiple times, for instance when decoding a point with OS2ECP, check_invaraints was called; many callers of OS2ECP would then call check_invaraints again on the same object.
Diffstat (limited to 'checks/ecdsa.cpp')
-rw-r--r--checks/ecdsa.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/checks/ecdsa.cpp b/checks/ecdsa.cpp
index d46ebb25e..3d2ee37f3 100644
--- a/checks/ecdsa.cpp
+++ b/checks/ecdsa.cpp
@@ -304,7 +304,8 @@ void test_create_and_verify(RandomNumberGenerator& rng)
PointGFp p_G = OS2ECP ( sv_G_secp_comp, curve );
EC_Domain_Params dom_params(curve, p_G, bi_order_g, BigInt(1));
- p_G.check_invariants();
+ if(!p_G.on_the_curve())
+ throw Internal_Error("Point not on the curve");
ECDSA_PrivateKey key_odd_oid(rng, dom_params);
std::string key_odd_oid_str = PKCS8::PEM_encode(key_odd_oid);
@@ -359,7 +360,6 @@ void test_curve_registry(RandomNumberGenerator& rng)
{
OID oid(oids[i]);
EC_Domain_Params dom_pars(oid);
- dom_pars.get_base_point().check_invariants();
ECDSA_PrivateKey ecdsa(rng, dom_pars);
PK_Signer signer(ecdsa, "EMSA1(SHA-1)");