From bc9e881d7c7a569664b5e753c12e4c8cbde06d2d Mon Sep 17 00:00:00 2001 From: lloyd Date: Tue, 30 Sep 2008 05:05:31 +0000 Subject: 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). --- src/pk_pad/eme1/eme1.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/pk_pad/eme1/eme1.cpp') 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 -#include +#include #include 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 hash(get_hash(hash_name)); Phash = hash->process(P); + mgf = new MGF1(hash); } } -- cgit v1.2.3