From 9b606fd1ca1633c1ff3cd9f6bac5568bbe6b1ee8 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 23 May 2019 22:55:28 -0700 Subject: [PATCH] dep: use a faster sha256 library This is the one we're using in secio/multihash. --- go.mod | 1 + keyspace/xor.go | 2 +- util.go | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 0a4e7f3..b01fabe 100644 --- a/go.mod +++ b/go.mod @@ -6,4 +6,5 @@ require ( github.com/libp2p/go-libp2p-peer v0.0.1 github.com/libp2p/go-libp2p-peerstore v0.0.1 github.com/libp2p/go-testutil v0.0.1 + github.com/minio/sha256-simd v0.0.0-20190131020904-2d45a736cd16 ) diff --git a/keyspace/xor.go b/keyspace/xor.go index ee6c65c..6750b0b 100644 --- a/keyspace/xor.go +++ b/keyspace/xor.go @@ -2,11 +2,11 @@ package keyspace import ( "bytes" - "crypto/sha256" "math/big" "math/bits" u "github.com/ipfs/go-ipfs-util" + sha256 "github.com/minio/sha256-simd" ) // XORKeySpace is a KeySpace which: diff --git a/util.go b/util.go index 058aa3c..4990c08 100644 --- a/util.go +++ b/util.go @@ -2,12 +2,12 @@ package kbucket import ( "bytes" - "crypto/sha256" "errors" u "github.com/ipfs/go-ipfs-util" ks "github.com/libp2p/go-libp2p-kbucket/keyspace" peer "github.com/libp2p/go-libp2p-peer" + sha256 "github.com/minio/sha256-simd" ) // Returned if a routing table query returns no results. This is NOT expected