class DhkemX25519HkdfSha256
extends Dhkem
import { DhkemX25519HkdfSha256 } from "https://deno.land/x/hpke@1.2.9/src/kems/dhkemX25519.ts";
The DHKEM(X25519, HKDF-SHA256) for HPKE KEM implementing KemInterface.
This class is implemented using @noble/curves.
The instance of this class can be specified to the CipherSuiteParams as follows:
Examples
Use with @hpke/core
(https://deno.land/x/hpke/core/mod.ts
).
Use with @hpke/core
(https://deno.land/x/hpke/core/mod.ts
).
import {
Aes128Gcm,
CipherSuite,
HkdfSha256,
} from "https://deno.land/x/hpke/core/mod.ts";
import { DhkemX25519HkdfSha256 } from "https://deno.land/x/hpke/x/dhkem-x25519/mod.ts";
const suite = new CipherSuite({
kem: new DhkemX25519HkdfSha256(),
kdf: new HkdfSha256(),
aead: new Aes128Gcm(),
});
When using hpke-js
(https://deno.land/x/hpke/mod.ts
), KemId.DhkemX25519HkdfSha256
can be used. You don't need to use this class.
Example 2
Example 2
import { AeadId, CipherSuite, KdfId, KemId } from "https://deno.land/x/hpke/mod.ts";
const suite = new CipherSuite({
kem: KemId.DhkemX25519HkdfSha256,
kdf: KdfId.HkdfSha256,
aead: AeadId.Aes128Gcm,
});
Properties
readonly
id: KemIdKemId.DhkemX25519HkdfSha256 (0x0020)