diff --git a/src/pwd-wrap.ts b/src/pwd-wrap.ts index ce9d9a7..43c7995 100644 --- a/src/pwd-wrap.ts +++ b/src/pwd-wrap.ts @@ -16,9 +16,9 @@ export default class PwdWrap { return await hkdf(k, Usage.wrap) as CryptoKey } - public static async wrap(data: CryptoKey, pwd: string, salt?: Uint8Array): Promise { + public static async wrap(data: CryptoKey, pwd: string): Promise { log.trace('wrap') - salt = salt ?? crypto.getRandomValues(new Uint8Array(16)) + const salt = crypto.getRandomValues(new Uint8Array(16)) const k = await PwdWrap.derive(pwd, salt) const box = await SecretWrap.wrap(data, k) return new PwdWrap(box, salt)