Changeset View
Changeset View
Standalone View
Standalone View
src/crypto/sha512.h
Show All 10 Lines | |||||
/** A hasher class for SHA-512. */ | /** A hasher class for SHA-512. */ | ||||
class CSHA512 { | class CSHA512 { | ||||
private: | private: | ||||
uint64_t s[8]; | uint64_t s[8]; | ||||
uint8_t buf[128]; | uint8_t buf[128]; | ||||
uint64_t bytes; | uint64_t bytes; | ||||
public: | public: | ||||
static const size_t OUTPUT_SIZE = 64; | static constexpr size_t OUTPUT_SIZE = 64; | ||||
CSHA512(); | CSHA512(); | ||||
CSHA512 &Write(const uint8_t *data, size_t len); | CSHA512 &Write(const uint8_t *data, size_t len); | ||||
void Finalize(uint8_t hash[OUTPUT_SIZE]); | void Finalize(uint8_t hash[OUTPUT_SIZE]); | ||||
CSHA512 &Reset(); | CSHA512 &Reset(); | ||||
}; | }; | ||||
#endif // BITCOIN_CRYPTO_SHA512_H | #endif // BITCOIN_CRYPTO_SHA512_H |