class DhkemSecp256k1HkdfSha256
extends Dhkem
import { DhkemSecp256k1HkdfSha256 } from "https://deno.land/x/hpke@1.2.9/src/kems/dhkemSecp256k1.ts";
The DHKEM(secp256k1, HKDF-SHA256) for HPKE KEM implementing KemInterface.
This class is implemented using @noble/curves.
The public keys are assumed to be compressed.
The instance of this class can be specified to the CipherSuiteParams as follows:
Examples
Use with hpke-js
(https://deno.land/x/hpke/mod.ts
).
Use with hpke-js
(https://deno.land/x/hpke/mod.ts
).
import { AeadId, CipherSuite, KdfId } from "https://deno.land/x/hpke/mod.ts";
import { DhkemSecp256k1HkdfSha256 } from "https://deno.land/x/hpke/x/dhkem-secp256k1/mod.ts";
const suite = new CipherSuite({
kem: new DhkemSecp256k1HkdfSha256(),
kdf: KdfId.HkdfSha256,
aead: AeadId.Aes128Gcm,
});
When using hpke-js
(https://deno.land/x/hpke/mod.ts
), KemId.DhkemSecp256k1HkdfSha256
cannot be used as well. So you need to specify the instance of this class as follows:
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 { DhkemSecp256k1HkdfSha256 } from "https://deno.land/x/hpke/x/dhkem-secp256k1/mod.ts";
const suite = new CipherSuite({
kem: new DhkemSecp256k1HkdfSha256(),
kdf: new HkdfSha256(),
aead: new Aes128Gcm(),
});
Properties
readonly
id: KemIdKemId.DhkemSecp256k1HkdfSha256 (0x0013) EXPERIMENTAL