aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/ecc_key/ecc_key.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-03-04 03:56:49 +0000
committerlloyd <[email protected]>2010-03-04 03:56:49 +0000
commitea2b48cca1ef37815742577bfd692397bdcf8d13 (patch)
tree863933a7a0fc21ccee07dda33ac0806984ee0929 /src/pubkey/ecc_key/ecc_key.cpp
parente998558e1fa903b32155b694107082fff25f9c0e (diff)
Remove load hooks from ECC classes, unused
Diffstat (limited to 'src/pubkey/ecc_key/ecc_key.cpp')
-rw-r--r--src/pubkey/ecc_key/ecc_key.cpp24
1 files changed, 8 insertions, 16 deletions
diff --git a/src/pubkey/ecc_key/ecc_key.cpp b/src/pubkey/ecc_key/ecc_key.cpp
index 081649de3..f1ece3ebd 100644
--- a/src/pubkey/ecc_key/ecc_key.cpp
+++ b/src/pubkey/ecc_key/ecc_key.cpp
@@ -45,18 +45,6 @@ MemoryVector<byte> EC_PublicKey::x509_subject_public_key() const
return EC2OSP(public_point(), PointGFp::COMPRESSED);
}
-void EC_PublicKey::X509_load_hook()
- {
- try
- {
- public_point().check_invariants();
- }
- catch(Illegal_Point)
- {
- throw Decoding_Error("Invalid public point; not on curve");
- }
- }
-
EC_PublicKey::EC_PublicKey(const AlgorithmIdentifier& alg_id,
const MemoryRegion<byte>& key_bits)
{
@@ -160,11 +148,15 @@ EC_PrivateKey::EC_PrivateKey(const AlgorithmIdentifier& alg_id,
private_key = BigInt::decode(octstr_secret, octstr_secret.size());
public_key = domain().get_base_point() * private_key;
- }
-void EC_PrivateKey::PKCS8_load_hook(bool)
- {
- public_key = domain().get_base_point() * private_key;
+ try
+ {
+ public_key.check_invariants();
+ }
+ catch(Illegal_Point)
+ {
+ throw Internal_Error("Loaded ECC private key failed self test");
+ }
}
}