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; }