~ubuntu-branches/ubuntu/utopic/libcrypto++/utopic-security

« back to all changes in this revision

Viewing changes to sha.h

  • Committer: Bazaar Package Importer
  • Author(s): Jens Peter Secher
  • Date: 2009-04-28 23:23:21 UTC
  • mfrom: (5.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090428232321-wc1o1iipyb426h3x
Tags: 5.6.0-2
* Added a package with debug symbols.
* Drop the DCRYPTOPP_DISABLE_ASM flag to avoid segfault in amule on
  i386.
  (Closes: #525071)

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
typedef SHA1 SHA;       // for backwards compatibility
18
18
 
19
19
//! implements the SHA-256 standard
20
 
class CRYPTOPP_DLL SHA256 : public IteratedHashWithStaticTransform<word32, BigEndian, 64, 32, SHA256>
 
20
class CRYPTOPP_DLL SHA256 : public IteratedHashWithStaticTransform<word32, BigEndian, 64, 32, SHA256, 32, true>
21
21
{
22
22
public:
 
23
#if defined(CRYPTOPP_X86_ASM_AVAILABLE) || defined(CRYPTOPP_X64_MASM_AVAILABLE)
 
24
        size_t HashMultipleBlocks(const word32 *input, size_t length);
 
25
#endif
23
26
        static void CRYPTOPP_API InitState(HashWordType *state);
24
27
        static void CRYPTOPP_API Transform(word32 *digest, const word32 *data);
25
28
        static const char * CRYPTOPP_API StaticAlgorithmName() {return "SHA-256";}
26
29
};
27
30
 
28
31
//! implements the SHA-224 standard
29
 
class CRYPTOPP_DLL SHA224 : public IteratedHashWithStaticTransform<word32, BigEndian, 64, 32, SHA224, 28>
 
32
class CRYPTOPP_DLL SHA224 : public IteratedHashWithStaticTransform<word32, BigEndian, 64, 32, SHA224, 28, true>
30
33
{
31
34
public:
 
35
#if defined(CRYPTOPP_X86_ASM_AVAILABLE) || defined(CRYPTOPP_X64_MASM_AVAILABLE)
 
36
        size_t HashMultipleBlocks(const word32 *input, size_t length);
 
37
#endif
32
38
        static void CRYPTOPP_API InitState(HashWordType *state);
33
39
        static void CRYPTOPP_API Transform(word32 *digest, const word32 *data) {SHA256::Transform(digest, data);}
34
40
        static const char * CRYPTOPP_API StaticAlgorithmName() {return "SHA-224";}
35
41
};
36
42
 
37
 
#ifdef WORD64_AVAILABLE
38
 
 
39
43
//! implements the SHA-512 standard
40
 
class CRYPTOPP_DLL SHA512 : public IteratedHashWithStaticTransform<word64, BigEndian, 128, 64, SHA512>
 
44
class CRYPTOPP_DLL SHA512 : public IteratedHashWithStaticTransform<word64, BigEndian, 128, 64, SHA512, 64, CRYPTOPP_BOOL_X86>
41
45
{
42
46
public:
43
47
        static void CRYPTOPP_API InitState(HashWordType *state);
46
50
};
47
51
 
48
52
//! implements the SHA-384 standard
49
 
class CRYPTOPP_DLL SHA384 : public IteratedHashWithStaticTransform<word64, BigEndian, 128, 64, SHA384, 48>
 
53
class CRYPTOPP_DLL SHA384 : public IteratedHashWithStaticTransform<word64, BigEndian, 128, 64, SHA384, 48, CRYPTOPP_BOOL_X86>
50
54
{
51
55
public:
52
56
        static void CRYPTOPP_API InitState(HashWordType *state);
54
58
        static const char * CRYPTOPP_API StaticAlgorithmName() {return "SHA-384";}
55
59
};
56
60
 
57
 
#endif
58
 
 
59
61
NAMESPACE_END
60
62
 
61
63
#endif