mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-15 16:02:43 +00:00
Avoid VLA in hash.h
Github-Pull: #9791 Rebased-From: 5c8fd508112016c3821b71112270afe83e6949ac
This commit is contained in:
parent
289204fbe0
commit
1825a03f81
@ -25,9 +25,9 @@ public:
|
||||
static const size_t OUTPUT_SIZE = CSHA256::OUTPUT_SIZE;
|
||||
|
||||
void Finalize(unsigned char hash[OUTPUT_SIZE]) {
|
||||
unsigned char buf[sha.OUTPUT_SIZE];
|
||||
unsigned char buf[CSHA256::OUTPUT_SIZE];
|
||||
sha.Finalize(buf);
|
||||
sha.Reset().Write(buf, sha.OUTPUT_SIZE).Finalize(hash);
|
||||
sha.Reset().Write(buf, CSHA256::OUTPUT_SIZE).Finalize(hash);
|
||||
}
|
||||
|
||||
CHash256& Write(const unsigned char *data, size_t len) {
|
||||
@ -49,9 +49,9 @@ public:
|
||||
static const size_t OUTPUT_SIZE = CRIPEMD160::OUTPUT_SIZE;
|
||||
|
||||
void Finalize(unsigned char hash[OUTPUT_SIZE]) {
|
||||
unsigned char buf[sha.OUTPUT_SIZE];
|
||||
unsigned char buf[CSHA256::OUTPUT_SIZE];
|
||||
sha.Finalize(buf);
|
||||
CRIPEMD160().Write(buf, sha.OUTPUT_SIZE).Finalize(hash);
|
||||
CRIPEMD160().Write(buf, CSHA256::OUTPUT_SIZE).Finalize(hash);
|
||||
}
|
||||
|
||||
CHash160& Write(const unsigned char *data, size_t len) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user