From b92e70270d3f826dbdd570a6af2e560e9928877f Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Mon, 21 Apr 2025 18:09:44 -0300 Subject: [PATCH] nip49: fix secret key return values. --- nip49/nip49.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nip49/nip49.go b/nip49/nip49.go index 1dfbd54..d402db4 100644 --- a/nip49/nip49.go +++ b/nip49/nip49.go @@ -5,6 +5,7 @@ import ( "fmt" "math" + "fiatjaf.com/nostr" "github.com/btcsuite/btcd/btcutil/bech32" "golang.org/x/crypto/chacha20poly1305" "golang.org/x/crypto/scrypt" @@ -54,9 +55,9 @@ func Encrypt(secretKey [32]byte, password string, logn uint8, ksb KeySecurityByt return bech32.Encode("ncryptsec", bits5) } -func Decrypt(bech32string string, password string) (secretKey [32]byte, err error) { +func Decrypt(bech32string string, password string) (secretKey nostr.SecretKey, err error) { secb, err := DecryptToBytes(bech32string, password) - return [32]byte(secb), err + return nostr.SecretKey(secb), err } func DecryptToBytes(bech32string string, password string) (secretKey []byte, err error) {