9 #include <botan/internal/xor_buf.h>
57 void CTS_Encryption::encrypt(
const byte block[])
67 void CTS_Encryption::write(
const byte input[],
size_t length)
69 size_t copied = std::min<size_t>(buffer.
size() - position, length);
70 buffer.
copy(position, input, copied);
75 if(length == 0)
return;
94 buffer.
copy(position, input, length);
101 void CTS_Encryption::end_msg()
104 throw Encoding_Error(
name() +
": insufficient data to encrypt");
108 SecureVector<byte> cn = state;
159 void CTS_Decryption::decrypt(
const byte block[])
161 cipher->
decrypt(block, &temp[0]);
170 void CTS_Decryption::write(
const byte input[],
size_t length)
172 size_t copied = std::min<size_t>(buffer.
size() - position, length);
173 buffer.
copy(position, input, copied);
178 if(length == 0)
return;
197 buffer.
copy(position, input, length);
204 void CTS_Decryption::end_msg()
209 SecureVector<byte> xn = temp;
213 buffer.
size() - position);
void decrypt(const byte in[], byte out[]) const
bool valid_iv_length(size_t iv_len) const
void clear_mem(T *ptr, size_t n)
void copy(const T in[], size_t n)
SecureVector< byte > bits_of() const
void send(const byte in[], size_t length)
void set_iv(const InitializationVector &)
void set_key(const SymmetricKey &key)
void set_iv(const InitializationVector &)
void copy_mem(T *out, const T *in, size_t n)
CTS_Encryption(BlockCipher *cipher)
CTS_Decryption(BlockCipher *cipher)
void encrypt(const byte in[], byte out[]) const
bool valid_iv_length(size_t iv_len) const
void xor_buf(byte out[], const byte in[], size_t length)
void zeroise(MemoryRegion< T > &vec)
virtual size_t block_size() const =0
void set_key(const SymmetricKey &key)