mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
feat(ext/crypto): support AES-CTR encrypt/decrypt (#13177)
Fixes #13201.
This commit is contained in:
parent
a721c34c19
commit
9a42d65fc7
9 changed files with 378 additions and 77 deletions
17
ext/crypto/lib.deno_crypto.d.ts
vendored
17
ext/crypto/lib.deno_crypto.d.ts
vendored
|
@ -62,6 +62,11 @@ interface AesCbcParams extends Algorithm {
|
|||
iv: BufferSource;
|
||||
}
|
||||
|
||||
interface AesCtrParams extends Algorithm {
|
||||
counter: BufferSource;
|
||||
length: number;
|
||||
}
|
||||
|
||||
interface HmacKeyGenParams extends Algorithm {
|
||||
hash: HashAlgorithmIdentifier;
|
||||
length?: number;
|
||||
|
@ -239,12 +244,20 @@ interface SubtleCrypto {
|
|||
data: BufferSource,
|
||||
): Promise<ArrayBuffer>;
|
||||
encrypt(
|
||||
algorithm: AlgorithmIdentifier | RsaOaepParams | AesCbcParams,
|
||||
algorithm:
|
||||
| AlgorithmIdentifier
|
||||
| RsaOaepParams
|
||||
| AesCbcParams
|
||||
| AesCtrParams,
|
||||
key: CryptoKey,
|
||||
data: BufferSource,
|
||||
): Promise<ArrayBuffer>;
|
||||
decrypt(
|
||||
algorithm: AlgorithmIdentifier | RsaOaepParams | AesCbcParams,
|
||||
algorithm:
|
||||
| AlgorithmIdentifier
|
||||
| RsaOaepParams
|
||||
| AesCbcParams
|
||||
| AesCtrParams,
|
||||
key: CryptoKey,
|
||||
data: BufferSource,
|
||||
): Promise<ArrayBuffer>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue