Botan: src/hash/sha2_64/sha2_64.h Source File

Botan 1.10.17

sha2_64.h
Go to the documentation of this file.
1 /*
2 * SHA-{384,512}
3 * (C) 1999-2010 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
6 */
7
8 #ifndef BOTAN_SHA_64BIT_H__
9 #define BOTAN_SHA_64BIT_H__
10
11 #include <botan/mdx_hash.h>
12
13 namespace Botan {
14
15 /**
16 * SHA-384
17 */
18 class BOTAN_DLL SHA_384 : public MDx_HashFunction
19 {
20 public:
21 std::string name() const { return "SHA-384"; }
22 size_t output_length() const { return 48; }
23 HashFunction* clone() const { return new SHA_384; }
24
25 void clear();
26
27 SHA_384() : MDx_HashFunction(128, true, true, 16), digest(8)
28 { clear(); }
29 private:
30 void compress_n(const byte[], size_t blocks);
31 void copy_out(byte[]);
32
33 SecureVector<u64bit> digest;
34 };
35
36 /**
37 * SHA-512
38 */
39 class BOTAN_DLL SHA_512 : public MDx_HashFunction
40 {
41 public:
42 std::string name() const { return "SHA-512"; }
43 size_t output_length() const { return 64; }
44 HashFunction* clone() const { return new SHA_512; }
45
46 void clear();
47
48 SHA_512() : MDx_HashFunction(128, true, true, 16), digest(8)
49 { clear(); }
50 private:
51 void compress_n(const byte[], size_t blocks);
52 void copy_out(byte[]);
53
54 SecureVector<u64bit> digest;
55 };
56
57 }
58
59 #endif
Botan::SHA_512::SHA_512
SHA_512()
Definition: sha2_64.h:48
Botan::SHA_384::clone
HashFunction * clone() const
Definition: sha2_64.h:23
Botan::byte
unsigned char byte
Definition: types.h:22
Botan::SHA_384::output_length
size_t output_length() const
Definition: sha2_64.h:22
Botan::SHA_384::SHA_384
SHA_384()
Definition: sha2_64.h:27
Botan::SHA_512::output_length
size_t output_length() const
Definition: sha2_64.h:43
Botan::SHA_512::clone
HashFunction * clone() const
Definition: sha2_64.h:44
Botan::SHA_384::name
std::string name() const
Definition: sha2_64.h:21
Botan::MDx_HashFunction
Definition: mdx_hash.h:18
Botan
Definition: algo_base.h:14
Botan::SHA_512::name
std::string name() const
Definition: sha2_64.h:42
Botan::HashFunction
Definition: hash.h:20
Botan::SecureVector< u64bit >
Botan::SHA_384
Definition: sha2_64.h:18
Botan::SHA_512
Definition: sha2_64.h:39