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.

38 lines (37 loc) 1.5 kB
/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { HybridEncrypt } from '../hybrid/internal/hybrid_encrypt'; import { EciesAeadHkdfDemHelper } from './ecies_aead_hkdf_dem_helper'; import * as sender from './ecies_hkdf_kem_sender'; import * as EllipticCurves from './elliptic_curves'; /** * Implementation of ECIES AEAD HKDF hybrid encryption. * * @final */ export declare class EciesAeadHkdfHybridEncrypt extends HybridEncrypt { private readonly kemSender_; private readonly hkdfHash_; private readonly pointFormat_; private readonly demHelper_; private readonly hkdfSalt; /** * @param hkdfHash the name of the HMAC algorithm, accepted names * are: SHA-1, SHA-256 and SHA-512. */ constructor(kemSender: sender.EciesHkdfKemSender, hkdfHash: string, pointFormat: EllipticCurves.PointFormatType, demHelper: EciesAeadHkdfDemHelper, opt_hkdfSalt?: Uint8Array); /** * Encrypts plaintext using opt_contextInfo as info parameter of the * underlying HKDF. * */ encrypt(plaintext: Uint8Array, associatedData?: Uint8Array): Promise<Uint8Array>; } /** * @param hkdfHash the name of the HMAC algorithm, accepted names * are: SHA-1, SHA-256 and SHA-512. */ export declare function fromJsonWebKey(recipientPublicKey: JsonWebKey, hkdfHash: string, pointFormat: EllipticCurves.PointFormatType, demHelper: EciesAeadHkdfDemHelper, opt_hkdfSalt?: Uint8Array): Promise<HybridEncrypt>;