From bca6409ade96981b0e77a2a7d358be53b340a1a7 Mon Sep 17 00:00:00 2001 From: David Hill Date: Tue, 10 Jan 2017 17:09:00 -0500 Subject: [PATCH] Drop fastsha256 in favor of crypto/sha256 --- coinset/coins_test.go | 4 ++-- hash160.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/coinset/coins_test.go b/coinset/coins_test.go index ec61eb2..d8ca496 100644 --- a/coinset/coins_test.go +++ b/coinset/coins_test.go @@ -6,6 +6,7 @@ package coinset_test import ( "bytes" + "crypto/sha256" "encoding/hex" "fmt" "testing" @@ -14,7 +15,6 @@ import ( "github.com/btcsuite/btcd/wire" "github.com/btcsuite/btcutil" "github.com/btcsuite/btcutil/coinset" - "github.com/btcsuite/fastsha256" ) type TestCoin struct { @@ -32,7 +32,7 @@ func (c *TestCoin) NumConfs() int64 { return c.TxNumConfs } func (c *TestCoin) ValueAge() int64 { return int64(c.TxValue) * c.TxNumConfs } func NewCoin(index int64, value btcutil.Amount, numConfs int64) coinset.Coin { - h := fastsha256.New() + h := sha256.New() h.Write([]byte(fmt.Sprintf("%d", index))) hash, _ := chainhash.NewHash(h.Sum(nil)) c := &TestCoin{ diff --git a/hash160.go b/hash160.go index bc78841..0e58219 100644 --- a/hash160.go +++ b/hash160.go @@ -5,9 +5,9 @@ package btcutil import ( + "crypto/sha256" "hash" - "github.com/btcsuite/fastsha256" "github.com/btcsuite/golangcrypto/ripemd160" ) @@ -19,5 +19,5 @@ func calcHash(buf []byte, hasher hash.Hash) []byte { // Hash160 calculates the hash ripemd160(sha256(b)). func Hash160(buf []byte) []byte { - return calcHash(calcHash(buf, fastsha256.New()), ripemd160.New()) + return calcHash(calcHash(buf, sha256.New()), ripemd160.New()) }