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.
47 lines (46 loc) • 1.34 kB
TypeScript
/**
* @license
* Copyright 2022 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { HpkeKdf } from './hpke_kdf';
/**
* HKDF HPKE KDF variant.
* @see https://www.rfc-editor.org/rfc/rfc9180.html#section-4.1-3
*/
export declare class HkdfHpkeKdf implements HpkeKdf {
private readonly hashFunction;
constructor(hashFunction: 'SHA-256' | 'SHA-512');
labeledExtract({ ikm, ikmLabel, suiteId, salt }: {
ikm: Uint8Array;
ikmLabel: string;
suiteId: Uint8Array;
salt?: Uint8Array;
}): Promise<Uint8Array>;
labeledExpand({ prk, info, infoLabel, suiteId, length }: {
prk: Uint8Array;
info: Uint8Array;
infoLabel: string;
suiteId: Uint8Array;
length: number;
}): Promise<Uint8Array>;
extractAndExpand({ ikm, ikmLabel, info, infoLabel, suiteId, length, salt }: {
ikm: Uint8Array;
ikmLabel: string;
info: Uint8Array;
infoLabel: string;
suiteId: Uint8Array;
length: number;
salt?: Uint8Array;
}): Promise<Uint8Array>;
/**
* Copied from `javascript/subtle/hkdf`'s `compute` function
*/
private expand;
/**
* Copied from `javascript/subtle/hkdf`'s `compute` function
*/
private extract;
getKdfId(): Uint8Array;
getMacLength(): number;
}