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:
@hpke/core
aead
AeadId.Chacha20Poly1305
import { CipherSuite, DhkemP256HkdfSha256, HkdfSha256,} from "@hpke/core";import { Chacha20Poly1305,} from "@hpke/chacha20poly1305";const suite = new CipherSuite({ kem: new DhkemP256HkdfSha256(), kdf: new HkdfSha256(), aead: new Chacha20Poly1305(),}); Copy
import { CipherSuite, DhkemP256HkdfSha256, HkdfSha256,} from "@hpke/core";import { Chacha20Poly1305,} from "@hpke/chacha20poly1305";const suite = new CipherSuite({ kem: new DhkemP256HkdfSha256(), kdf: new HkdfSha256(), aead: new Chacha20Poly1305(),});
This class is implemented using @noble/ciphers.
Readonly
AeadId.Chacha20Poly1305 (0x0003)
32
12
16
Creates an AEAD encryption context which has seal/open operation.
A byte string of the raw key.
An AEAD encryption context.
The ChaCha20Poly1305 for HPKE AEAD implementing AeadInterface.
When using
@hpke/core
, the instance of this class can be specified to theaead
parameter of CipherSuiteParams instead ofAeadId.Chacha20Poly1305
as follows:Example
This class is implemented using @noble/ciphers.