tink-crypto
Version:
A multi-language, cross-platform library that provides cryptographic APIs that are secure, easy to use correctly, and hard(er) to misuse.
35 lines (34 loc) • 960 B
TypeScript
/**
* @license
* Copyright 2022 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/**
* The only supported IV size.
*
*/
export declare const IV_SIZE_IN_BYTES: number;
/**
* Insecure version of `subtle/aes_gcm.ts` that allows the caller to set
* the IV.
*
* @final
*/
export declare class InsecureIvAesGcm {
private readonly key;
private readonly prependIv;
constructor({ key, prependIv }: {
readonly key: CryptoKey;
readonly prependIv: boolean;
});
encrypt(iv: Uint8Array, plaintext: Uint8Array, associatedData?: Uint8Array): Promise<Uint8Array>;
decrypt(iv: Uint8Array, ciphertext: Uint8Array, associatedData?: Uint8Array): Promise<Uint8Array>;
}
/**
* Returns an instantiated `InsecureIvAesGcm` given a raw byte array `key`
* and `prependIv` flag.
*/
export declare function insecureIvAesGcmFromRawKey({ key, prependIv }: {
key: Uint8Array;
prependIv: boolean;
}): Promise<InsecureIvAesGcm>;