fix decrypt/encrypt wording in error message

This commit is contained in:
Bruno Windels 2020-11-11 13:17:05 +01:00
parent 8b16d8bc99
commit f23312b0d3

View File

@ -217,7 +217,7 @@ class AESCrypto {
['encrypt'],
), "importKey");
} catch (err) {
throw new Error(`Could not import key for AES-CTR decryption: ${err.message}`);
throw new Error(`Could not import key for AES-CTR encryption: ${err.message}`);
}
try {
const ciphertext = await subtleCryptoResult(this._subtleCrypto.encrypt(
@ -228,7 +228,7 @@ class AESCrypto {
), "encrypt");
return new Uint8Array(ciphertext);
} catch (err) {
throw new Error(`Could not decrypt with AES-CTR: ${err.message}`);
throw new Error(`Could not encrypt with AES-CTR: ${err.message}`);
}
}