From e3c192a84fbdc02bbe87f182b4acea1a4f7b9074 Mon Sep 17 00:00:00 2001 From: Jonas Date: Mon, 16 Mar 2026 23:18:41 +1300 Subject: [PATCH] Fix type error --- app/src/lib/crypto.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/src/lib/crypto.ts b/app/src/lib/crypto.ts index f76d508..4e57fbe 100644 --- a/app/src/lib/crypto.ts +++ b/app/src/lib/crypto.ts @@ -45,14 +45,14 @@ export async function sign(data: string): Promise { } export async function verify(data: string, signature: string, publicKeyRaw: Uint8Array): Promise { - try { - const key = await crypto.subtle.importKey('raw', publicKeyRaw as unknown as ArrayBuffer, ALGO, false, ['verify']); - const sig = base64Decode(signature); - const encoded = new TextEncoder().encode(data); - return crypto.subtle.verify(ALGO, key, sig as unknown as ArrayBuffer, encoded as unknown as ArrayBuffer); - } catch { - return false; - } + try { + const key = await crypto.subtle.importKey('raw', publicKeyRaw as BufferSource, ALGO, false, ['verify']); + const sig = base64Decode(signature); + const encoded = new TextEncoder().encode(data); + return crypto.subtle.verify(ALGO, key, sig as BufferSource, encoded as BufferSource); + } catch { + return false; + } } // --- Base58 (Bitcoin-style) ---