aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/ecc_key
diff options
context:
space:
mode:
Diffstat (limited to 'src/pubkey/ecc_key')
-rw-r--r--src/pubkey/ecc_key/ecc_key.cpp9
-rw-r--r--src/pubkey/ecc_key/ecc_key.h3
2 files changed, 9 insertions, 3 deletions
diff --git a/src/pubkey/ecc_key/ecc_key.cpp b/src/pubkey/ecc_key/ecc_key.cpp
index 2c66dc97f..4f90fa321 100644
--- a/src/pubkey/ecc_key/ecc_key.cpp
+++ b/src/pubkey/ecc_key/ecc_key.cpp
@@ -24,9 +24,6 @@ EC_PublicKey::EC_PublicKey(const EC_Domain_Params& dom_par,
{
if(domain().get_curve() != public_point().get_curve())
throw Invalid_Argument("EC_PublicKey: curve mismatch in constructor");
-
- if(!public_point().on_the_curve())
- throw Invalid_State("Public key was not on the curve");
}
EC_PublicKey::EC_PublicKey(const AlgorithmIdentifier& alg_id,
@@ -38,6 +35,12 @@ EC_PublicKey::EC_PublicKey(const AlgorithmIdentifier& alg_id,
public_key = OS2ECP(key_bits, domain().get_curve());
}
+bool EC_PublicKey::check_key(RandomNumberGenerator&,
+ bool) const
+ {
+ return public_point().on_the_curve();
+ }
+
AlgorithmIdentifier EC_PublicKey::algorithm_identifier() const
{
return AlgorithmIdentifier(get_oid(), DER_domain());
diff --git a/src/pubkey/ecc_key/ecc_key.h b/src/pubkey/ecc_key/ecc_key.h
index 92f02613c..8155543da 100644
--- a/src/pubkey/ecc_key/ecc_key.h
+++ b/src/pubkey/ecc_key/ecc_key.h
@@ -49,6 +49,9 @@ class BOTAN_DLL EC_PublicKey : public virtual Public_Key
MemoryVector<byte> x509_subject_public_key() const;
+ bool check_key(RandomNumberGenerator& rng,
+ bool strong) const;
+
/**
* Get the domain parameters of this key.
* @throw Invalid_State is thrown if the