diff options
author | Simon Warta <[email protected]> | 2015-12-09 12:52:54 +0100 |
---|---|---|
committer | Simon Warta <[email protected]> | 2015-12-09 15:26:48 +0100 |
commit | 897b95f03a73ac453a4e3b672ee3d2b918e49320 (patch) | |
tree | 2bac2ba16a00a01870518ac0a892679cbc4bb375 /src/lib/base/symkey.h | |
parent | 631fef26ead7e2da64aa4618bb16a716813b3e8c (diff) |
Minor sanity updates for OctetString
Diffstat (limited to 'src/lib/base/symkey.h')
-rw-r--r-- | src/lib/base/symkey.h | 21 |
1 files changed, 11 insertions, 10 deletions
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<byte> */ - secure_vector<byte> bits_of() const { return bits; } + secure_vector<byte> 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<byte>& in) : bits(in) {} + OctetString(const secure_vector<byte>& in) : m_data(in) {} /** * Create a new OctetString * @param in a bytestring */ - OctetString(const std::vector<byte>& in) : bits(in.begin(), in.end()) {} + OctetString(const std::vector<byte>& in) : m_data(in.begin(), in.end()) {} + private: - secure_vector<byte> bits; + secure_vector<byte> 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; } |