Add built-in SHA-1 implementation.

This commit is contained in:
Pieter Wuille
2014-04-28 03:09:13 +02:00
parent 85aab2a088
commit 1cc344ce42
6 changed files with 262 additions and 3 deletions

View File

@@ -9,13 +9,12 @@
#include "hash.h"
#include "key.h"
#include "keystore.h"
#include "sha1.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>
@@ -806,7 +805,7 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
if (opcode == OP_RIPEMD160)
RIPEMD160(&vch[0], vch.size(), &vchHash[0]);
else if (opcode == OP_SHA1)
SHA1(&vch[0], vch.size(), &vchHash[0]);
CSHA1().Write(&vch[0], vch.size()).Finalize(&vchHash[0]);
else if (opcode == OP_SHA256)
CSHA256().Write(&vch[0], vch.size()).Finalize(&vchHash[0]);
else if (opcode == OP_HASH160)