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/modes/cfb | |
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/modes/cfb')
-rw-r--r-- | src/lib/modes/cfb/cfb.cpp | 12 | ||||
-rw-r--r-- | src/lib/modes/cfb/cfb.h | 16 |
2 files changed, 14 insertions, 14 deletions
diff --git a/src/lib/modes/cfb/cfb.cpp b/src/lib/modes/cfb/cfb.cpp index 2d1477e27..148e16c6c 100644 --- a/src/lib/modes/cfb/cfb.cpp +++ b/src/lib/modes/cfb/cfb.cpp @@ -70,12 +70,12 @@ bool CFB_Mode::valid_nonce_length(size_t n) const return (n == cipher().block_size()); } -void CFB_Mode::key_schedule(const byte key[], size_t length) +void CFB_Mode::key_schedule(const uint8_t key[], size_t length) { m_cipher->set_key(key, length); } -void CFB_Mode::start_msg(const byte nonce[], size_t nonce_len) +void CFB_Mode::start_msg(const uint8_t nonce[], size_t nonce_len) { if(!valid_nonce_length(nonce_len)) throw Invalid_IV_Length(name(), nonce_len); @@ -89,7 +89,7 @@ size_t CFB_Encryption::process(uint8_t buf[], size_t sz) { const size_t BS = cipher().block_size(); - secure_vector<byte>& state = shift_register(); + secure_vector<uint8_t>& state = shift_register(); const size_t shift = feedback(); size_t left = sz; @@ -112,7 +112,7 @@ size_t CFB_Encryption::process(uint8_t buf[], size_t sz) return sz; } -void CFB_Encryption::finish(secure_vector<byte>& buffer, size_t offset) +void CFB_Encryption::finish(secure_vector<uint8_t>& buffer, size_t offset) { update(buffer, offset); } @@ -121,7 +121,7 @@ size_t CFB_Decryption::process(uint8_t buf[], size_t sz) { const size_t BS = cipher().block_size(); - secure_vector<byte>& state = shift_register(); + secure_vector<uint8_t>& state = shift_register(); const size_t shift = feedback(); size_t left = sz; @@ -148,7 +148,7 @@ size_t CFB_Decryption::process(uint8_t buf[], size_t sz) return sz; } -void CFB_Decryption::finish(secure_vector<byte>& buffer, size_t offset) +void CFB_Decryption::finish(secure_vector<uint8_t>& buffer, size_t offset) { update(buffer, offset); } diff --git a/src/lib/modes/cfb/cfb.h b/src/lib/modes/cfb/cfb.h index 18611f3f2..a128539a4 100644 --- a/src/lib/modes/cfb/cfb.h +++ b/src/lib/modes/cfb/cfb.h @@ -44,17 +44,17 @@ class BOTAN_DLL CFB_Mode : public Cipher_Mode size_t feedback() const { return m_feedback_bytes; } - secure_vector<byte>& shift_register() { return m_shift_register; } + secure_vector<uint8_t>& shift_register() { return m_shift_register; } - secure_vector<byte>& keystream_buf() { return m_keystream_buf; } + secure_vector<uint8_t>& keystream_buf() { return m_keystream_buf; } private: - void start_msg(const byte nonce[], size_t nonce_len) override; - void key_schedule(const byte key[], size_t length) override; + void start_msg(const uint8_t nonce[], size_t nonce_len) override; + void key_schedule(const uint8_t key[], size_t length) override; std::unique_ptr<BlockCipher> m_cipher; - secure_vector<byte> m_shift_register; - secure_vector<byte> m_keystream_buf; + secure_vector<uint8_t> m_shift_register; + secure_vector<uint8_t> m_keystream_buf; size_t m_feedback_bytes; }; @@ -75,7 +75,7 @@ class BOTAN_DLL CFB_Encryption final : public CFB_Mode size_t process(uint8_t buf[], size_t size) override; - void finish(secure_vector<byte>& final_block, size_t offset = 0) override; + void finish(secure_vector<uint8_t>& final_block, size_t offset = 0) override; }; /** @@ -95,7 +95,7 @@ class BOTAN_DLL CFB_Decryption final : public CFB_Mode size_t process(uint8_t buf[], size_t size) override; - void finish(secure_vector<byte>& final_block, size_t offset = 0) override; + void finish(secure_vector<uint8_t>& final_block, size_t offset = 0) override; }; } |