aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/nip44.ts
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-02-11 23:23:32 -0800
committerAdam Soltys <[email protected]>2026-02-11 23:23:32 -0800
commit13f9ef7f26fff64c2bd54c8f9aa14e6ffac67121 (patch)
tree076cd631b671ff5ab74dee08c775c20c192ac659 /src/lib/nip44.ts
parent2e61e8abbc318c36969cb5add0c63df81135b4ab (diff)
downloadcoinos-ui-13f9ef7f26fff64c2bd54c8f9aa14e6ffac67121.tar.gz
coinos-ui-13f9ef7f26fff64c2bd54c8f9aa14e6ffac67121.zip
fix svelte errors
Diffstat (limited to 'src/lib/nip44.ts')
-rw-r--r--src/lib/nip44.ts6
1 files changed, 3 insertions, 3 deletions
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) {