From 24cb8e35c7388abc84b797d3ed22a004f30e6026 Mon Sep 17 00:00:00 2001 From: Kleissner Date: Wed, 17 Mar 2021 11:41:45 +0100 Subject: [PATCH] Update to latest core --- Test_test.go | 13 ++++++------- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Test_test.go b/Test_test.go index 9d1a654..92309d4 100644 --- a/Test_test.go +++ b/Test_test.go @@ -2,17 +2,13 @@ package main import ( - "crypto/rand" "fmt" "testing" - "time" "github.com/PeernetOfficial/core" - "github.com/btcsuite/btcd/btcec" - "github.com/btcsuite/btcd/chaincfg/chainhash" - "lukechampine.com/blake3" ) +/* func TestSignCompact(t *testing.T) { privateKey, publicKey, err := core.Secp256k1NewPrivateKey() if err != nil { @@ -26,19 +22,20 @@ func TestSignCompact(t *testing.T) { time1 := time.Now() compact1 = make([]byte, 0) - compact1, err = btcec.SignCompact(btcec.S256(), privateKey, chainhash.DoubleHashB(data), true) + compact1, err = btcec.SignCompact(btcec.S256(), privateKey, hashData(data), true) timeT := time.Since(time1) fmt.Printf("length %d time %s\n", len(compact1), timeT.String()) time2 := time.Now() - key2, _, err := btcec.RecoverCompact(btcec.S256(), compact1, chainhash.DoubleHashB(data)) + key2, _, err := btcec.RecoverCompact(btcec.S256(), compact1, hashData(data)) timeT2 := time.Since(time2) fmt.Printf("VALID PUBLIC KEY: %t\n", key2.IsEqual(publicKey)) fmt.Printf("time %s\n", timeT2.String()) } +*/ func TestEncryption1(t *testing.T) { privateKey, publicKey, err := core.Secp256k1NewPrivateKey() @@ -63,6 +60,7 @@ func TestEncryption1(t *testing.T) { fmt.Printf("%d\n", packet1d.Command) } +/* func BenchmarkHash(b *testing.B) { length := 20000 @@ -85,6 +83,7 @@ func BenchmarkHash(b *testing.B) { } }) } +*/ func TestEncryption2(t *testing.T) { privateKey, publicKey, err := core.Secp256k1NewPrivateKey() diff --git a/go.mod b/go.mod index 398905c..2350411 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module github.com/PeernetOfficial/Cmd go 1.16 -require github.com/PeernetOfficial/core v0.0.0-20210317015617-ddd3f6518767 +require github.com/PeernetOfficial/core v0.0.0-20210317104020-b8e408048ceb diff --git a/go.sum b/go.sum index 51bde01..5ee94f3 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/PeernetOfficial/core v0.0.0-20210317015617-ddd3f6518767 h1:6aqb5uDq5KsGMaqbV/e7cwTLetp0YXzV1KGSbq6xDXc= -github.com/PeernetOfficial/core v0.0.0-20210317015617-ddd3f6518767/go.mod h1:SNy9riYEKopf8xBxiIJlfaOX7TPwsWGbmNBjJpjOZoA= +github.com/PeernetOfficial/core v0.0.0-20210317104020-b8e408048ceb h1:TDBGnn8fGEow63bEuHgwL7u+pHJDG/PajBcFyF/c8LA= +github.com/PeernetOfficial/core v0.0.0-20210317104020-b8e408048ceb/go.mod h1:SNy9riYEKopf8xBxiIJlfaOX7TPwsWGbmNBjJpjOZoA= github.com/PeernetOfficial/core/dht v0.0.0-20210316211915-8b329f7258d1 h1:kbSPQTir7JrBAR7OL6TZIwWsRuqroafeXnFpKXOyEvk= github.com/PeernetOfficial/core/dht v0.0.0-20210316211915-8b329f7258d1/go.mod h1:sb2H21VIVTohCXVrDFo/Skl2tN8Yzba+MXSS6NgCYXw= github.com/PeernetOfficial/core/reuseport v0.0.0-20210316211915-8b329f7258d1 h1:m1dEg5E8ZwT3l/F6xiDrU2Q/ZJ9BeVFAZt/OUBxtr4M=