aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey/ecdh
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-12-11 15:28:38 -0500
committerJack Lloyd <[email protected]>2016-12-18 16:48:24 -0500
commitf3cb3edb512bdcab498d825886c3366c341b3f78 (patch)
tree645c73ec295a5a34f25d99903b6d9fa9751e86d3 /src/lib/pubkey/ecdh
parentc1dd21253c1f3188ff45d3ad47698efd08235ae8 (diff)
Convert to using standard uintN_t integer types
Renames a couple of functions for somewhat better name consistency, eg make_u32bit becomes make_uint32. The old typedefs remain for now since probably lots of application code uses them.
Diffstat (limited to 'src/lib/pubkey/ecdh')
-rw-r--r--src/lib/pubkey/ecdh/ecdh.cpp2
-rw-r--r--src/lib/pubkey/ecdh/ecdh.h12
2 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/pubkey/ecdh/ecdh.cpp b/src/lib/pubkey/ecdh/ecdh.cpp
index 1bdf2c209..32914be2e 100644
--- a/src/lib/pubkey/ecdh/ecdh.cpp
+++ b/src/lib/pubkey/ecdh/ecdh.cpp
@@ -35,7 +35,7 @@ class ECDH_KA_Operation : public PK_Ops::Key_Agreement_with_KDF
m_l_times_priv = inverse_mod(m_cofactor, key.domain().get_order()) * key.private_value();
}
- secure_vector<byte> raw_agree(const byte w[], size_t w_len) override
+ secure_vector<uint8_t> raw_agree(const uint8_t w[], size_t w_len) override
{
PointGFp point = OS2ECP(w, w_len, m_curve);
// TODO: add blinding
diff --git a/src/lib/pubkey/ecdh/ecdh.h b/src/lib/pubkey/ecdh/ecdh.h
index 09c3fc721..7524a80ff 100644
--- a/src/lib/pubkey/ecdh/ecdh.h
+++ b/src/lib/pubkey/ecdh/ecdh.h
@@ -26,7 +26,7 @@ class BOTAN_DLL ECDH_PublicKey : public virtual EC_PublicKey
* @param key_bits DER encoded public key bits
*/
ECDH_PublicKey(const AlgorithmIdentifier& alg_id,
- const std::vector<byte>& key_bits) :
+ const std::vector<uint8_t>& key_bits) :
EC_PublicKey(alg_id, key_bits) {}
/**
@@ -47,13 +47,13 @@ class BOTAN_DLL ECDH_PublicKey : public virtual EC_PublicKey
/**
* @return public point value
*/
- std::vector<byte> public_value() const
+ std::vector<uint8_t> public_value() const
{ return unlock(EC2OSP(public_point(), PointGFp::UNCOMPRESSED)); }
/**
* @return public point value
*/
- std::vector<byte> public_value(PointGFp::Compression_Type type) const
+ std::vector<uint8_t> public_value(PointGFp::Compression_Type type) const
{ return unlock(EC2OSP(public_point(), type)); }
protected:
@@ -75,7 +75,7 @@ class BOTAN_DLL ECDH_PrivateKey : public ECDH_PublicKey,
* @param key_bits X.509 subject public key info structure
*/
ECDH_PrivateKey(const AlgorithmIdentifier& alg_id,
- const secure_vector<byte>& key_bits) :
+ const secure_vector<uint8_t>& key_bits) :
EC_PrivateKey(alg_id, key_bits) {}
/**
@@ -89,10 +89,10 @@ class BOTAN_DLL ECDH_PrivateKey : public ECDH_PublicKey,
const BigInt& x = 0) :
EC_PrivateKey(rng, domain, x) {}
- std::vector<byte> public_value() const override
+ std::vector<uint8_t> public_value() const override
{ return ECDH_PublicKey::public_value(PointGFp::UNCOMPRESSED); }
- std::vector<byte> public_value(PointGFp::Compression_Type type) const
+ std::vector<uint8_t> public_value(PointGFp::Compression_Type type) const
{ return ECDH_PublicKey::public_value(type); }
std::unique_ptr<PK_Ops::Key_Agreement>