aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey
diff options
context:
space:
mode:
Diffstat (limited to 'src/pubkey')
-rw-r--r--src/pubkey/ecc_key/ecc_key.h2
-rw-r--r--src/pubkey/ecdsa/ecdsa.cpp34
-rw-r--r--src/pubkey/ecdsa/ecdsa.h12
-rw-r--r--src/pubkey/eckaeg/eckaeg.cpp4
-rw-r--r--src/pubkey/gost_3410/gost_3410.cpp33
-rw-r--r--src/pubkey/gost_3410/gost_3410.h12
6 files changed, 3 insertions, 94 deletions
diff --git a/src/pubkey/ecc_key/ecc_key.h b/src/pubkey/ecc_key/ecc_key.h
index 4e97a427f..f61e4a2dc 100644
--- a/src/pubkey/ecc_key/ecc_key.h
+++ b/src/pubkey/ecc_key/ecc_key.h
@@ -100,8 +100,6 @@ class BOTAN_DLL EC_PublicKey : public virtual Public_Key
protected:
virtual void X509_load_hook();
- SecureVector<byte> m_enc_public_point; // stores the public point
-
std::auto_ptr<EC_Domain_Params> mp_dom_pars;
std::auto_ptr<PointGFp> mp_public_point;
EC_Domain_Params_Encoding m_param_enc;
diff --git a/src/pubkey/ecdsa/ecdsa.cpp b/src/pubkey/ecdsa/ecdsa.cpp
index 2e6efd609..462f0cd0c 100644
--- a/src/pubkey/ecdsa/ecdsa.cpp
+++ b/src/pubkey/ecdsa/ecdsa.cpp
@@ -64,43 +64,10 @@ void ECDSA_PublicKey::affirm_init() const // virtual
EC_PublicKey::affirm_init();
}
-void ECDSA_PublicKey::set_domain_parameters(const EC_Domain_Params& dom_pars)
- {
- if(mp_dom_pars.get())
- {
- // they are already set, we must ensure that they are equal to the arg
- if(dom_pars != *mp_dom_pars.get())
- throw Invalid_Argument("EC_PublicKey::set_domain_parameters - cannot reset to a new value");
-
- return;
- }
-
- if(m_enc_public_point.size() == 0)
- throw Invalid_State("EC_PublicKey::set_domain_parameters(): encoded public point isn't set");
-
- // now try to decode the public key ...
- PointGFp tmp_pp(OS2ECP(m_enc_public_point, dom_pars.get_curve()));
- try
- {
- tmp_pp.check_invariants();
- }
- catch(Illegal_Point e)
- {
- throw Invalid_State("EC_PublicKey::set_domain_parameters(): point does not lie on provided curve");
- }
-
- std::auto_ptr<EC_Domain_Params> p_tmp_pars(new EC_Domain_Params(dom_pars));
- ECDSA_Core tmp_ecdsa_core(*p_tmp_pars, BigInt(0), tmp_pp);
- mp_public_point.reset(new PointGFp(tmp_pp));
- m_ecdsa_core = tmp_ecdsa_core;
- mp_dom_pars = p_tmp_pars;
- }
-
void ECDSA_PublicKey::set_all_values(const ECDSA_PublicKey& other)
{
m_param_enc = other.m_param_enc;
m_ecdsa_core = other.m_ecdsa_core;
- m_enc_public_point = other.m_enc_public_point;
if(other.mp_dom_pars.get())
mp_dom_pars.reset(new EC_Domain_Params(other.domain_parameters()));
@@ -175,7 +142,6 @@ void ECDSA_PrivateKey::set_all_values(const ECDSA_PrivateKey& other)
m_private_value = other.m_private_value;
m_param_enc = other.m_param_enc;
m_ecdsa_core = other.m_ecdsa_core;
- m_enc_public_point = other.m_enc_public_point;
if(other.mp_dom_pars.get())
mp_dom_pars.reset(new EC_Domain_Params(other.domain_parameters()));
diff --git a/src/pubkey/ecdsa/ecdsa.h b/src/pubkey/ecdsa/ecdsa.h
index ce8c185a5..f6ac8a0d7 100644
--- a/src/pubkey/ecdsa/ecdsa.h
+++ b/src/pubkey/ecdsa/ecdsa.h
@@ -71,18 +71,6 @@ class BOTAN_DLL ECDSA_PublicKey : public virtual EC_PublicKey,
ECDSA_PublicKey(const ECDSA_PublicKey& other);
/**
- * Set the domain parameters of this key. This function has to be
- * used when a key encoded without domain parameters was decoded into
- * this key. Otherwise it will not be able to verify a signature.
- * @param dom_pars the domain_parameters associated with this key
- * @throw Invalid_Argument if the point was found not to be satisfying the
- * curve equation of the provided domain parameters
- * or if this key already has domain parameters set
- * and these are differing from those given as the parameter
- */
- void set_domain_parameters(const EC_Domain_Params& dom_pars);
-
- /**
* Ensure that the public point and domain parameters of this key are set.
* @throw Invalid_State if either of the two data members is not set
*/
diff --git a/src/pubkey/eckaeg/eckaeg.cpp b/src/pubkey/eckaeg/eckaeg.cpp
index 3e0f717e0..fe47e3c31 100644
--- a/src/pubkey/eckaeg/eckaeg.cpp
+++ b/src/pubkey/eckaeg/eckaeg.cpp
@@ -29,7 +29,7 @@ void ECKAEG_PublicKey::set_all_values(ECKAEG_PublicKey const& other)
{
m_param_enc = other.m_param_enc;
m_eckaeg_core = other.m_eckaeg_core;
- m_enc_public_point = other.m_enc_public_point;
+
if(other.mp_dom_pars.get())
{
mp_dom_pars.reset(new EC_Domain_Params(*(other.mp_dom_pars)));
@@ -92,7 +92,7 @@ void ECKAEG_PrivateKey::set_all_values(ECKAEG_PrivateKey const& other)
m_private_value = other.m_private_value;
m_param_enc = other.m_param_enc;
m_eckaeg_core = other.m_eckaeg_core;
- m_enc_public_point = other.m_enc_public_point;
+
if(other.mp_dom_pars.get())
{
mp_dom_pars.reset(new EC_Domain_Params(*(other.mp_dom_pars)));
diff --git a/src/pubkey/gost_3410/gost_3410.cpp b/src/pubkey/gost_3410/gost_3410.cpp
index a0225cbca..d45f70cfd 100644
--- a/src/pubkey/gost_3410/gost_3410.cpp
+++ b/src/pubkey/gost_3410/gost_3410.cpp
@@ -142,40 +142,10 @@ void GOST_3410_PublicKey::affirm_init() const // virtual
EC_PublicKey::affirm_init();
}
-void GOST_3410_PublicKey::set_domain_parameters(const EC_Domain_Params& dom_pars)
- {
- if(mp_dom_pars.get())
- {
- // they are already set, we must ensure that they are equal to the arg
- if(dom_pars != *mp_dom_pars.get())
- throw Invalid_Argument("EC_PublicKey::set_domain_parameters - cannot reset to a new value");
-
- return;
- }
-
- if(m_enc_public_point.size() == 0)
- throw Invalid_State("EC_PublicKey::set_domain_parameters(): encoded public point isn't set");
-
- // now try to decode the public key ...
- PointGFp tmp_pp(OS2ECP(m_enc_public_point, dom_pars.get_curve()));
- try
- {
- tmp_pp.check_invariants();
- }
- catch(Illegal_Point e)
- {
- throw Invalid_State("EC_PublicKey::set_domain_parameters(): point does not lie on provided curve");
- }
-
- std::auto_ptr<EC_Domain_Params> p_tmp_pars(new EC_Domain_Params(dom_pars));
- mp_public_point.reset(new PointGFp(tmp_pp));
- mp_dom_pars = p_tmp_pars;
- }
-
void GOST_3410_PublicKey::set_all_values(const GOST_3410_PublicKey& other)
{
m_param_enc = other.m_param_enc;
- m_enc_public_point = other.m_enc_public_point;
+
if(other.mp_dom_pars.get())
mp_dom_pars.reset(new EC_Domain_Params(other.domain_parameters()));
@@ -274,7 +244,6 @@ void GOST_3410_PrivateKey::set_all_values(const GOST_3410_PrivateKey& other)
{
m_private_value = other.m_private_value;
m_param_enc = other.m_param_enc;
- m_enc_public_point = other.m_enc_public_point;
if(other.mp_dom_pars.get())
mp_dom_pars.reset(new EC_Domain_Params(other.domain_parameters()));
diff --git a/src/pubkey/gost_3410/gost_3410.h b/src/pubkey/gost_3410/gost_3410.h
index 460aca9bf..2f97c1a04 100644
--- a/src/pubkey/gost_3410/gost_3410.h
+++ b/src/pubkey/gost_3410/gost_3410.h
@@ -70,18 +70,6 @@ class BOTAN_DLL GOST_3410_PublicKey : public virtual EC_PublicKey,
GOST_3410_PublicKey(const GOST_3410_PublicKey& other);
/**
- * Set the domain parameters of this key. This function has to be
- * used when a key encoded without domain parameters was decoded into
- * this key. Otherwise it will not be able to verify a signature.
- * @param dom_pars the domain_parameters associated with this key
- * @throw Invalid_Argument if the point was found not to be satisfying the
- * curve equation of the provided domain parameters
- * or if this key already has domain parameters set
- * and these are differing from those given as the parameter
- */
- void set_domain_parameters(const EC_Domain_Params& dom_pars);
-
- /**
* Ensure that the public point and domain parameters of this key are set.
* @throw Invalid_State if either of the two data members is not set
*/