UNPKG

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.

40 lines (39 loc) 1.6 kB
/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { HybridDecrypt } from '../hybrid/internal/hybrid_decrypt'; import { EciesAeadHkdfDemHelper } from './ecies_aead_hkdf_dem_helper'; import { EciesHkdfKemRecipient } from './ecies_hkdf_kem_recipient'; import * as EllipticCurves from './elliptic_curves'; /** * Implementation of ECIES AEAD HKDF hybrid decryption. * * @final */ export declare class EciesAeadHkdfHybridDecrypt extends HybridDecrypt { private readonly kemRecipient_; private readonly hkdfHash_; private readonly pointFormat_; private readonly demHelper_; private readonly headerSize; private readonly hkdfSalt; /** * @param hkdfHash the name of the HMAC algorithm, accepted names * are: SHA-1, SHA-256 and SHA-512. */ constructor(recipientPrivateKey: JsonWebKey, kemRecipient: EciesHkdfKemRecipient, hkdfHash: string, pointFormat: EllipticCurves.PointFormatType, demHelper: EciesAeadHkdfDemHelper, opt_hkdfSalt?: Uint8Array); /** * Decrypts ciphertext using opt_contextInfo as info parameter of the * underlying HKDF. * */ decrypt(ciphertext: Uint8Array, associatedData?: Uint8Array): Promise<Uint8Array>; private getAead; } /** * @param hkdfHash the name of the HMAC algorithm, accepted names * are: SHA-1, SHA-256 and SHA-512. */ export declare function fromJsonWebKey(recipientPrivateKey: JsonWebKey, hkdfHash: string, pointFormat: EllipticCurves.PointFormatType, demHelper: EciesAeadHkdfDemHelper, opt_hkdfSalt?: Uint8Array): Promise<HybridDecrypt>;