Raven Core  3.0.0
P2P Digital Currency
sha512.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_SHA512_H
7 #define RAVEN_CRYPTO_SHA512_H
8 
9 #include <stdint.h>
10 #include <stdlib.h>
11 
13 class CSHA512
14 {
15 private:
16  uint64_t s[8];
17  unsigned char buf[128];
18  uint64_t bytes;
19 
20 public:
21  static const size_t OUTPUT_SIZE = 64;
22 
23  CSHA512();
24  CSHA512& Write(const unsigned char* data, size_t len);
25  void Finalize(unsigned char hash[OUTPUT_SIZE]);
26  CSHA512& Reset();
27 };
28 
29 #endif // RAVEN_CRYPTO_SHA512_H
uint64_t s[8]
Definition: sha512.h:16
void Finalize(unsigned char hash[OUTPUT_SIZE])
Definition: sha512.cpp:186
static const size_t OUTPUT_SIZE
Definition: sha512.h:21
unsigned char buf[128]
Definition: sha512.h:17
CSHA512 & Reset()
Definition: sha512.cpp:203
uint64_t bytes
Definition: sha512.h:18
CSHA512()
Definition: sha512.cpp:155
CSHA512 & Write(const unsigned char *data, size_t len)
Definition: sha512.cpp:160
A hasher class for SHA-512.
Definition: sha512.h:13