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.
38 lines (37 loc) • 1 kB
TypeScript
/**
* @license
* Copyright 2020 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/**
* Validates AES key sizes, at the moment only 128-bit and 256-bit keys are
* supported.
*
* @param n the key size in bytes
* @throws {!InvalidArgumentsException}
* @static
*/
export declare function validateAesKeySize(n: number): void;
/**
* Validates that the input is a non null Uint8Array.
*
* @throws {!InvalidArgumentsException}
* @static
*/
export declare function requireUint8Array(input: Uint8Array): void;
/**
* Validates version, throws exception if candidate version is negative or
* bigger than expected.
*
* @param candidate - version to be validated
* @param maxVersion - upper bound on version
* @throws {!SecurityException}
* @static
*/
export declare function validateVersion(candidate: number, maxVersion: number): void;
/**
* Validates ECDSA parameters.
*
* @throws {!SecurityException}
*/
export declare function validateEcdsaParams(curve: string, hash: string): void;