From 897b95f03a73ac453a4e3b672ee3d2b918e49320 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Wed, 9 Dec 2015 12:52:54 +0100 Subject: Minor sanity updates for OctetString --- src/lib/base/symkey.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/lib/base/symkey.h') diff --git a/src/lib/base/symkey.h b/src/lib/base/symkey.h index 23b7d030b..3b0208e51 100644 --- a/src/lib/base/symkey.h +++ b/src/lib/base/symkey.h @@ -22,23 +22,23 @@ class BOTAN_DLL OctetString /** * @return size of this octet string in bytes */ - size_t length() const { return bits.size(); } - size_t size() const { return bits.size(); } + size_t length() const { return m_data.size(); } + size_t size() const { return m_data.size(); } /** * @return this object as a secure_vector */ - secure_vector bits_of() const { return bits; } + secure_vector bits_of() const { return m_data; } /** * @return start of this string */ - const byte* begin() const { return bits.data(); } + const byte* begin() const { return m_data.data(); } /** * @return end of this string */ - const byte* end() const { return begin() + bits.size(); } + const byte* end() const { return begin() + m_data.size(); } /** * @return this encoded as hex @@ -81,15 +81,16 @@ class BOTAN_DLL OctetString * Create a new OctetString * @param in a bytestring */ - OctetString(const secure_vector& in) : bits(in) {} + OctetString(const secure_vector& in) : m_data(in) {} /** * Create a new OctetString * @param in a bytestring */ - OctetString(const std::vector& in) : bits(in.begin(), in.end()) {} + OctetString(const std::vector& in) : m_data(in.begin(), in.end()) {} + private: - secure_vector bits; + secure_vector m_data; }; /** @@ -132,12 +133,12 @@ BOTAN_DLL OctetString operator^(const OctetString& x, /** * Alternate name for octet string showing intent to use as a key */ -typedef OctetString SymmetricKey; +using SymmetricKey = OctetString; /** * Alternate name for octet string showing intent to use as an IV */ -typedef OctetString InitializationVector; +using InitializationVector = OctetString; } -- cgit v1.2.3