diff --git a/src/mod.ts b/src/mod.ts index 4fa528c..82acc9e 100644 --- a/src/mod.ts +++ b/src/mod.ts @@ -30,7 +30,10 @@ export async function main ([ throw new Error('invalid salt, at least 5 characters long'); } - const entropy = await PBKDF2(encode(salt), encode(passphrase)); + const entropy = await PBKDF2({ + salt: encode(salt), + passphrase: encode(passphrase), + }); return ssh(new Uint8Array(entropy)); diff --git a/src/pbkdf2.ts b/src/pbkdf2.ts index e98285f..7de2d78 100644 --- a/src/pbkdf2.ts +++ b/src/pbkdf2.ts @@ -4,12 +4,14 @@ import { webcrypto } from './utils.ts'; -export async function PBKDF2 ( +export async function PBKDF2 (opts: { salt: BufferSource, passphrase: BufferSource, -): Promise { +}): Promise { + + const { salt, passphrase } = opts; const name = 'PBKDF2'; const byte = 32;