aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/stream/ofb
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/stream/ofb
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/stream/ofb')
-rw-r--r--src/lib/stream/ofb/ofb.cpp8
-rw-r--r--src/lib/stream/ofb/ofb.h10
2 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/stream/ofb/ofb.cpp b/src/lib/stream/ofb/ofb.cpp
index 0c23188d5..5a2d63dd4 100644
--- a/src/lib/stream/ofb/ofb.cpp
+++ b/src/lib/stream/ofb/ofb.cpp
@@ -23,7 +23,7 @@ void OFB::clear()
m_buf_pos = 0;
}
-void OFB::key_schedule(const byte key[], size_t key_len)
+void OFB::key_schedule(const uint8_t key[], size_t key_len)
{
m_cipher->set_key(key, key_len);
@@ -36,7 +36,7 @@ std::string OFB::name() const
return "OFB(" + m_cipher->name() + ")";
}
-void OFB::cipher(const byte in[], byte out[], size_t length)
+void OFB::cipher(const uint8_t in[], uint8_t out[], size_t length)
{
while(length >= m_buffer.size() - m_buf_pos)
{
@@ -51,7 +51,7 @@ void OFB::cipher(const byte in[], byte out[], size_t length)
m_buf_pos += length;
}
-void OFB::set_iv(const byte iv[], size_t iv_len)
+void OFB::set_iv(const uint8_t iv[], size_t iv_len)
{
if(!valid_iv_length(iv_len))
throw Invalid_IV_Length(name(), iv_len);
@@ -64,7 +64,7 @@ void OFB::set_iv(const byte iv[], size_t iv_len)
}
-void OFB::seek(u64bit)
+void OFB::seek(uint64_t)
{
throw Exception("OFB does not support seeking");
}
diff --git a/src/lib/stream/ofb/ofb.h b/src/lib/stream/ofb/ofb.h
index f8beb4956..29e015227 100644
--- a/src/lib/stream/ofb/ofb.h
+++ b/src/lib/stream/ofb/ofb.h
@@ -19,9 +19,9 @@ namespace Botan {
class BOTAN_DLL OFB final : public StreamCipher
{
public:
- void cipher(const byte in[], byte out[], size_t length) override;
+ void cipher(const uint8_t in[], uint8_t out[], size_t length) override;
- void set_iv(const byte iv[], size_t iv_len) override;
+ void set_iv(const uint8_t iv[], size_t iv_len) override;
bool valid_iv_length(size_t iv_len) const override
{ return (iv_len <= m_cipher->block_size()); }
@@ -43,12 +43,12 @@ class BOTAN_DLL OFB final : public StreamCipher
*/
explicit OFB(BlockCipher* cipher);
- void seek(u64bit offset) override;
+ void seek(uint64_t offset) override;
private:
- void key_schedule(const byte key[], size_t key_len) override;
+ void key_schedule(const uint8_t key[], size_t key_len) override;
std::unique_ptr<BlockCipher> m_cipher;
- secure_vector<byte> m_buffer;
+ secure_vector<uint8_t> m_buffer;
size_t m_buf_pos;
};