diff options
author | lloyd <[email protected]> | 2010-09-30 18:42:42 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-09-30 18:42:42 +0000 |
commit | 63bc6e8971f66233f4e05bb8d7f7db9afd7ba7f4 (patch) | |
tree | 0dcb7fa1934bf1e84f1567f80a926ecfe7d9a1b6 | |
parent | d45c828067598fc44eff08333c23af413ab2a455 (diff) |
Split SHA-2 into 32 and 64 bit versions; they are totally independent
of each other anyway.
-rw-r--r-- | src/engine/core_engine/lookup_hash.cpp | 9 | ||||
-rw-r--r-- | src/hash/sha2_32/info.txt (renamed from src/hash/sha2/info.txt) | 2 | ||||
-rw-r--r-- | src/hash/sha2_32/sha2_32.cpp (renamed from src/hash/sha2/sha2_32.cpp) | 0 | ||||
-rw-r--r-- | src/hash/sha2_32/sha2_32.h (renamed from src/hash/sha2/sha2_32.h) | 0 | ||||
-rw-r--r-- | src/hash/sha2_64/info.txt | 5 | ||||
-rw-r--r-- | src/hash/sha2_64/sha2_64.cpp (renamed from src/hash/sha2/sha2_64.cpp) | 0 | ||||
-rw-r--r-- | src/hash/sha2_64/sha2_64.h (renamed from src/hash/sha2/sha2_64.h) | 0 |
7 files changed, 13 insertions, 3 deletions
diff --git a/src/engine/core_engine/lookup_hash.cpp b/src/engine/core_engine/lookup_hash.cpp index 1524015dd..705b16b87 100644 --- a/src/engine/core_engine/lookup_hash.cpp +++ b/src/engine/core_engine/lookup_hash.cpp @@ -58,8 +58,10 @@ #include <botan/sha160.h> #endif -#if defined(BOTAN_HAS_SHA2) +#if defined(BOTAN_HAS_SHA2_32) #include <botan/sha2_32.h> + +#if defined(BOTAN_HAS_SHA2_64) #include <botan/sha2_64.h> #endif @@ -151,11 +153,14 @@ HashFunction* Core_Engine::find_hash(const SCAN_Name& request, return new SHA_160; #endif -#if defined(BOTAN_HAS_SHA2) +#if defined(BOTAN_HAS_SHA2_32) if(request.algo_name() == "SHA-224") return new SHA_224; if(request.algo_name() == "SHA-256") return new SHA_256; +#endif + +#if defined(BOTAN_HAS_SHA2_64) if(request.algo_name() == "SHA-384") return new SHA_384; if(request.algo_name() == "SHA-512") diff --git a/src/hash/sha2/info.txt b/src/hash/sha2_32/info.txt index e12f2b694..2f0b8a7ee 100644 --- a/src/hash/sha2/info.txt +++ b/src/hash/sha2_32/info.txt @@ -1,4 +1,4 @@ -define SHA2 +define SHA2_32 <requires> mdx_hash diff --git a/src/hash/sha2/sha2_32.cpp b/src/hash/sha2_32/sha2_32.cpp index acd06061e..acd06061e 100644 --- a/src/hash/sha2/sha2_32.cpp +++ b/src/hash/sha2_32/sha2_32.cpp diff --git a/src/hash/sha2/sha2_32.h b/src/hash/sha2_32/sha2_32.h index a3e3a6f19..a3e3a6f19 100644 --- a/src/hash/sha2/sha2_32.h +++ b/src/hash/sha2_32/sha2_32.h diff --git a/src/hash/sha2_64/info.txt b/src/hash/sha2_64/info.txt new file mode 100644 index 000000000..02e9971ce --- /dev/null +++ b/src/hash/sha2_64/info.txt @@ -0,0 +1,5 @@ +define SHA2_64 + +<requires> +mdx_hash +</requires> diff --git a/src/hash/sha2/sha2_64.cpp b/src/hash/sha2_64/sha2_64.cpp index 5ca78173c..5ca78173c 100644 --- a/src/hash/sha2/sha2_64.cpp +++ b/src/hash/sha2_64/sha2_64.cpp diff --git a/src/hash/sha2/sha2_64.h b/src/hash/sha2_64/sha2_64.h index 726712221..726712221 100644 --- a/src/hash/sha2/sha2_64.h +++ b/src/hash/sha2_64/sha2_64.h |