16 m_feedback_bytes(feedback_bits ? feedback_bits / 8 :
m_block_size)
74 void CFB_Mode::key_schedule(
const uint8_t key[],
size_t length)
76 m_cipher->set_key(key, length);
80 void CFB_Mode::start_msg(
const uint8_t nonce[],
size_t nonce_len)
83 throw Invalid_IV_Length(
name(), nonce_len);
91 throw Invalid_State(
"CFB requires a non-empty initial nonce");
97 m_state.assign(nonce, nonce + nonce_len);
106 const size_t carryover =
block_size() - shift;
137 if(m_keystream_pos == shift)
170 inline void xor_copy(uint8_t buf[], uint8_t key_buf[],
size_t len)
172 for(
size_t i = 0; i != len; ++i)
174 uint8_t k = key_buf[i];
201 if(m_keystream_pos == shift)
void encrypt(const uint8_t in[], uint8_t out[]) const
size_t update_granularity() const overridefinal
const BlockCipher & cipher() const
size_t block_size() const
void finish(secure_vector< uint8_t > &final_block, size_t offset=0) override
std::string name() const overridefinal
secure_vector< uint8_t > m_keystream
size_t output_length(size_t input_length) const overridefinal
void update(secure_vector< uint8_t > &buffer, size_t offset=0)
#define BOTAN_STATE_CHECK(expr)
void reset() overridefinal
std::string to_string(const BER_Object &obj)
CFB_Mode(BlockCipher *cipher, size_t feedback_bits)
bool valid_nonce_length(size_t n) const overridefinal
std::vector< T, secure_allocator< T >> secure_vector
void xor_buf(uint8_t out[], const uint8_t in[], size_t length)
virtual std::string name() const =0
void finish(secure_vector< uint8_t > &final_block, size_t offset=0) override
size_t minimum_final_size() const overridefinal
Key_Length_Specification key_spec() const overridefinal
size_t default_nonce_length() const overridefinal
secure_vector< uint8_t > m_state
void copy_mem(T *out, const T *in, size_t n)
size_t process(uint8_t buf[], size_t size) override
void verify_key_set(bool cond) const
virtual Key_Length_Specification key_spec() const =0
void clear() overridefinal
size_t process(uint8_t buf[], size_t size) override
virtual size_t block_size() const =0
void zeroise(std::vector< T, Alloc > &vec)