multi: replace usage of fastsha256 with crypto/sha256

This commit removes all instances of the fastsha256 library and
replaces it with the sha256 library in the standard library. This
change should see a number of performance improvements as the standard
library has highly optimized assembly instructions with use vectorized
instructions as the platform supports.
This commit is contained in:
Olaoluwa Osuntokun committed 2017-03-15 18:56:41 -07:00
1 parent d723aada30
commit f217093c00
16 files changed
+53 -55

No files matched your search

+2 -2
View File
@@ -4,6 +4,7 @@ import (
"bytes"
"container/list"
"crypto/rand"
"crypto/sha256"
"encoding/binary"
"fmt"
"net"
@@ -11,7 +12,6 @@ import (
"sync/atomic"
"time"
"github.com/btcsuite/fastsha256"
"github.com/davecgh/go-spew/spew"
"github.com/go-errors/errors"
"github.com/lightningnetwork/lightning-onion"
@@ -175,7 +175,7 @@ func newPeer(conn net.Conn, connReq *connmgr.ConnReq, server *server,
p := &peer{
conn: conn,
lightningID: chainhash.Hash(fastsha256.Sum256(nodePub.SerializeCompressed())),
lightningID: chainhash.Hash(sha256.Sum256(nodePub.SerializeCompressed())),
addr: addr,
id: atomic.AddInt32(&numNodes, 1),