diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/base.h | 80 | ||||
-rw-r--r-- | src/core/info.txt | 3 | ||||
-rw-r--r-- | src/core/stream_cipher.cpp (renamed from src/core/base.cpp) | 2 |
3 files changed, 3 insertions, 82 deletions
diff --git a/src/core/base.h b/src/core/base.h index d23a71471..8e4341713 100644 --- a/src/core/base.h +++ b/src/core/base.h @@ -12,11 +12,6 @@ namespace Botan { -/************************************************* -* Constants * -*************************************************/ -static const u32bit DEFAULT_BUFFERSIZE = BOTAN_DEFAULT_BUFFER_SIZE; - /** * This class represents a block cipher object. */ @@ -85,81 +80,6 @@ class BOTAN_DLL BlockCipher : public SymmetricAlgorithm virtual void dec(const byte[], byte[]) const = 0; }; -/************************************************* -* Stream Cipher * -*************************************************/ -class BOTAN_DLL StreamCipher : public SymmetricAlgorithm - { - public: - const u32bit IV_LENGTH; - - /** - * Encrypt a message. - * @param i the plaintext - * @param o the byte array to hold the output, i.e. the ciphertext - * @param len the length of both i and o - */ - void encrypt(const byte i[], byte o[], u32bit len) { cipher(i, o, len); } - - /** - * Decrypt a message. - * @param i the ciphertext to decrypt - * @param o the byte array to hold the output, i.e. the plaintext - * @param len the length of both i and o - */ - void decrypt(const byte i[], byte o[], u32bit len) { cipher(i, o, len); } - - /** - * Encrypt a message. - * @param in the plaintext as input, after the function has - * returned it will hold the ciphertext - - * @param len the length of in - */ - void encrypt(byte in[], u32bit len) { cipher(in, in, len); } - - /** - * Decrypt a message. - * @param in the ciphertext as input, after the function has - * returned it will hold the plaintext - * @param len the length of in - */ - void decrypt(byte in[], u32bit len) { cipher(in, in, len); } - - /** - * Resync the cipher using the IV - * @param iv the initialization vector - * @param iv_len the length of the IV in bytes - */ - virtual void resync(const byte iv[], u32bit iv_len); - - /** - * Seek ahead in the stream. - * @param len the length to seek ahead. - */ - virtual void seek(u32bit len); - - /** - * Get a new object representing the same algorithm as *this - */ - virtual StreamCipher* clone() const = 0; - - /** - * Zeroize internal state - */ - virtual void clear() throw() = 0; - - StreamCipher(u32bit key_min, u32bit key_max = 0, - u32bit key_mod = 1, - u32bit iv_len = 0) : - SymmetricAlgorithm(key_min, key_max, key_mod), - IV_LENGTH(iv_len) {} - - virtual ~StreamCipher() {} - private: - virtual void cipher(const byte[], byte[], u32bit) = 0; - }; - } #endif diff --git a/src/core/info.txt b/src/core/info.txt index d95e3e486..fd62867e0 100644 --- a/src/core/info.txt +++ b/src/core/info.txt @@ -15,7 +15,6 @@ timer <add> allocate.h -base.cpp base.h botan.h data_src.cpp @@ -33,4 +32,6 @@ secmem.h sym_algo.h symkey.cpp symkey.h +stream_cipher.h +stream_cipher.cpp </add> diff --git a/src/core/base.cpp b/src/core/stream_cipher.cpp index 846217d66..04bb54484 100644 --- a/src/core/base.cpp +++ b/src/core/stream_cipher.cpp @@ -3,7 +3,7 @@ * (C) 1999-2007 Jack Lloyd */ -#include <botan/base.h> +#include <botan/stream_cipher.h> namespace Botan { |