nip04 string key is actually x and y, so we must get only 32 bytes of x.

This commit is contained in:
fiatjaf
2022-01-25 16:25:10 -03:00
parent 0c8e7a74f5
commit 0396db5ed6
2 changed files with 2 additions and 2 deletions

View File

@@ -37,6 +37,6 @@ export function decrypt(privkey, pubkey, ciphertext) {
function getNormalizedX(key) {
return typeof key === 'string'
? key.substr(2)
? key.substr(2, 64)
: Buffer.from(key.slice(1)).toString('hex')
}

View File

@@ -1,6 +1,6 @@
{
"name": "nostr-tools",
"version": "0.21.2",
"version": "0.21.3",
"description": "Tools for making a Nostr client.",
"repository": {
"type": "git",