mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-08 14:57:38 +02:00
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:
@@ -2,13 +2,13 @@ package channeldb
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/sha256"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"reflect"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/btcsuite/fastsha256"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/roasbeef/btcutil"
|
||||
)
|
||||
@@ -33,7 +33,7 @@ func makeFakePayment() *OutgoingPayment {
|
||||
Fee: 101,
|
||||
Path: fakePath,
|
||||
TimeLockLength: 1000,
|
||||
PaymentHash: fastsha256.Sum256(rev[:]),
|
||||
PaymentHash: sha256.Sum256(rev[:]),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ func makeRandomFakePayment() (*OutgoingPayment, error) {
|
||||
copy(fakePath[i][:], b)
|
||||
}
|
||||
|
||||
rHash := fastsha256.Sum256(fakeInvoice.Terms.PaymentPreimage[:])
|
||||
rHash := sha256.Sum256(fakeInvoice.Terms.PaymentPreimage[:])
|
||||
fakePayment := &OutgoingPayment{
|
||||
Invoice: *fakeInvoice,
|
||||
Fee: btcutil.Amount(rand.Intn(1001)),
|
||||
|
Reference in New Issue
Block a user