aboutsummaryrefslogtreecommitdiffstats
path: root/src/pk_pad/eme1/eme1.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-09-30 05:05:31 +0000
committerlloyd <[email protected]>2008-09-30 05:05:31 +0000
commitbc9e881d7c7a569664b5e753c12e4c8cbde06d2d (patch)
tree591c392a70a2dcd8459100ddb59f280b6b5bb905 /src/pk_pad/eme1/eme1.cpp
parent42e3fe73cb63fe92510964d60bfccded65d08c36 (diff)
Remove dependency on lookup.h from EME1. Now hardcoded to use MGF1 (the
only implemented MGF in Botan, and the only standardized MGF I even know of) with the same hash as generated Phash (you would always want this anyway).
Diffstat (limited to 'src/pk_pad/eme1/eme1.cpp')
-rw-r--r--src/pk_pad/eme1/eme1.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/pk_pad/eme1/eme1.cpp b/src/pk_pad/eme1/eme1.cpp
index 2ca10c166..b5f2af6d3 100644
--- a/src/pk_pad/eme1/eme1.cpp
+++ b/src/pk_pad/eme1/eme1.cpp
@@ -4,7 +4,7 @@
*************************************************/
#include <botan/eme1.h>
-#include <botan/lookup.h>
+#include <botan/mgf1.h>
#include <memory>
namespace Botan {
@@ -83,13 +83,11 @@ u32bit EME1::maximum_input_size(u32bit keybits) const
/*************************************************
* EME1 Constructor *
*************************************************/
-EME1::EME1(const std::string& hash_name, const std::string& mgf_name,
- const std::string& P) :
- HASH_LENGTH(output_length_of(hash_name))
+EME1::EME1(HashFunction* hash, const std::string& P) :
+ HASH_LENGTH(hash->OUTPUT_LENGTH)
{
- mgf = get_mgf(mgf_name + "(" + hash_name + ")");
- std::auto_ptr<HashFunction> hash(get_hash(hash_name));
Phash = hash->process(P);
+ mgf = new MGF1(hash);
}
}