diff options
author | lloyd <[email protected]> | 2010-04-20 00:07:51 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-04-20 00:07:51 +0000 |
commit | 030084de5ced0ce5c71376979146b6204f8f2aeb (patch) | |
tree | 756305f87543373b3f16c414e78f08e8b9d54221 | |
parent | fde718068a630858f152485b6b19cd8c30fd1e03 (diff) |
Expose public_value() in ECDH public key
-rw-r--r-- | src/pubkey/ecdh/ecdh.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/pubkey/ecdh/ecdh.h b/src/pubkey/ecdh/ecdh.h index d670361f6..19621f2ca 100644 --- a/src/pubkey/ecdh/ecdh.h +++ b/src/pubkey/ecdh/ecdh.h @@ -38,7 +38,7 @@ class BOTAN_DLL ECDH_PublicKey : public virtual EC_PublicKey /** * Get this keys algorithm name. - * @result this keys algorithm name + * @return this keys algorithm name */ std::string algo_name() const { return "ECDH"; } @@ -46,9 +46,16 @@ class BOTAN_DLL ECDH_PublicKey : public virtual EC_PublicKey * Get the maximum number of bits allowed to be fed to this key. * This is the bitlength of the order of the base point. - * @result the maximum number of input bits + * @return the maximum number of input bits */ u32bit max_input_bits() const { return domain().get_order().bits(); } + + /** + * @return the public point value + */ + MemoryVector<byte> public_value() const + { return EC2OSP(public_point(), PointGFp::UNCOMPRESSED); } + protected: ECDH_PublicKey() {} }; @@ -75,7 +82,7 @@ class BOTAN_DLL ECDH_PrivateKey : public ECDH_PublicKey, EC_PrivateKey(rng, domain) {} MemoryVector<byte> public_value() const - { return EC2OSP(public_point(), PointGFp::UNCOMPRESSED); } + { return ECDH_PublicKey::public_value(); } }; /** |