mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-14 06:32:33 +01:00
Add built-in RIPEMD-160 implementation
This commit is contained in:
@@ -7,14 +7,13 @@
|
||||
#define BITCOIN_HASH_H
|
||||
|
||||
#include "crypto/sha2.h"
|
||||
#include "crypto/ripemd160.h"
|
||||
#include "serialize.h"
|
||||
#include "uint256.h"
|
||||
#include "version.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <openssl/ripemd.h>
|
||||
|
||||
/** A hasher class for Bitcoin's 256-bit hash (double SHA-256). */
|
||||
class CHash256 {
|
||||
private:
|
||||
@@ -45,7 +44,7 @@ public:
|
||||
void Finalize(unsigned char *hash) {
|
||||
unsigned char buf[32];
|
||||
sha.Finalize(buf);
|
||||
RIPEMD160(buf, 32, hash);
|
||||
CRIPEMD160().Write(buf, 32).Finalize(hash);
|
||||
}
|
||||
|
||||
CHash160& Write(const unsigned char *data, size_t len) {
|
||||
|
||||
Reference in New Issue
Block a user