mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Add built-in RIPEMD-160 implementation
This commit is contained in:
parent
13b5dfef64
commit
a5bc9c0917
5 changed files with 248 additions and 4 deletions
|
|
@ -11,6 +11,7 @@
|
|||
#include "keystore.h"
|
||||
#include "crypto/sha1.h"
|
||||
#include "crypto/sha2.h"
|
||||
#include "crypto/ripemd160.h"
|
||||
#include "sync.h"
|
||||
#include "uint256.h"
|
||||
#include "util.h"
|
||||
|
|
@ -803,7 +804,7 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
|
|||
valtype& vch = stacktop(-1);
|
||||
valtype vchHash((opcode == OP_RIPEMD160 || opcode == OP_SHA1 || opcode == OP_HASH160) ? 20 : 32);
|
||||
if (opcode == OP_RIPEMD160)
|
||||
RIPEMD160(&vch[0], vch.size(), &vchHash[0]);
|
||||
CRIPEMD160().Write(&vch[0], vch.size()).Finalize(&vchHash[0]);
|
||||
else if (opcode == OP_SHA1)
|
||||
CSHA1().Write(&vch[0], vch.size()).Finalize(&vchHash[0]);
|
||||
else if (opcode == OP_SHA256)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue