use fastsha256

This commit is contained in:
Marco Peereboom 2013-11-06 17:47:31 -06:00
parent dd41f7e91a
commit 6ad853019a

View file

@ -6,9 +6,9 @@ package btcwire
import ( import (
"crypto/rand" "crypto/rand"
"crypto/sha256"
"encoding/binary" "encoding/binary"
"fmt" "fmt"
"github.com/conformal/fastsha256"
"io" "io"
"math" "math"
) )
@ -414,7 +414,7 @@ func RandomUint64() (uint64, error) {
// DoubleSha256 calculates sha256(sha256(b)) and returns the resulting bytes. // DoubleSha256 calculates sha256(sha256(b)) and returns the resulting bytes.
func DoubleSha256(b []byte) []byte { func DoubleSha256(b []byte) []byte {
hasher := sha256.New() hasher := fastsha256.New()
hasher.Write(b) hasher.Write(b)
sum := hasher.Sum(nil) sum := hasher.Sum(nil)
hasher.Reset() hasher.Reset()