Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

sha2_32.h
Go to the documentation of this file.
1 /*
2 * SHA-{224,256}
3 * (C) 1999-2011 Jack Lloyd
4 * 2007 FlexSecure GmbH
5 *
6 * Botan is released under the Simplified BSD License (see license.txt)
7 */
8
9 #ifndef BOTAN_SHA_224_256_H__
10 #define BOTAN_SHA_224_256_H__
11
12 #include <botan/mdx_hash.h>
13
14 namespace Botan {
15
16 /**
17 * SHA-224
18 */
19 class BOTAN_DLL SHA_224 final : public MDx_HashFunction
20 {
21 public:
22 std::string name() const override { return "SHA-224"; }
23 size_t output_length() const override { return 28; }
24 HashFunction* clone() const override { return new SHA_224; }
25
26 void clear() override;
27
28 SHA_224() : MDx_HashFunction(64, true, true), m_digest(8)
29 { clear(); }
30 private:
31 void compress_n(const uint8_t[], size_t blocks) override;
32 void copy_out(uint8_t[]) override;
33
34 secure_vector<uint32_t> m_digest;
35 };
36
37 /**
38 * SHA-256
39 */
40 class BOTAN_DLL SHA_256 final : public MDx_HashFunction
41 {
42 public:
43 std::string name() const override { return "SHA-256"; }
44 size_t output_length() const override { return 32; }
45 HashFunction* clone() const override { return new SHA_256; }
46
47 void clear() override;
48
49 SHA_256() : MDx_HashFunction(64, true, true), m_digest(8)
50 { clear(); }
51 private:
52 void compress_n(const uint8_t[], size_t blocks) override;
53 void copy_out(uint8_t[]) override;
54
55 secure_vector<uint32_t> m_digest;
56 };
57
58 }
59
60 #endif
Botan::SHA_224::name
std::string name() const override
Definition: sha2_32.h:22
Botan::SHA_256::name
std::string name() const override
Definition: sha2_32.h:43
Botan::SHA_256::clone
HashFunction * clone() const override
Definition: sha2_32.h:45
Botan::SHA_224::clone
HashFunction * clone() const override
Definition: sha2_32.h:24
Botan::SHA_224
Definition: sha2_32.h:19
Botan::secure_vector
std::vector< T, secure_allocator< T >> secure_vector
Definition: secmem.h:121
Botan::SHA_224::output_length
size_t output_length() const override
Definition: sha2_32.h:23
Botan::MDx_HashFunction
Definition: mdx_hash.h:18
Botan
Definition: alg_id.cpp:13
Botan::HashFunction
Definition: hash.h:19
Botan::SHA_256::SHA_256
SHA_256()
Definition: sha2_32.h:49
Botan::SHA_256
Definition: sha2_32.h:40
Botan::SHA_224::SHA_224
SHA_224()
Definition: sha2_32.h:28
Botan::SHA_256::output_length
size_t output_length() const override
Definition: sha2_32.h:44