From f3cb3edb512bdcab498d825886c3366c341b3f78 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Sun, 11 Dec 2016 15:28:38 -0500 Subject: 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. --- src/lib/pubkey/curve25519/curve25519.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/lib/pubkey/curve25519/curve25519.cpp') diff --git a/src/lib/pubkey/curve25519/curve25519.cpp b/src/lib/pubkey/curve25519/curve25519.cpp index 7c3dea0f3..4908bf46f 100644 --- a/src/lib/pubkey/curve25519/curve25519.cpp +++ b/src/lib/pubkey/curve25519/curve25519.cpp @@ -14,7 +14,7 @@ namespace Botan { void curve25519_basepoint(uint8_t mypublic[32], const uint8_t secret[32]) { - const byte basepoint[32] = { 9 }; + const uint8_t basepoint[32] = { 9 }; curve25519_donna(mypublic, secret, basepoint); } @@ -26,10 +26,10 @@ void size_check(size_t size, const char* thing) throw Decoding_Error("Invalid size " + std::to_string(size) + " for Curve25519 " + thing); } -secure_vector curve25519(const secure_vector& secret, - const byte pubval[32]) +secure_vector curve25519(const secure_vector& secret, + const uint8_t pubval[32]) { - secure_vector out(32); + secure_vector out(32); curve25519_donna(out.data(), secret.data(), pubval); return out; } @@ -47,7 +47,7 @@ bool Curve25519_PublicKey::check_key(RandomNumberGenerator&, bool) const } Curve25519_PublicKey::Curve25519_PublicKey(const AlgorithmIdentifier&, - const std::vector& key_bits) + const std::vector& key_bits) { BER_Decoder(key_bits) .start_cons(SEQUENCE) @@ -58,7 +58,7 @@ Curve25519_PublicKey::Curve25519_PublicKey(const AlgorithmIdentifier&, size_check(m_public.size(), "public key"); } -std::vector Curve25519_PublicKey::public_key_bits() const +std::vector Curve25519_PublicKey::public_key_bits() const { return DER_Encoder() .start_cons(SEQUENCE) @@ -75,7 +75,7 @@ Curve25519_PrivateKey::Curve25519_PrivateKey(RandomNumberGenerator& rng) } Curve25519_PrivateKey::Curve25519_PrivateKey(const AlgorithmIdentifier&, - const secure_vector& key_bits) + const secure_vector& key_bits) { BER_Decoder(key_bits) .start_cons(SEQUENCE) @@ -88,7 +88,7 @@ Curve25519_PrivateKey::Curve25519_PrivateKey(const AlgorithmIdentifier&, size_check(m_private.size(), "private key"); } -secure_vector Curve25519_PrivateKey::private_key_bits() const +secure_vector Curve25519_PrivateKey::private_key_bits() const { return DER_Encoder() .start_cons(SEQUENCE) @@ -105,7 +105,7 @@ bool Curve25519_PrivateKey::check_key(RandomNumberGenerator&, bool) const return public_point == m_public; } -secure_vector Curve25519_PrivateKey::agree(const byte w[], size_t w_len) const +secure_vector Curve25519_PrivateKey::agree(const uint8_t w[], size_t w_len) const { size_check(w_len, "public value"); return curve25519(m_private, w); @@ -124,7 +124,7 @@ class Curve25519_KA_Operation : public PK_Ops::Key_Agreement_with_KDF PK_Ops::Key_Agreement_with_KDF(kdf), m_key(key) {} - secure_vector raw_agree(const byte w[], size_t w_len) override + secure_vector raw_agree(const uint8_t w[], size_t w_len) override { return m_key.agree(w, w_len); } -- cgit v1.2.3