Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/hpke/core/mod.ts>KdfInterface

A Hybrid Public Key Encryption (HPKE) module built on top of Web Cryptography API.
Latest
interface KdfInterface
import { type KdfInterface } from "https://deno.land/x/hpke@1.2.9/core/mod.ts";

The KDF interface.

Properties

readonly
id: KdfId

The KDF identifier.

readonly
hashSize: number

The output size of the extract() function in bytes (Nh).

Methods

init(suiteId: Uint8Array): void

Initializes the instance by setting a suite_id defined in RFC9180.

buildLabeledIkm(label: Uint8Array, ikm: Uint8Array): Uint8Array

Builds a labeled input keying material.

buildLabeledInfo(
label: Uint8Array,
info: Uint8Array,
len: number,
): Uint8Array

Builds a labeled info string.

extract(salt: ArrayBuffer, ikm: ArrayBuffer): Promise<ArrayBuffer>

Extracts a pseudorandom key of fixed length (Nh) bytes.

expand(
prk: ArrayBuffer,
info: ArrayBuffer,
len: number,
): Promise<ArrayBuffer>

Expands a pseudorandom key prk.

extractAndExpand(
salt: ArrayBuffer,
ikm: ArrayBuffer,
info: ArrayBuffer,
len: number,
): Promise<ArrayBuffer>

Extracts a pseudorandom key and expand it to a specified length keying material.

labeledExtract(
salt: ArrayBuffer,
label: Uint8Array,
ikm: Uint8Array,
): Promise<ArrayBuffer>

Extracts a pseudorandom key with label.

labeledExpand(
prk: ArrayBuffer,
label: Uint8Array,
info: Uint8Array,
len: number,
): Promise<ArrayBuffer>

Extracts a pseudorandom key with label.