diff options
author | Jack Lloyd <[email protected]> | 2016-12-11 15:28:38 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-12-18 16:48:24 -0500 |
commit | f3cb3edb512bdcab498d825886c3366c341b3f78 (patch) | |
tree | 645c73ec295a5a34f25d99903b6d9fa9751e86d3 /src/lib/utils/data_src.h | |
parent | c1dd21253c1f3188ff45d3ad47698efd08235ae8 (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/utils/data_src.h')
-rw-r--r-- | src/lib/utils/data_src.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/lib/utils/data_src.h b/src/lib/utils/data_src.h index 299a42ab5..ea28b7602 100644 --- a/src/lib/utils/data_src.h +++ b/src/lib/utils/data_src.h @@ -30,7 +30,7 @@ class BOTAN_DLL DataSource * @return length in bytes that was actually read and put * into out */ - virtual size_t read(byte out[], size_t length) BOTAN_WARN_UNUSED_RESULT = 0; + virtual size_t read(uint8_t out[], size_t length) BOTAN_WARN_UNUSED_RESULT = 0; virtual bool check_available(size_t n) = 0; @@ -45,7 +45,7 @@ class BOTAN_DLL DataSource * @return length in bytes that was actually read and put * into out */ - virtual size_t peek(byte out[], size_t length, size_t peek_offset) const BOTAN_WARN_UNUSED_RESULT = 0; + virtual size_t peek(uint8_t out[], size_t length, size_t peek_offset) const BOTAN_WARN_UNUSED_RESULT = 0; /** * Test whether the source still has data that can be read. @@ -64,7 +64,7 @@ class BOTAN_DLL DataSource * @return length in bytes that was actually read and put * into out */ - size_t read_byte(byte& out); + size_t read_byte(uint8_t& out); /** * Peek at one byte. @@ -72,7 +72,7 @@ class BOTAN_DLL DataSource * @return length in bytes that was actually read and put * into out */ - size_t peek_byte(byte& out) const; + size_t peek_byte(uint8_t& out) const; /** * Discard the next N bytes of the data @@ -98,8 +98,8 @@ class BOTAN_DLL DataSource class BOTAN_DLL DataSource_Memory : public DataSource { public: - size_t read(byte[], size_t) override; - size_t peek(byte[], size_t, size_t) const override; + size_t read(uint8_t[], size_t) override; + size_t peek(uint8_t[], size_t, size_t) const override; bool check_available(size_t n) override; bool end_of_data() const override; @@ -114,26 +114,26 @@ class BOTAN_DLL DataSource_Memory : public DataSource * @param in the byte array to read from * @param length the length of the byte array */ - DataSource_Memory(const byte in[], size_t length) : + DataSource_Memory(const uint8_t in[], size_t length) : m_source(in, in + length), m_offset(0) {} /** * Construct a memory source that reads from a secure_vector * @param in the MemoryRegion to read from */ - explicit DataSource_Memory(const secure_vector<byte>& in) : + explicit DataSource_Memory(const secure_vector<uint8_t>& in) : m_source(in), m_offset(0) {} /** * Construct a memory source that reads from a std::vector * @param in the MemoryRegion to read from */ - explicit DataSource_Memory(const std::vector<byte>& in) : + explicit DataSource_Memory(const std::vector<uint8_t>& in) : m_source(in.begin(), in.end()), m_offset(0) {} size_t get_bytes_read() const override { return m_offset; } private: - secure_vector<byte> m_source; + secure_vector<uint8_t> m_source; size_t m_offset; }; @@ -145,8 +145,8 @@ class BOTAN_DLL DataSource_Memory : public DataSource class BOTAN_DLL DataSource_Stream : public DataSource { public: - size_t read(byte[], size_t) override; - size_t peek(byte[], size_t, size_t) const override; + size_t read(uint8_t[], size_t) override; + size_t peek(uint8_t[], size_t, size_t) const override; bool check_available(size_t n) override; bool end_of_data() const override; std::string id() const override; |