BSHA3  0.17.99
P2P Blockchain, based on Bitcoin
sha3512.cpp
Go to the documentation of this file.
1 // Copyright (c) 2018 BSHA3 Developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #include <crypto/sha3512.h>
6 
7 #include <crypto/common.h>
8 
9 #include <string.h>
10 
11 // Internal implementation code.
12 namespace
13 {
15 namespace sha3512
16 {
17  // (See crypto/keccak/SHA3)
18 
19 } // namespace sha3512
20 
21 } // namespace
22 
24 
25 CSHA3512::CSHA3512() : sha3Hasher()
26 {
27  sha3Hasher.clear(); // or reset()
28 }
29 
30 CSHA3512& CSHA3512::Write(const unsigned char* data, size_t len)
31 {
32  sha3Hasher.update(data, len);
33  return *this;
34 }
35 
36 void CSHA3512::Finalize(unsigned char hash[OUTPUT_SIZE])
37 {
39 }
40 
42 {
43  sha3Hasher.reset();
44  return *this;
45 }
CSHA3512 & Write(const unsigned char *data, size_t len)
Definition: sha3512.cpp:30
static const size_t OUTPUT_SIZE
Definition: sha3512.h:23
SHA3_512 sha3Hasher
Definition: sha3512.h:20
void clear()
Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing ...
Definition: SHA3.cpp:150
void Finalize(unsigned char hash[OUTPUT_SIZE])
Definition: sha3512.cpp:36
Internal SHA-3-512 implementation.
Definition: sha3512.cpp:15
CSHA3512()
Definition: sha3512.cpp:25
A hasher class for SHA3-512.
Definition: sha3512.h:14
void update(const void *data, size_t len)
Updates the hash with more data.
Definition: SHA3.cpp:138
CSHA3512 & Reset()
Definition: sha3512.cpp:41
void reset()
Resets the hash ready for a new hashing process.
Definition: SHA3.cpp:133
void finalize(void *hash, size_t len)
Finalizes the hashing process and returns the hash.
Definition: SHA3.cpp:143