aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/base.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-11-08 19:42:16 +0000
committerlloyd <[email protected]>2008-11-08 19:42:16 +0000
commit8dba7b5264403e781bbb86ff61850e4377dca7b9 (patch)
tree5e784f8e4bbf0ed423e850600adaef3eda4cd07d /src/core/base.h
parent8f86d41613db588e4912fd23a61f7c6b3947e32a (diff)
Split base.h into block_cipher.h and stream_cipher.h
It turned out many files were including base.h merely to get other includes (like types.h, secmem.h, and exceptn.h). Those have been changed to directly include the files containing the declarations that code needs.
Diffstat (limited to 'src/core/base.h')
-rw-r--r--src/core/base.h85
1 files changed, 0 insertions, 85 deletions
diff --git a/src/core/base.h b/src/core/base.h
deleted file mode 100644
index 8e4341713..000000000
--- a/src/core/base.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*************************************************
-* Base Classes Header File *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
-
-#ifndef BOTAN_BASE_H__
-#define BOTAN_BASE_H__
-
-#include <botan/exceptn.h>
-#include <botan/symkey.h>
-#include <botan/sym_algo.h>
-
-namespace Botan {
-
-/**
-* This class represents a block cipher object.
-*/
-class BOTAN_DLL BlockCipher : public SymmetricAlgorithm
- {
- public:
- /**
- * The block size of this algorithm.
- */
- const u32bit BLOCK_SIZE;
-
- /**
- * Encrypt a block.
- * @param in The plaintext block to be encrypted as a byte array.
- * Must be of length BLOCK_SIZE.
- * @param out The byte array designated to hold the encrypted block.
- * Must be of length BLOCK_SIZE.
- */
- void encrypt(const byte in[], byte out[]) const { enc(in, out); }
-
- /**
- * Decrypt a block.
- * @param in The ciphertext block to be decypted as a byte array.
- * Must be of length BLOCK_SIZE.
- * @param out The byte array designated to hold the decrypted block.
- * Must be of length BLOCK_SIZE.
- */
- void decrypt(const byte in[], byte out[]) const { dec(in, out); }
-
- /**
- * Encrypt a block.
- * @param in The plaintext block to be encrypted as a byte array.
- * Must be of length BLOCK_SIZE. Will hold the result when the function
- * has finished.
- */
- void encrypt(byte block[]) const { enc(block, block); }
-
- /**
- * Decrypt a block.
- * @param in The ciphertext block to be decrypted as a byte array.
- * Must be of length BLOCK_SIZE. Will hold the result when the function
- * has finished.
- */
- void decrypt(byte block[]) const { dec(block, block); }
-
- /**
- * Get a new object representing the same algorithm as *this
- */
- virtual BlockCipher* clone() const = 0;
-
- /**
- * Zeroize internal state
- */
- virtual void clear() throw() = 0;
-
- BlockCipher(u32bit block_size,
- u32bit key_min,
- u32bit key_max = 0,
- u32bit key_mod = 1) :
- SymmetricAlgorithm(key_min, key_max, key_mod),
- BLOCK_SIZE(block_size) {}
-
- virtual ~BlockCipher() {}
- private:
- virtual void enc(const byte[], byte[]) const = 0;
- virtual void dec(const byte[], byte[]) const = 0;
- };
-
-}
-
-#endif