diff options
author | René Korthaus <[email protected]> | 2015-12-23 11:52:19 +0100 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-01-08 19:09:51 -0500 |
commit | d22bc10cd4f67924acd82bcd46a31e3de3b20ce3 (patch) | |
tree | 58459585e6675cd799b6ef5900be026825cd6f9d /src/lib/pubkey/ecc_key | |
parent | 2fbfdd7e5afb5e888fd8c0b56c6df09e2bdeaca7 (diff) |
Mass-prefix member vars with m_
Diffstat (limited to 'src/lib/pubkey/ecc_key')
-rw-r--r-- | src/lib/pubkey/ecc_key/ecc_key.cpp | 44 | ||||
-rw-r--r-- | src/lib/pubkey/ecc_key/ecc_key.h | 16 |
2 files changed, 30 insertions, 30 deletions
diff --git a/src/lib/pubkey/ecc_key/ecc_key.cpp b/src/lib/pubkey/ecc_key/ecc_key.cpp index b0c053688..a3f0ea93d 100644 --- a/src/lib/pubkey/ecc_key/ecc_key.cpp +++ b/src/lib/pubkey/ecc_key/ecc_key.cpp @@ -25,8 +25,8 @@ size_t EC_PublicKey::estimated_strength() const EC_PublicKey::EC_PublicKey(const EC_Group& dom_par, const PointGFp& pub_point) : - domain_params(dom_par), public_key(pub_point), - domain_encoding(EC_DOMPAR_ENC_EXPLICIT) + m_domain_params(dom_par), m_public_key(pub_point), + m_domain_encoding(EC_DOMPAR_ENC_EXPLICIT) { if(domain().get_curve() != public_point().get_curve()) throw Invalid_Argument("EC_PublicKey: curve mismatch in constructor"); @@ -35,10 +35,10 @@ EC_PublicKey::EC_PublicKey(const EC_Group& dom_par, EC_PublicKey::EC_PublicKey(const AlgorithmIdentifier& alg_id, const secure_vector<byte>& key_bits) { - domain_params = EC_Group(alg_id.parameters); - domain_encoding = EC_DOMPAR_ENC_EXPLICIT; + m_domain_params = EC_Group(alg_id.parameters); + m_domain_encoding = EC_DOMPAR_ENC_EXPLICIT; - public_key = OS2ECP(key_bits, domain().get_curve()); + m_public_key = OS2ECP(key_bits, domain().get_curve()); } bool EC_PublicKey::check_key(RandomNumberGenerator&, @@ -64,20 +64,20 @@ void EC_PublicKey::set_parameter_encoding(EC_Group_Encoding form) form != EC_DOMPAR_ENC_OID) throw Invalid_Argument("Invalid encoding form for EC-key object specified"); - if((form == EC_DOMPAR_ENC_OID) && (domain_params.get_oid() == "")) + if((form == EC_DOMPAR_ENC_OID) && (m_domain_params.get_oid() == "")) throw Invalid_Argument("Invalid encoding form OID specified for " "EC-key object whose corresponding domain " "parameters are without oid"); - domain_encoding = form; + m_domain_encoding = form; } const BigInt& EC_PrivateKey::private_value() const { - if(private_key == 0) + if(m_private_key == 0) throw Invalid_State("EC_PrivateKey::private_value - uninitialized"); - return private_key; + return m_private_key; } /** @@ -87,17 +87,17 @@ EC_PrivateKey::EC_PrivateKey(RandomNumberGenerator& rng, const EC_Group& ec_group, const BigInt& x) { - domain_params = ec_group; - domain_encoding = EC_DOMPAR_ENC_EXPLICIT; + m_domain_params = ec_group; + m_domain_encoding = EC_DOMPAR_ENC_EXPLICIT; if(x == 0) - private_key = BigInt::random_integer(rng, 1, domain().get_order()); + m_private_key = BigInt::random_integer(rng, 1, domain().get_order()); else - private_key = x; + m_private_key = x; - public_key = domain().get_base_point() * private_key; + m_public_key = domain().get_base_point() * m_private_key; - BOTAN_ASSERT(public_key.on_the_curve(), + BOTAN_ASSERT(m_public_key.on_the_curve(), "Generated public key point was on the curve"); } @@ -106,7 +106,7 @@ secure_vector<byte> EC_PrivateKey::pkcs8_private_key() const return DER_Encoder() .start_cons(SEQUENCE) .encode(static_cast<size_t>(1)) - .encode(BigInt::encode_1363(private_key, private_key.bytes()), + .encode(BigInt::encode_1363(m_private_key, m_private_key.bytes()), OCTET_STRING) .end_cons() .get_contents(); @@ -115,8 +115,8 @@ secure_vector<byte> EC_PrivateKey::pkcs8_private_key() const EC_PrivateKey::EC_PrivateKey(const AlgorithmIdentifier& alg_id, const secure_vector<byte>& key_bits) { - domain_params = EC_Group(alg_id.parameters); - domain_encoding = EC_DOMPAR_ENC_EXPLICIT; + m_domain_params = EC_Group(alg_id.parameters); + m_domain_encoding = EC_DOMPAR_ENC_EXPLICIT; OID key_parameters; secure_vector<byte> public_key_bits; @@ -124,7 +124,7 @@ EC_PrivateKey::EC_PrivateKey(const AlgorithmIdentifier& alg_id, BER_Decoder(key_bits) .start_cons(SEQUENCE) .decode_and_check<size_t>(1, "Unknown version code for ECC key") - .decode_octet_string_bigint(private_key) + .decode_octet_string_bigint(m_private_key) .decode_optional(key_parameters, ASN1_Tag(0), PRIVATE) .decode_optional_string(public_key_bits, BIT_STRING, 1, PRIVATE) .end_cons(); @@ -134,14 +134,14 @@ EC_PrivateKey::EC_PrivateKey(const AlgorithmIdentifier& alg_id, if(public_key_bits.empty()) { - public_key = domain().get_base_point() * private_key; + m_public_key = domain().get_base_point() * m_private_key; - BOTAN_ASSERT(public_key.on_the_curve(), + BOTAN_ASSERT(m_public_key.on_the_curve(), "Public point derived from loaded key was on the curve"); } else { - public_key = OS2ECP(public_key_bits, domain().get_curve()); + m_public_key = OS2ECP(public_key_bits, domain().get_curve()); // OS2ECP verifies that the point is on the curve } } diff --git a/src/lib/pubkey/ecc_key/ecc_key.h b/src/lib/pubkey/ecc_key/ecc_key.h index 6764df0f0..3557d0266 100644 --- a/src/lib/pubkey/ecc_key/ecc_key.h +++ b/src/lib/pubkey/ecc_key/ecc_key.h @@ -41,7 +41,7 @@ class BOTAN_DLL EC_PublicKey : public virtual Public_Key * domain parameters of this point are not set * @result the public point of this key */ - const PointGFp& public_point() const { return public_key; } + const PointGFp& public_point() const { return m_public_key; } AlgorithmIdentifier algorithm_identifier() const override; @@ -56,7 +56,7 @@ class BOTAN_DLL EC_PublicKey : public virtual Public_Key * domain parameters of this point are not set * @result the domain parameters of this key */ - const EC_Group& domain() const { return domain_params; } + const EC_Group& domain() const { return m_domain_params; } /** * Set the domain parameter encoding to be used when encoding this key. @@ -76,16 +76,16 @@ class BOTAN_DLL EC_PublicKey : public virtual Public_Key * @result the encoding to use */ EC_Group_Encoding domain_format() const - { return domain_encoding; } + { return m_domain_encoding; } size_t estimated_strength() const override; protected: - EC_PublicKey() : domain_encoding(EC_DOMPAR_ENC_EXPLICIT) {} + EC_PublicKey() : m_domain_encoding(EC_DOMPAR_ENC_EXPLICIT) {} - EC_Group domain_params; - PointGFp public_key; - EC_Group_Encoding domain_encoding; + EC_Group m_domain_params; + PointGFp m_public_key; + EC_Group_Encoding m_domain_encoding; }; /** @@ -112,7 +112,7 @@ class BOTAN_DLL EC_PrivateKey : public virtual EC_PublicKey, protected: EC_PrivateKey() {} - BigInt private_key; + BigInt m_private_key; }; } |