Botan 1.10.17
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* Distributed under the terms of the Botan license
7*/
8
9#ifndef BOTAN_SHA_224_256_H__
10#define BOTAN_SHA_224_256_H__
11
12#include <botan/mdx_hash.h>
13
14namespace Botan {
15
16/**
17* SHA-224
18*/
19class BOTAN_DLL SHA_224 : public MDx_HashFunction
20 {
21 public:
22 std::string name() const { return "SHA-224"; }
23 size_t output_length() const { return 28; }
24 HashFunction* clone() const { return new SHA_224; }
25
26 void clear();
27
28 SHA_224() : MDx_HashFunction(64, true, true), digest(8)
29 { clear(); }
30 private:
31 void compress_n(const byte[], size_t blocks);
32 void copy_out(byte[]);
33
35 };
36
37/**
38* SHA-256
39*/
40class BOTAN_DLL SHA_256 : public MDx_HashFunction
41 {
42 public:
43 std::string name() const { return "SHA-256"; }
44 size_t output_length() const { return 32; }
45 HashFunction* clone() const { return new SHA_256; }
46
47 void clear();
48
49 SHA_256() : MDx_HashFunction(64, true, true), digest(8)
50 { clear(); }
51 private:
52 void compress_n(const byte[], size_t blocks);
53 void copy_out(byte[]);
54
56 };
57
58}
59
60#endif
MDx_HashFunction(size_t block_length, bool big_byte_endian, bool big_bit_endian, size_t counter_size=8)
Definition mdx_hash.cpp:17
std::string name() const
Definition sha2_32.h:22
HashFunction * clone() const
Definition sha2_32.h:24
size_t output_length() const
Definition sha2_32.h:23
size_t output_length() const
Definition sha2_32.h:44
std::string name() const
Definition sha2_32.h:43
HashFunction * clone() const
Definition sha2_32.h:45