class Chacha20Poly1305
implements AeadInterface
import { Chacha20Poly1305 } from "https://deno.land/x/hpke@1.2.9/src/aeads/chacha20Poly1305.ts";
The ChaCha20Poly1305 for HPKE AEAD implementing AeadInterface.
When using @hpke/core
, the instance of this class can be specified
to the aead
parameter of CipherSuiteParams instead of AeadId.Chacha20Poly1305
as follows:
Examples
Example 1
Example 1
import {
CipherSuite,
DhkemP256HkdfSha256,
HkdfSha256,
} from "http://deno.land/x/hpke/core/mod.ts";
import {
Chacha20Poly1305,
} from "https://deno.land/x/hpke/x/chach20poly1305/mod.ts";
const suite = new CipherSuite({
kem: new DhkemP256HkdfSha256(),
kdf: new HkdfSha256(),
aead: new Chacha20Poly1305(),
});
This class is implemented using @noble/ciphers.
Properties
readonly
id: AeadIdAeadId.Chacha20Poly1305 (0x0003)
Methods
createEncryptionContext(key: ArrayBuffer): AeadEncryptionContext