Skip to content

Commit

Permalink
Merge pull request #23 from torusresearch/fix/get-api
Browse files Browse the repository at this point in the history
fixes get and decrypt api
  • Loading branch information
arch1995 authored Feb 29, 2024
2 parents 87b6cd8 + 91dfcf3 commit 66e8071
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/webAuthnShareResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ export async function decryptData<T>(privKeyHex: string, d: string): Promise<T>
}

export async function getAndDecryptData<T>(m: MetadataStorageLayer, privKeyHex: string, namespace: string): Promise<Record<string, T> | 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;
}
Expand Down

0 comments on commit 66e8071

Please sign in to comment.