aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/ecc_key
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-09-26 17:10:02 +0000
committerlloyd <[email protected]>2010-09-26 17:10:02 +0000
commit3181cda998fc96868efc17b9630fdd5dceff9404 (patch)
tree556cb4ef134b1ed34c26ea1a08ebb1aba605b988 /src/pubkey/ecc_key
parentc820501357ac3acc81ddb8fad9fd9fd5fee9b32f (diff)
Use BOTAN_ASSERT in various places
Diffstat (limited to 'src/pubkey/ecc_key')
-rw-r--r--src/pubkey/ecc_key/ecc_key.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/pubkey/ecc_key/ecc_key.cpp b/src/pubkey/ecc_key/ecc_key.cpp
index 4f90fa321..bf221aad0 100644
--- a/src/pubkey/ecc_key/ecc_key.cpp
+++ b/src/pubkey/ecc_key/ecc_key.cpp
@@ -14,6 +14,7 @@
#include <botan/ber_dec.h>
#include <botan/secmem.h>
#include <botan/point_gfp.h>
+#include <botan/internal/assert.h>
namespace Botan {
@@ -99,8 +100,8 @@ EC_PrivateKey::EC_PrivateKey(RandomNumberGenerator& rng,
private_key = BigInt::random_integer(rng, 1, domain().get_order());
public_key = domain().get_base_point() * private_key;
- if(!public_key.on_the_curve())
- throw Internal_Error("ECC private key generation failed");
+ BOTAN_ASSERT(public_key.on_the_curve(),
+ "generated ECC private key was not on the curve");
}
MemoryVector<byte> EC_PrivateKey::pkcs8_private_key() const
@@ -129,8 +130,8 @@ EC_PrivateKey::EC_PrivateKey(const AlgorithmIdentifier& alg_id,
public_key = domain().get_base_point() * private_key;
- if(!public_key.on_the_curve())
- throw Internal_Error("Loaded ECC private key failed self test");
+ BOTAN_ASSERT(public_key.on_the_curve(),
+ "Loaded ECC private key not on the curve");
}
}