From dc5e44d36cebe49e3b2c83a12138a983fe6a8fe2 Mon Sep 17 00:00:00 2001 From: number571 Date: Thu, 31 Oct 2024 05:13:49 +0700 Subject: [PATCH] update --- cmd/tools/keygen/main.go | 7 ++++--- test/result/badge_codelines.svg | 2 +- test/result/coverage.svg | 8 ++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/cmd/tools/keygen/main.go b/cmd/tools/keygen/main.go index c1fd3ae9..ba0485a8 100644 --- a/cmd/tools/keygen/main.go +++ b/cmd/tools/keygen/main.go @@ -9,7 +9,6 @@ import ( "runtime" "github.com/number571/go-peer/pkg/crypto/asymmetric" - "github.com/number571/go-peer/pkg/crypto/keybuilder" "github.com/number571/go-peer/pkg/crypto/random" "github.com/number571/go-peer/pkg/encoding" ) @@ -20,8 +19,10 @@ func main() { seedBytes := random.NewRandom().GetBytes(asymmetric.CKeySeedSize) if *seed { - keyBuilder := keybuilder.NewKeyBuilder(0, []byte{}) - seedBytes = keyBuilder.Build(readUntilEOL(), asymmetric.CKeySeedSize) + seedBytes = encoding.HexDecode(readUntilEOL()) + if len(seedBytes) != asymmetric.CKeySeedSize { + panic("len(seedBytes) != asymmetric.CKeySeedSize") + } } priv := asymmetric.NewPrivKeyFromSeed(seedBytes) diff --git a/test/result/badge_codelines.svg b/test/result/badge_codelines.svg index 4e65c7da..772d81e2 100644 --- a/test/result/badge_codelines.svg +++ b/test/result/badge_codelines.svg @@ -1 +1 @@ -code lines: 12543code lines12543 \ No newline at end of file +code lines: 12544code lines12544 \ No newline at end of file diff --git a/test/result/coverage.svg b/test/result/coverage.svg index 9f78607c..0d5d8e04 100644 --- a/test/result/coverage.svg +++ b/test/result/coverage.svg @@ -335,7 +335,7 @@ - + - + network.go @@ -658,7 +658,7 @@ - +