From 56e7bd01ca09ad52b0c4f48f146a20a4f1b78696 Mon Sep 17 00:00:00 2001 From: Wim Date: Sat, 5 Aug 2023 20:43:19 +0200 Subject: Update dependencies and remove old matterclient lib (#2067) --- vendor/go.mau.fi/whatsmeow/util/keys/keypair.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'vendor/go.mau.fi/whatsmeow/util/keys') diff --git a/vendor/go.mau.fi/whatsmeow/util/keys/keypair.go b/vendor/go.mau.fi/whatsmeow/util/keys/keypair.go index 55679ff2..75b050aa 100644 --- a/vendor/go.mau.fi/whatsmeow/util/keys/keypair.go +++ b/vendor/go.mau.fi/whatsmeow/util/keys/keypair.go @@ -8,11 +8,10 @@ package keys import ( - "crypto/rand" - "fmt" - "go.mau.fi/libsignal/ecc" "golang.org/x/crypto/curve25519" + + "go.mau.fi/whatsmeow/util/randbytes" ) type KeyPair struct { @@ -32,12 +31,7 @@ func NewKeyPairFromPrivateKey(priv [32]byte) *KeyPair { } func NewKeyPair() *KeyPair { - var priv [32]byte - - _, err := rand.Read(priv[:]) - if err != nil { - panic(fmt.Errorf("failed to generate curve25519 private key: %w", err)) - } + priv := *(*[32]byte)(randbytes.Make(32)) priv[0] &= 248 priv[31] &= 127 -- cgit v1.2.3