From db59579a2efa8416f78c855faa7d7e62048447e5 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 24 Feb 2026 13:01:02 -0800 Subject: lint --- src/lib/crypto.ts | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'src/lib/crypto.ts') diff --git a/src/lib/crypto.ts b/src/lib/crypto.ts index d941d894..80a6364a 100644 --- a/src/lib/crypto.ts +++ b/src/lib/crypto.ts @@ -2,17 +2,11 @@ export function isPrfEncrypted(value: string): boolean { return value.startsWith("{"); } -async function importPrfKey( - prfKey: ArrayBuffer, - usages: KeyUsage[], -): Promise { +async function importPrfKey(prfKey: ArrayBuffer, usages: KeyUsage[]): Promise { return crypto.subtle.importKey("raw", prfKey, "AES-GCM", false, usages); } -export async function prfEncrypt( - prfKey: ArrayBuffer, - plaintext: Uint8Array, -): Promise { +export async function prfEncrypt(prfKey: ArrayBuffer, plaintext: Uint8Array): Promise { const key = await importPrfKey(prfKey, ["encrypt"]); const iv = crypto.getRandomValues(new Uint8Array(12)); const ciphertext = new Uint8Array( @@ -29,10 +23,7 @@ export async function prfEncrypt( }); } -export async function prfDecrypt( - prfKey: ArrayBuffer, - encrypted: string, -): Promise { +export async function prfDecrypt(prfKey: ArrayBuffer, encrypted: string): Promise { const { iv, ct } = JSON.parse(encrypted); const key = await importPrfKey(prfKey, ["decrypt"]); const ivBytes = fromBase64Url(iv); -- cgit v1.2.3