aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-11-08 18:39:55 +0000
committerlloyd <[email protected]>2008-11-08 18:39:55 +0000
commit75b427da41ece0a419f3f38dda187d89650de7ef (patch)
tree3658b9593fa2217ddf2ad56e5eccb7ea2f4d513d
parent65944fc591cd86f1048bca31c7f7b286be741d90 (diff)
Move the declaration of the HashFunction base class to a new header hash.h
(from base.h)
-rw-r--r--src/checksum/adler32/adler32.h2
-rw-r--r--src/checksum/crc24/crc24.h2
-rw-r--r--src/checksum/crc32/crc32.h2
-rw-r--r--src/cipher/lion/lion.h1
-rw-r--r--src/cipher/lubyrack/lubyrack.h1
-rw-r--r--src/core/base.cpp8
-rw-r--r--src/core/base.h33
-rw-r--r--src/core/botan.h1
-rw-r--r--src/core/hash.h51
-rw-r--r--src/core/info.txt1
-rw-r--r--src/filters/filters.h2
-rw-r--r--src/hash/mdx_hash/mdx_hash.h2
-rw-r--r--src/hash/par_hash/par_hash.h2
-rw-r--r--src/kdf/kdf1/kdf1.h2
-rw-r--r--src/kdf/kdf2/kdf2.h2
-rw-r--r--src/kdf/mgf1/mgf1.h2
-rw-r--r--src/libstate/engine.h1
-rw-r--r--src/libstate/lookup.h1
-rw-r--r--src/mac/hmac/hmac.h1
-rw-r--r--src/mac/ssl3mac/ssl3_mac.h2
-rw-r--r--src/pk_pad/eme1/eme1.h1
-rw-r--r--src/pk_pad/emsa1/emsa1.h1
-rw-r--r--src/pk_pad/emsa2/emsa2.h1
-rw-r--r--src/pk_pad/emsa3/emsa3.h1
-rw-r--r--src/pk_pad/emsa4/emsa4.h1
-rw-r--r--src/s2k/pbkdf1/pbkdf1.h2
-rw-r--r--src/s2k/pbkdf2/pbkdf2.h2
-rw-r--r--src/s2k/pgps2k/pgp_s2k.h2
28 files changed, 77 insertions, 53 deletions
diff --git a/src/checksum/adler32/adler32.h b/src/checksum/adler32/adler32.h
index 1abce690c..2151daa33 100644
--- a/src/checksum/adler32/adler32.h
+++ b/src/checksum/adler32/adler32.h
@@ -6,7 +6,7 @@
#ifndef BOTAN_ADLER32_H__
#define BOTAN_ADLER32_H__
-#include <botan/base.h>
+#include <botan/hash.h>
namespace Botan {
diff --git a/src/checksum/crc24/crc24.h b/src/checksum/crc24/crc24.h
index 919f860ce..6c65a6e85 100644
--- a/src/checksum/crc24/crc24.h
+++ b/src/checksum/crc24/crc24.h
@@ -6,7 +6,7 @@
#ifndef BOTAN_CRC24_H__
#define BOTAN_CRC24_H__
-#include <botan/base.h>
+#include <botan/hash.h>
namespace Botan {
diff --git a/src/checksum/crc32/crc32.h b/src/checksum/crc32/crc32.h
index 51939c6e1..bc97489be 100644
--- a/src/checksum/crc32/crc32.h
+++ b/src/checksum/crc32/crc32.h
@@ -6,7 +6,7 @@
#ifndef BOTAN_CRC32_H__
#define BOTAN_CRC32_H__
-#include <botan/base.h>
+#include <botan/hash.h>
namespace Botan {
diff --git a/src/cipher/lion/lion.h b/src/cipher/lion/lion.h
index 445682987..1f8e1ab9c 100644
--- a/src/cipher/lion/lion.h
+++ b/src/cipher/lion/lion.h
@@ -7,6 +7,7 @@
#define BOTAN_LION_H__
#include <botan/base.h>
+#include <botan/hash.h>
namespace Botan {
diff --git a/src/cipher/lubyrack/lubyrack.h b/src/cipher/lubyrack/lubyrack.h
index 2c4813cb6..c22fdde43 100644
--- a/src/cipher/lubyrack/lubyrack.h
+++ b/src/cipher/lubyrack/lubyrack.h
@@ -7,6 +7,7 @@
#define BOTAN_LUBY_RACKOFF_H__
#include <botan/base.h>
+#include <botan/hash.h>
namespace Botan {
diff --git a/src/core/base.cpp b/src/core/base.cpp
index eb38d0c85..0682affe9 100644
--- a/src/core/base.cpp
+++ b/src/core/base.cpp
@@ -76,14 +76,6 @@ BufferedComputation::BufferedComputation(u32bit olen) : OUTPUT_LENGTH(olen)
}
/*************************************************
-* HashFunction Constructor *
-*************************************************/
-HashFunction::HashFunction(u32bit hlen, u32bit blen) :
- BufferedComputation(hlen), HASH_BLOCK_SIZE(blen)
- {
- }
-
-/*************************************************
* MessageAuthenticationCode Constructor *
*************************************************/
MessageAuthenticationCode::MessageAuthenticationCode(u32bit mlen,
diff --git a/src/core/base.h b/src/core/base.h
index b715ee59b..b7b50c402 100644
--- a/src/core/base.h
+++ b/src/core/base.h
@@ -299,39 +299,6 @@ class BOTAN_DLL BufferedComputation
};
/**
-* This class represents hash function (message digest) objects.
-*/
-class BOTAN_DLL HashFunction : public BufferedComputation
- {
- public:
- /**
- * The hash block size as defined for this algorithm.
- */
- const u32bit HASH_BLOCK_SIZE;
-
- /**
- * Get a new object representing the same algorithm as *this
- */
- virtual HashFunction* clone() const = 0;
-
- /**
- * Get the name of this algorithm.
- * @return the name of this algorithm
- */
- virtual std::string name() const = 0;
-
- /**
- * Reset the internal state of this object.
- */
- virtual void clear() throw() = 0;
-
- HashFunction(u32bit, u32bit = 0);
- virtual ~HashFunction() {}
- private:
- HashFunction& operator=(const HashFunction&);
- };
-
-/**
* This class represents Message Authentication Code (MAC) objects.
*/
class BOTAN_DLL MessageAuthenticationCode : public BufferedComputation,
diff --git a/src/core/botan.h b/src/core/botan.h
index 97b7dc1a3..8f18f93be 100644
--- a/src/core/botan.h
+++ b/src/core/botan.h
@@ -4,6 +4,7 @@
*************************************************/
#include <botan/base.h>
+#include <botan/hash.h>
#include <botan/rng.h>
#include <botan/init.h>
#include <botan/lookup.h>
diff --git a/src/core/hash.h b/src/core/hash.h
new file mode 100644
index 000000000..9d4013b75
--- /dev/null
+++ b/src/core/hash.h
@@ -0,0 +1,51 @@
+/**
+* Hash Function Base Class
+* (C) 1999-2008 Jack Lloyd
+*/
+
+#ifndef BOTAN_HASH_FUNCTION_BASE_CLASS_H__
+#define BOTAN_HASH_FUNCTION_BASE_CLASS_H__
+
+#include <botan/types.h>
+#include <botan/base.h>
+#include <string>
+
+namespace Botan {
+
+/**
+* This class represents hash function (message digest) objects.
+*/
+class BOTAN_DLL HashFunction : public BufferedComputation
+ {
+ public:
+ /**
+ * The hash block size as defined for this algorithm.
+ */
+ const u32bit HASH_BLOCK_SIZE;
+
+ /**
+ * Get a new object representing the same algorithm as *this
+ */
+ virtual HashFunction* clone() const = 0;
+
+ /**
+ * Get the name of this algorithm.
+ * @return the name of this algorithm
+ */
+ virtual std::string name() const = 0;
+
+ /**
+ * Reset the internal state of this object.
+ */
+ virtual void clear() throw() = 0;
+
+ HashFunction(u32bit hash_len, u32bit block_len = 0) :
+ BufferedComputation(hash_len), HASH_BLOCK_SIZE(block_len) {}
+ virtual ~HashFunction() {}
+ private:
+ HashFunction& operator=(const HashFunction&);
+ };
+
+}
+
+#endif
diff --git a/src/core/info.txt b/src/core/info.txt
index a4cdfbf2b..34705048b 100644
--- a/src/core/info.txt
+++ b/src/core/info.txt
@@ -25,6 +25,7 @@ defalloc.h
enums.h
exceptn.cpp
exceptn.h
+hash.h
mem_pool.cpp
mem_pool.h
mutex.h
diff --git a/src/filters/filters.h b/src/filters/filters.h
index 267a84f6a..dc9e22308 100644
--- a/src/filters/filters.h
+++ b/src/filters/filters.h
@@ -7,6 +7,8 @@
#define BOTAN_FILTERS_H__
#include <botan/pipe.h>
+#include <botan/base.h>
+#include <botan/hash.h>
#include <botan/basefilt.h>
#include <botan/data_snk.h>
diff --git a/src/hash/mdx_hash/mdx_hash.h b/src/hash/mdx_hash/mdx_hash.h
index 84f92493b..b07a78de7 100644
--- a/src/hash/mdx_hash/mdx_hash.h
+++ b/src/hash/mdx_hash/mdx_hash.h
@@ -6,7 +6,7 @@
#ifndef BOTAN_MDX_BASE_H__
#define BOTAN_MDX_BASE_H__
-#include <botan/base.h>
+#include <botan/hash.h>
namespace Botan {
diff --git a/src/hash/par_hash/par_hash.h b/src/hash/par_hash/par_hash.h
index 844a6fb50..e794f0704 100644
--- a/src/hash/par_hash/par_hash.h
+++ b/src/hash/par_hash/par_hash.h
@@ -6,7 +6,7 @@
#ifndef BOTAN_PAR_HASH_H__
#define BOTAN_PAR_HASH_H__
-#include <botan/base.h>
+#include <botan/hash.h>
#include <vector>
namespace Botan {
diff --git a/src/kdf/kdf1/kdf1.h b/src/kdf/kdf1/kdf1.h
index 1c1fd7839..6099bdd4b 100644
--- a/src/kdf/kdf1/kdf1.h
+++ b/src/kdf/kdf1/kdf1.h
@@ -7,7 +7,7 @@
#define BOTAN_KDF1_H__
#include <botan/kdf.h>
-#include <botan/base.h>
+#include <botan/hash.h>
namespace Botan {
diff --git a/src/kdf/kdf2/kdf2.h b/src/kdf/kdf2/kdf2.h
index 844057ab3..8aca285a6 100644
--- a/src/kdf/kdf2/kdf2.h
+++ b/src/kdf/kdf2/kdf2.h
@@ -7,7 +7,7 @@
#define BOTAN_KDF2_H__
#include <botan/kdf.h>
-#include <botan/base.h>
+#include <botan/hash.h>
namespace Botan {
diff --git a/src/kdf/mgf1/mgf1.h b/src/kdf/mgf1/mgf1.h
index dee762f3b..e5cbe1d0f 100644
--- a/src/kdf/mgf1/mgf1.h
+++ b/src/kdf/mgf1/mgf1.h
@@ -7,7 +7,7 @@
#define BOTAN_MGF1_H__
#include <botan/kdf.h>
-#include <botan/base.h>
+#include <botan/hash.h>
namespace Botan {
diff --git a/src/libstate/engine.h b/src/libstate/engine.h
index af0fb67e1..10648943b 100644
--- a/src/libstate/engine.h
+++ b/src/libstate/engine.h
@@ -7,6 +7,7 @@
#define BOTAN_ENGINE_H__
#include <botan/base.h>
+#include <botan/hash.h>
#include <botan/mutex.h>
#include <botan/pow_mod.h>
#include <botan/basefilt.h>
diff --git a/src/libstate/lookup.h b/src/libstate/lookup.h
index 1accc82e2..f45f49033 100644
--- a/src/libstate/lookup.h
+++ b/src/libstate/lookup.h
@@ -7,6 +7,7 @@
#define BOTAN_LOOKUP_H__
#include <botan/base.h>
+#include <botan/hash.h>
#include <botan/enums.h>
#include <botan/filters.h>
#include <botan/mode_pad.h>
diff --git a/src/mac/hmac/hmac.h b/src/mac/hmac/hmac.h
index 67ebc4190..8c19cec6a 100644
--- a/src/mac/hmac/hmac.h
+++ b/src/mac/hmac/hmac.h
@@ -7,6 +7,7 @@
#define BOTAN_HMAC_H__
#include <botan/base.h>
+#include <botan/hash.h>
namespace Botan {
diff --git a/src/mac/ssl3mac/ssl3_mac.h b/src/mac/ssl3mac/ssl3_mac.h
index cd06bf44e..769602aa3 100644
--- a/src/mac/ssl3mac/ssl3_mac.h
+++ b/src/mac/ssl3mac/ssl3_mac.h
@@ -6,7 +6,7 @@
#ifndef BOTAN_SSL3_MAC_H__
#define BOTAN_SSL3_MAC_H__
-#include <botan/base.h>
+#include <botan/hash.h>
namespace Botan {
diff --git a/src/pk_pad/eme1/eme1.h b/src/pk_pad/eme1/eme1.h
index e33b0e917..206f6e168 100644
--- a/src/pk_pad/eme1/eme1.h
+++ b/src/pk_pad/eme1/eme1.h
@@ -8,6 +8,7 @@
#include <botan/pk_pad.h>
#include <botan/kdf.h>
+#include <botan/hash.h>
namespace Botan {
diff --git a/src/pk_pad/emsa1/emsa1.h b/src/pk_pad/emsa1/emsa1.h
index 8a15e2bfe..6b058438c 100644
--- a/src/pk_pad/emsa1/emsa1.h
+++ b/src/pk_pad/emsa1/emsa1.h
@@ -7,6 +7,7 @@
#define BOTAN_EMSA1_H__
#include <botan/pk_pad.h>
+#include <botan/hash.h>
namespace Botan {
diff --git a/src/pk_pad/emsa2/emsa2.h b/src/pk_pad/emsa2/emsa2.h
index d35cfe1aa..9d7f6c962 100644
--- a/src/pk_pad/emsa2/emsa2.h
+++ b/src/pk_pad/emsa2/emsa2.h
@@ -7,6 +7,7 @@
#define BOTAN_EMSA2_H__
#include <botan/pk_pad.h>
+#include <botan/hash.h>
namespace Botan {
diff --git a/src/pk_pad/emsa3/emsa3.h b/src/pk_pad/emsa3/emsa3.h
index 7c0d87147..a994f636e 100644
--- a/src/pk_pad/emsa3/emsa3.h
+++ b/src/pk_pad/emsa3/emsa3.h
@@ -7,6 +7,7 @@
#define BOTAN_EMSA3_H__
#include <botan/pk_pad.h>
+#include <botan/hash.h>
namespace Botan {
diff --git a/src/pk_pad/emsa4/emsa4.h b/src/pk_pad/emsa4/emsa4.h
index dded20ec3..37b783bfe 100644
--- a/src/pk_pad/emsa4/emsa4.h
+++ b/src/pk_pad/emsa4/emsa4.h
@@ -7,6 +7,7 @@
#define BOTAN_EMSA4_H__
#include <botan/pk_pad.h>
+#include <botan/hash.h>
#include <botan/kdf.h>
namespace Botan {
diff --git a/src/s2k/pbkdf1/pbkdf1.h b/src/s2k/pbkdf1/pbkdf1.h
index 99d0188db..ccc0a61fe 100644
--- a/src/s2k/pbkdf1/pbkdf1.h
+++ b/src/s2k/pbkdf1/pbkdf1.h
@@ -7,7 +7,7 @@
#define BOTAN_PBKDF1_H__
#include <botan/s2k.h>
-#include <botan/base.h>
+#include <botan/hash.h>
namespace Botan {
diff --git a/src/s2k/pbkdf2/pbkdf2.h b/src/s2k/pbkdf2/pbkdf2.h
index 1b27c5acb..52148df2f 100644
--- a/src/s2k/pbkdf2/pbkdf2.h
+++ b/src/s2k/pbkdf2/pbkdf2.h
@@ -7,7 +7,7 @@
#define BOTAN_PBKDF2_H__
#include <botan/s2k.h>
-#include <botan/base.h>
+#include <botan/hash.h>
namespace Botan {
diff --git a/src/s2k/pgps2k/pgp_s2k.h b/src/s2k/pgps2k/pgp_s2k.h
index 80fd3ab29..412ff4281 100644
--- a/src/s2k/pgps2k/pgp_s2k.h
+++ b/src/s2k/pgps2k/pgp_s2k.h
@@ -7,7 +7,7 @@
#define BOTAN_OPENPGP_S2K_H__
#include <botan/s2k.h>
-#include <botan/base.h>
+#include <botan/hash.h>
namespace Botan {