From 91dfcf369cf003d4692c6dcfb5a15d6bf5923803 Mon Sep 17 00:00:00 2001 From: Archit Date: Thu, 29 Feb 2024 11:20:56 +0530 Subject: [PATCH] fixes get and decrypt api --- src/webAuthnShareResolver.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/webAuthnShareResolver.ts b/src/webAuthnShareResolver.ts index 3741e52..9162a8c 100644 --- a/src/webAuthnShareResolver.ts +++ b/src/webAuthnShareResolver.ts @@ -51,9 +51,9 @@ export async function decryptData(privKeyHex: string, d: string): Promise } export async function getAndDecryptData(m: MetadataStorageLayer, privKeyHex: string, namespace: string): Promise | null> { - const keyPair = ec.keyFromPrivate(privKeyHex); + const keyPair = ec.keyFromPrivate(privKeyHex, "hex"); const pubKey = keyPair.getPublic(); - const serializedData = await m.getMetadata({ pub_key_X: pubKey.getX().toString(16), pub_key_Y: pubKey.getY().toString(16) }, namespace); + const serializedData = await m.getMetadata({ pub_key_X: pubKey.getX().toString(16, 64), pub_key_Y: pubKey.getY().toString(16, 64) }, namespace); if (!serializedData) { return null; }