summaryrefslogtreecommitdiff
path: root/sha.h
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2009-03-10 02:56:19 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2009-03-10 02:56:19 +0000
commitcc319dc33cc73b0ec368864a4220604170acb674 (patch)
tree1c52d52d455d3b48e60bfc8b075f4d611068be14 /sha.h
parent77d342339b3149f02aaa3521a27b6216468d43dc (diff)
downloadcryptopp-cc319dc33cc73b0ec368864a4220604170acb674.tar.gz
add x86/x64 assembly for SHA-256,
add DEFAULT_CHANNEL and AAD_CHANNEL, fix macChannel for AuthenticatedEncryptionFilter git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@440 57ff6487-cd31-0410-9ec3-f628ee90f5f0
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 09ef24a..ff580f6 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);