From f3cb3edb512bdcab498d825886c3366c341b3f78 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Sun, 11 Dec 2016 15:28:38 -0500 Subject: 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. --- src/lib/modes/cfb/cfb.cpp | 12 ++++++------ src/lib/modes/cfb/cfb.h | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'src/lib/modes/cfb') 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& state = shift_register(); + secure_vector& 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& buffer, size_t offset) +void CFB_Encryption::finish(secure_vector& 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& state = shift_register(); + secure_vector& 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& buffer, size_t offset) +void CFB_Decryption::finish(secure_vector& 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& shift_register() { return m_shift_register; } + secure_vector& shift_register() { return m_shift_register; } - secure_vector& keystream_buf() { return m_keystream_buf; } + secure_vector& 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 m_cipher; - secure_vector m_shift_register; - secure_vector m_keystream_buf; + secure_vector m_shift_register; + secure_vector 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& final_block, size_t offset = 0) override; + void finish(secure_vector& 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& final_block, size_t offset = 0) override; + void finish(secure_vector& final_block, size_t offset = 0) override; }; } -- cgit v1.2.3