From aa3cdbe7b1d0059c5f01c60595e233a2b40a8463 Mon Sep 17 00:00:00 2001 From: Marco Peereboom Date: Wed, 6 Nov 2013 17:43:03 -0600 Subject: [PATCH] use fastsha256 --- opcode.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opcode.go b/opcode.go index f85bc999..d93f1f8d 100644 --- a/opcode.go +++ b/opcode.go @@ -9,11 +9,11 @@ import ( "code.google.com/p/go.crypto/ripemd160" "crypto/ecdsa" "crypto/sha1" - "crypto/sha256" "encoding/binary" "fmt" "github.com/conformal/btcec" "github.com/conformal/btcwire" + "github.com/conformal/fastsha256" "github.com/davecgh/go-spew/spew" "hash" "math/big" @@ -1591,7 +1591,7 @@ func calcHash(buf []byte, hasher hash.Hash) []byte { // calculate hash160 which is ripemd160(sha256(data)) func calcHash160(buf []byte) []byte { - return calcHash(calcHash(buf, sha256.New()), ripemd160.New()) + return calcHash(calcHash(buf, fastsha256.New()), ripemd160.New()) } func opcodeRipemd160(op *parsedOpcode, s *Script) error { @@ -1620,7 +1620,7 @@ func opcodeSha256(op *parsedOpcode, s *Script) error { return err } - s.dstack.PushByteArray(calcHash(buf, sha256.New())) + s.dstack.PushByteArray(calcHash(buf, fastsha256.New())) return nil }