aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/gost_3410
diff options
context:
space:
mode:
authorlloyd <[email protected]>2011-04-08 18:13:41 +0000
committerlloyd <[email protected]>2011-04-08 18:13:41 +0000
commit8b543e804375a788ae71d461c0f8cf5d4193fc25 (patch)
tree6177931cd84a9be204cdab6e62729954e69e0421 /src/pubkey/gost_3410
parent3b66bfd4da97189ec275e5f85b9f85009d3f8370 (diff)
ECC private keys had two different constructors, one taking a group
and a random number generator, and the other taking a group and a preset private key value. The DL private keys instead have on constructor for this; if the x value is zero, then a new random key is created. For consistency, do this with ECC as well. ECDH actually didn't have one of these constructors, forcing you to either load from PKCS #8 or else use a random key. Rename EC_Domain_Params to EC_Group, with a typedef for compatability. More doc updates. Update mtn ignores for Sphinx output
Diffstat (limited to 'src/pubkey/gost_3410')
-rw-r--r--src/pubkey/gost_3410/gost_3410.cpp2
-rw-r--r--src/pubkey/gost_3410/gost_3410.h16
-rw-r--r--src/pubkey/gost_3410/info.txt2
3 files changed, 7 insertions, 13 deletions
diff --git a/src/pubkey/gost_3410/gost_3410.cpp b/src/pubkey/gost_3410/gost_3410.cpp
index fa72d0673..507ebb5a0 100644
--- a/src/pubkey/gost_3410/gost_3410.cpp
+++ b/src/pubkey/gost_3410/gost_3410.cpp
@@ -56,7 +56,7 @@ GOST_3410_PublicKey::GOST_3410_PublicKey(const AlgorithmIdentifier& alg_id,
// Also includes hash and cipher OIDs... brilliant design guys
BER_Decoder(alg_id.parameters).start_cons(SEQUENCE).decode(ecc_param_id);
- domain_params = EC_Domain_Params(ecc_param_id);
+ domain_params = EC_Group(ecc_param_id);
SecureVector<byte> bits;
BER_Decoder(key_bits).decode(bits, OCTET_STRING);
diff --git a/src/pubkey/gost_3410/gost_3410.h b/src/pubkey/gost_3410/gost_3410.h
index 4fb7b42c3..7b638d7b5 100644
--- a/src/pubkey/gost_3410/gost_3410.h
+++ b/src/pubkey/gost_3410/gost_3410.h
@@ -27,7 +27,7 @@ class BOTAN_DLL GOST_3410_PublicKey : public virtual EC_PublicKey
* @param dom_par the domain parameters associated with this key
* @param public_point the public point defining this key
*/
- GOST_3410_PublicKey(const EC_Domain_Params& dom_par,
+ GOST_3410_PublicKey(const EC_Group& dom_par,
const PointGFp& public_point) :
EC_PublicKey(dom_par, public_point) {}
@@ -80,18 +80,12 @@ class BOTAN_DLL GOST_3410_PrivateKey : public GOST_3410_PublicKey,
* Generate a new private key
* @param rng a random number generator
* @param domain parameters to used for this key
+ * @param x the private key; if zero, a new random key is generated
*/
GOST_3410_PrivateKey(RandomNumberGenerator& rng,
- const EC_Domain_Params& domain) :
- EC_PrivateKey(rng, domain) {}
-
- /**
- * Load a private key
- * @param domain parameters
- * @param x the private key
- */
- GOST_3410_PrivateKey(const EC_Domain_Params& domain, const BigInt& x) :
- EC_PrivateKey(domain, x) {}
+ const EC_Group& domain,
+ const BigInt& x = 0) :
+ EC_PrivateKey(rng, domain, x) {}
AlgorithmIdentifier pkcs8_algorithm_identifier() const
{ return EC_PublicKey::algorithm_identifier(); }
diff --git a/src/pubkey/gost_3410/info.txt b/src/pubkey/gost_3410/info.txt
index 05df445ec..9fbc3099f 100644
--- a/src/pubkey/gost_3410/info.txt
+++ b/src/pubkey/gost_3410/info.txt
@@ -5,7 +5,7 @@ load_on auto
<requires>
alloc
asn1
-ec_dompar
+ec_group
ecc_key
libstate
numbertheory