await promises in place

This commit is contained in:
2024-09-10 00:32:25 +02:00
parent 9de49c228d
commit 7e858b3556
9 changed files with 31 additions and 38 deletions
+2 -2
View File
@@ -13,7 +13,7 @@ export default class PwdBox {
private static async derive(pwd: string, salt: Uint8Array): Promise<CryptoKey> {
const k = await pbkdf(salt, pwd)
return (await hkdf(k, Usage.box)) as CryptoKey
return await hkdf(k, Usage.box) as CryptoKey
}
public static async encrypt(data: Uint8Array, pwd: string): Promise<PwdBox> {
@@ -26,7 +26,7 @@ export default class PwdBox {
public async decrypt(pwd: string): Promise<Uint8Array | null> {
log.trace('decrypt')
const k = await PwdBox.derive(pwd, this.salt)
return this.box.decrypt(k)
return await this.box.decrypt(k)
}
public toString(): string {