~zooko/cryptopp/trunk

« back to all changes in this revision

Viewing changes to sha.h

  • Committer: weidai
  • Date: 2005-01-20 04:19:35 UTC
  • Revision ID: svn-v4:57ff6487-cd31-0410-9ec3-f628ee90f5f0:trunk/c5:195
changes done for FIPS-140 lab code drop

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
NAMESPACE_BEGIN(CryptoPP)
7
7
 
8
8
/// <a href="http://www.weidai.com/scan-mirror/md.html#SHA-1">SHA-1</a>
9
 
class CRYPTOPP_DLL SHA : public IteratedHashWithStaticTransform<word32, BigEndian, 64, 20, SHA>
 
9
class CRYPTOPP_DLL SHA1 : public IteratedHashWithStaticTransform<word32, BigEndian, 64, 20, SHA1>
10
10
{
11
11
public:
12
12
        static void InitState(HashWordType *state);
13
13
        static void Transform(word32 *digest, const word32 *data);
14
 
        static const char *StaticAlgorithmName() {return "SHA-1";}
 
14
        static const char * CRYPTOPP_API StaticAlgorithmName() {return "SHA-1";}
15
15
};
16
16
 
17
 
typedef SHA SHA1;
 
17
typedef SHA1 SHA;       // for backwards compatibility
18
18
 
19
19
//! implements the SHA-256 standard
20
20
class CRYPTOPP_DLL SHA256 : public IteratedHashWithStaticTransform<word32, BigEndian, 64, 32, SHA256>
22
22
public:
23
23
        static void InitState(HashWordType *state);
24
24
        static void Transform(word32 *digest, const word32 *data);
25
 
        static const char *StaticAlgorithmName() {return "SHA-256";}
 
25
        static const char * CRYPTOPP_API StaticAlgorithmName() {return "SHA-256";}
26
26
 
27
27
protected:
28
28
        static const word32 K[64];
34
34
public:
35
35
        static void InitState(HashWordType *state);
36
36
        static void Transform(word32 *digest, const word32 *data) {SHA256::Transform(digest, data);}
37
 
        static const char *StaticAlgorithmName() {return "SHA-224";}
 
37
        static const char * CRYPTOPP_API StaticAlgorithmName() {return "SHA-224";}
38
38
};
39
39
 
40
40
#ifdef WORD64_AVAILABLE
45
45
public:
46
46
        static void InitState(HashWordType *state);
47
47
        static void Transform(word64 *digest, const word64 *data);
48
 
        static const char *StaticAlgorithmName() {return "SHA-512";}
 
48
        static const char * CRYPTOPP_API StaticAlgorithmName() {return "SHA-512";}
49
49
 
50
50
protected:
51
51
        static const word64 K[80];
57
57
public:
58
58
        static void InitState(HashWordType *state);
59
59
        static void Transform(word64 *digest, const word64 *data) {SHA512::Transform(digest, data);}
60
 
        static const char *StaticAlgorithmName() {return "SHA-384";}
 
60
        static const char * CRYPTOPP_API StaticAlgorithmName() {return "SHA-384";}
61
61
};
62
62
 
63
63
#endif