await promises in place
This commit is contained in:
+2
-2
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user