aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/modes/cfb/cfb.h
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-09-10 05:26:44 -0400
committerJack Lloyd <[email protected]>2017-09-10 05:26:44 -0400
commit87276e8b7124616693d876720c0bfbf9e51ccdf3 (patch)
treec149357baec3d9071235c10f447beec75c19d1d7 /src/lib/modes/cfb/cfb.h
parenta0273956a678b90bbd70da083b6cdafb2d9d6558 (diff)
Address CFB carryover bug
Test data generated by 1.10 so hopefully no further issues here. GH #1200
Diffstat (limited to 'src/lib/modes/cfb/cfb.h')
-rw-r--r--src/lib/modes/cfb/cfb.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/lib/modes/cfb/cfb.h b/src/lib/modes/cfb/cfb.h
index a128539a4..ce85d2c2e 100644
--- a/src/lib/modes/cfb/cfb.h
+++ b/src/lib/modes/cfb/cfb.h
@@ -40,22 +40,19 @@ class BOTAN_DLL CFB_Mode : public Cipher_Mode
protected:
CFB_Mode(BlockCipher* cipher, size_t feedback_bits);
- const BlockCipher& cipher() const { return *m_cipher; }
-
size_t feedback() const { return m_feedback_bytes; }
+ const BlockCipher& cipher() const { return *m_cipher; }
- secure_vector<uint8_t>& shift_register() { return m_shift_register; }
-
- secure_vector<uint8_t>& keystream_buf() { return m_keystream_buf; }
+ secure_vector<uint8_t> m_state;
+ secure_vector<uint8_t> m_keystream;
+ size_t m_keystream_pos = 0;
private:
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<uint8_t> m_shift_register;
- secure_vector<uint8_t> m_keystream_buf;
- size_t m_feedback_bytes;
+ const size_t m_feedback_bytes;
};
/**