Botan
1.10.17
src
hash
sha1
sha160.h
Go to the documentation of this file.
1
/*
2
* SHA-160
3
* (C) 1999-2007 Jack Lloyd
4
*
5
* Distributed under the terms of the Botan license
6
*/
7
8
#ifndef BOTAN_SHA_160_H__
9
#define BOTAN_SHA_160_H__
10
11
#include <botan/mdx_hash.h>
12
13
namespace
Botan
{
14
15
/**
16
* NIST's SHA-160
17
*/
18
class
BOTAN_DLL
SHA_160
:
public
MDx_HashFunction
19
{
20
public
:
21
std::string
name
()
const
{
return
"SHA-160"
; }
22
size_t
output_length
()
const
{
return
20; }
23
HashFunction
*
clone
()
const
{
return
new
SHA_160
; }
24
25
void
clear();
26
27
SHA_160
() :
MDx_HashFunction
(64, true, true),
digest
(5),
W
(80)
28
{
29
clear
();
30
}
31
protected
:
32
/**
33
* Set a custom size for the W array. Normally 80, but some
34
* subclasses need slightly more for best performance/internal
35
* constraints
36
* @param W_size how big to make W
37
*/
38
SHA_160
(
size_t
W_size) :
39
MDx_HashFunction
(64, true, true),
digest
(5),
W
(W_size)
40
{
41
clear
();
42
}
43
44
void
compress_n(
const
byte
[],
size_t
blocks);
45
void
copy_out(
byte
[]);
46
47
/**
48
* The digest value, exposed for use by subclasses (asm, SSE2)
49
*/
50
SecureVector<u32bit>
digest
;
51
52
/**
53
* The message buffer, exposed for use by subclasses (asm, SSE2)
54
*/
55
SecureVector<u32bit>
W
;
56
};
57
58
}
59
60
#endif
Botan::HashFunction
Definition
hash.h:22
Botan::MDx_HashFunction::MDx_HashFunction
MDx_HashFunction(size_t block_length, bool big_byte_endian, bool big_bit_endian, size_t counter_size=8)
Definition
mdx_hash.cpp:17
Botan::SHA_160::output_length
size_t output_length() const
Definition
sha160.h:22
Botan::SHA_160::name
std::string name() const
Definition
sha160.h:21
Botan::SHA_160::W
SecureVector< u32bit > W
Definition
sha160.h:55
Botan::SHA_160::SHA_160
SHA_160(size_t W_size)
Definition
sha160.h:38
Botan::SHA_160::SHA_160
SHA_160()
Definition
sha160.h:27
Botan::SHA_160::digest
SecureVector< u32bit > digest
Definition
sha160.h:50
Botan::SHA_160::clear
void clear()
Definition
sha160.cpp:150
Botan::SHA_160::clone
HashFunction * clone() const
Definition
sha160.h:23
Botan::SecureVector
Definition
secmem.h:329
Botan
Definition
algo_base.h:14
Generated by
1.18.0