mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 15:19:07 +01:00
Switch script.cpp and hash.cpp to use sha2.cpp instead of OpenSSL.
This commit is contained in:
@@ -9,10 +9,13 @@
|
||||
#include "hash.h"
|
||||
#include "key.h"
|
||||
#include "keystore.h"
|
||||
#include "sha2.h"
|
||||
#include "sync.h"
|
||||
#include "uint256.h"
|
||||
#include "util.h"
|
||||
|
||||
#include <openssl/sha.h>
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
#include <boost/tuple/tuple_comparison.hpp>
|
||||
@@ -805,17 +808,11 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
|
||||
else if (opcode == OP_SHA1)
|
||||
SHA1(&vch[0], vch.size(), &vchHash[0]);
|
||||
else if (opcode == OP_SHA256)
|
||||
SHA256(&vch[0], vch.size(), &vchHash[0]);
|
||||
CSHA256().Write(&vch[0], vch.size()).Finalize(&vchHash[0]);
|
||||
else if (opcode == OP_HASH160)
|
||||
{
|
||||
uint160 hash160 = Hash160(vch);
|
||||
memcpy(&vchHash[0], &hash160, sizeof(hash160));
|
||||
}
|
||||
CHash160().Write(&vch[0], vch.size()).Finalize(&vchHash[0]);
|
||||
else if (opcode == OP_HASH256)
|
||||
{
|
||||
uint256 hash = Hash(vch.begin(), vch.end());
|
||||
memcpy(&vchHash[0], &hash, sizeof(hash));
|
||||
}
|
||||
CHash256().Write(&vch[0], vch.size()).Finalize(&vchHash[0]);
|
||||
popstack(stack);
|
||||
stack.push_back(vchHash);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user