From 54afba8f0c0b5d92a9428a944b1ae0e2df9ff341 Mon Sep 17 00:00:00 2001 From: Traktormaster Date: Wed, 21 Oct 2020 21:26:35 +0200 Subject: [PATCH] Correct WebCrypto API parameter value from bytes to bits --- src/providers/webcrypto/aes_ctr.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/providers/webcrypto/aes_ctr.ts b/src/providers/webcrypto/aes_ctr.ts index bbeda6f..944d3b6 100644 --- a/src/providers/webcrypto/aes_ctr.ts +++ b/src/providers/webcrypto/aes_ctr.ts @@ -21,7 +21,7 @@ export default class WebCryptoAesCtr implements ICTRLike { public async encryptCtr(iv: Uint8Array, plaintext: Uint8Array): Promise { const ciphertext = await this.crypto.subtle.encrypt( - { name: "AES-CTR", counter: iv, length: 16 }, + { name: "AES-CTR", counter: iv, length: 128 }, this.key, plaintext, );