1
0
mirror of https://github.com/GOSTSec/gostcoin synced 2025-02-01 01:15:23 +00:00

replace OP_SHA256 by OP_GOST3411

This commit is contained in:
orignal 2017-03-24 16:23:27 -04:00
parent 01256fe89d
commit 787ebbc8ad
2 changed files with 6 additions and 5 deletions

View File

@ -15,6 +15,7 @@ using namespace boost;
#include "main.h"
#include "sync.h"
#include "util.h"
#include "Gost.h"
bool CheckSig(vector<unsigned char> vchSig, const vector<unsigned char> &vchPubKey, const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType, int flags);
@ -194,7 +195,7 @@ const char* GetOpName(opcodetype opcode)
// crypto
case OP_RIPEMD160 : return "OP_RIPEMD160";
case OP_SHA1 : return "OP_SHA1";
case OP_SHA256 : return "OP_SHA256";
case OP_GOST3411 : return "OP_GOST3411";
case OP_HASH160 : return "OP_HASH160";
case OP_HASH256 : return "OP_HASH256";
case OP_CODESEPARATOR : return "OP_CODESEPARATOR";
@ -784,7 +785,7 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
//
case OP_RIPEMD160:
case OP_SHA1:
case OP_SHA256:
case OP_GOST3411:
case OP_HASH160:
case OP_HASH256:
{
@ -797,8 +798,8 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
RIPEMD160(&vch[0], vch.size(), &vchHash[0]);
else if (opcode == OP_SHA1)
SHA1(&vch[0], vch.size(), &vchHash[0]);
else if (opcode == OP_SHA256)
SHA256(&vch[0], vch.size(), &vchHash[0]);
else if (opcode == OP_GOST3411)
i2p::crypto::GOSTR3411_2012_256 (&vch[0], vch.size(), &vchHash[0]);
else if (opcode == OP_HASH160)
{
uint160 hash160 = Hash160(vch);

View File

@ -177,7 +177,7 @@ enum opcodetype
// crypto
OP_RIPEMD160 = 0xa6,
OP_SHA1 = 0xa7,
OP_SHA256 = 0xa8,
OP_GOST3411 = 0xa8,
OP_HASH160 = 0xa9,
OP_HASH256 = 0xaa,
OP_CODESEPARATOR = 0xab,