Raven Core  3.0.0
P2P Digital Currency
sha1.h
Go to the documentation of this file.
1 // Copyright (c) 2014-2016 The Bitcoin Core developers
2 // Copyright (c) 2017-2019 The Raven Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #ifndef RAVEN_CRYPTO_SHA1_H
7 #define RAVEN_CRYPTO_SHA1_H
8 
9 #include <stdint.h>
10 #include <stdlib.h>
11 
13 class CSHA1
14 {
15 private:
16  uint32_t s[5];
17  unsigned char buf[64];
18  uint64_t bytes;
19 
20 public:
21  static const size_t OUTPUT_SIZE = 20;
22 
23  CSHA1();
24  CSHA1& Write(const unsigned char* data, size_t len);
25  void Finalize(unsigned char hash[OUTPUT_SIZE]);
26  CSHA1& Reset();
27 };
28 
29 #endif // RAVEN_CRYPTO_SHA1_H
CSHA1 & Write(const unsigned char *data, size_t len)
Definition: sha1.cpp:155
uint64_t bytes
Definition: sha1.h:18
unsigned char buf[64]
Definition: sha1.h:17
CSHA1()
Definition: sha1.cpp:150
CSHA1 & Reset()
Definition: sha1.cpp:195
void Finalize(unsigned char hash[OUTPUT_SIZE])
Definition: sha1.cpp:181
uint32_t s[5]
Definition: sha1.h:16
A hasher class for SHA1.
Definition: sha1.h:13
static const size_t OUTPUT_SIZE
Definition: sha1.h:21