From 13f9ef7f26fff64c2bd54c8f9aa14e6ffac67121 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 11 Feb 2026 23:23:32 -0800 Subject: fix svelte errors --- src/lib/nip44.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lib/nip44.ts') diff --git a/src/lib/nip44.ts b/src/lib/nip44.ts index f1f872b5..6025a54f 100644 --- a/src/lib/nip44.ts +++ b/src/lib/nip44.ts @@ -8,7 +8,7 @@ import { secp256k1 } from "@noble/curves/secp256k1.js"; import { extract as hkdf_extract, expand as hkdf_expand } from "@noble/hashes/hkdf.js"; import { hmac } from "@noble/hashes/hmac.js"; import { sha256 } from "@noble/hashes/sha2.js"; -import { concatBytes, randomBytes, utf8ToBytes } from "@noble/hashes/utils.js"; +import { concatBytes, hexToBytes, randomBytes, utf8ToBytes } from "@noble/hashes/utils.js"; import { base64 } from "@scure/base"; declare const TextDecoder: any; @@ -24,8 +24,8 @@ export const u = { }, getConversationKey(privkeyA: string, pubkeyB: string): Uint8Array { - const sharedX = secp256k1.getSharedSecret(privkeyA, "02" + pubkeyB).subarray(1, 33); - return hkdf_extract(sha256, sharedX, "nip44-v2"); + const sharedX = secp256k1.getSharedSecret(hexToBytes(privkeyA), hexToBytes("02" + pubkeyB)).subarray(1, 33); + return hkdf_extract(sha256, sharedX, utf8ToBytes("nip44-v2")); }, getMessageKeys(conversationKey: Uint8Array, nonce: Uint8Array) { -- cgit v1.2.3