summaryrefslogtreecommitdiff
path: root/sha.h
diff options
context:
space:
mode:
authorweidai <weidai11@users.noreply.github.com>2009-03-10 02:56:19 +0000
committerweidai <weidai11@users.noreply.github.com>2009-03-10 02:56:19 +0000
commit8ca6148ad5a4943ab05491d7f02152351e650f43 (patch)
tree1c52d52d455d3b48e60bfc8b075f4d611068be14 /sha.h
parentda24db2a8b834ba3c3ee5c54041ff3782e9c1984 (diff)
downloadcryptopp-git-8ca6148ad5a4943ab05491d7f02152351e650f43.tar.gz
add x86/x64 assembly for SHA-256,
add DEFAULT_CHANNEL and AAD_CHANNEL, fix macChannel for AuthenticatedEncryptionFilter
Diffstat (limited to 'sha.h')
-rw-r--r--sha.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/sha.h b/sha.h
index 09ef24ae..ff580f6a 100644
--- a/sha.h
+++ b/sha.h
@@ -17,25 +17,31 @@ public:
typedef SHA1 SHA; // for backwards compatibility
//! implements the SHA-256 standard
-class CRYPTOPP_DLL SHA256 : public IteratedHashWithStaticTransform<word32, BigEndian, 64, 32, SHA256>
+class CRYPTOPP_DLL SHA256 : public IteratedHashWithStaticTransform<word32, BigEndian, 64, 32, SHA256, 32, CRYPTOPP_BOOL_X86||CRYPTOPP_BOOL_X64>
{
public:
+#if defined(CRYPTOPP_X86_ASM_AVAILABLE) || defined(CRYPTOPP_X64_MASM_AVAILABLE)
+ size_t HashMultipleBlocks(const word32 *input, size_t length);
+#endif
static void CRYPTOPP_API InitState(HashWordType *state);
static void CRYPTOPP_API Transform(word32 *digest, const word32 *data);
static const char * CRYPTOPP_API StaticAlgorithmName() {return "SHA-256";}
};
//! implements the SHA-224 standard
-class CRYPTOPP_DLL SHA224 : public IteratedHashWithStaticTransform<word32, BigEndian, 64, 32, SHA224, 28>
+class CRYPTOPP_DLL SHA224 : public IteratedHashWithStaticTransform<word32, BigEndian, 64, 32, SHA224, 28, CRYPTOPP_BOOL_X86||CRYPTOPP_BOOL_X64>
{
public:
+#if defined(CRYPTOPP_X86_ASM_AVAILABLE) || defined(CRYPTOPP_X64_MASM_AVAILABLE)
+ size_t HashMultipleBlocks(const word32 *input, size_t length);
+#endif
static void CRYPTOPP_API InitState(HashWordType *state);
static void CRYPTOPP_API Transform(word32 *digest, const word32 *data) {SHA256::Transform(digest, data);}
static const char * CRYPTOPP_API StaticAlgorithmName() {return "SHA-224";}
};
//! implements the SHA-512 standard
-class CRYPTOPP_DLL SHA512 : public IteratedHashWithStaticTransform<word64, BigEndian, 128, 64, SHA512>
+class CRYPTOPP_DLL SHA512 : public IteratedHashWithStaticTransform<word64, BigEndian, 128, 64, SHA512, 64, CRYPTOPP_BOOL_X86>
{
public:
static void CRYPTOPP_API InitState(HashWordType *state);
@@ -44,7 +50,7 @@ public:
};
//! implements the SHA-384 standard
-class CRYPTOPP_DLL SHA384 : public IteratedHashWithStaticTransform<word64, BigEndian, 128, 64, SHA384, 48>
+class CRYPTOPP_DLL SHA384 : public IteratedHashWithStaticTransform<word64, BigEndian, 128, 64, SHA384, 48, CRYPTOPP_BOOL_X86>
{
public:
static void CRYPTOPP_API InitState(HashWordType *state);