monotone

monotone Mtn Source Tree

Root/botan/sha160.h

1/*************************************************
2* SHA-160 Header File *
3* (C) 1999-2005 The Botan Project *
4*************************************************/
5
6#ifndef BOTAN_SHA_160_H__
7#define BOTAN_SHA_160_H__
8
9#include <botan/mdx_hash.h>
10#if WITH_CRYPTO
11#include <openssl/sha.h>
12#endif
13
14namespace Botan {
15
16/*************************************************
17* SHA-160 *
18*************************************************/
19class SHA_160 : public MDx_HashFunction
20 {
21 public:
22 void clear() throw();
23 std::string name() const { return "SHA-160"; }
24 HashFunction* clone() const { return new SHA_160; }
25 SHA_160() : MDx_HashFunction(20, 64, true, true) { clear(); }
26 private:
27 friend class Gamma;
28 friend class FIPS_186_RNG;
29
30#if WITH_CRYPTO
31 virtual void add_data(const byte[], u32bit);
32 virtual void final_result(byte[]);
33 virtual void hash(const byte[]);
34 virtual void copy_out(byte[]);
35 virtual void write_count(byte[]);
36
37 SHA_CTX ctx;
38#else
39 virtual void hash(const byte[]);
40 virtual void copy_out(byte[]);
41 SecureBuffer<u32bit, 5> digest;
42 SecureBuffer<u32bit, 80> W;
43#endif
44 };
45
46}
47
48#endif

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status