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:

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.

Implements

  • AeadInterface

Constructors

Properties

id: AeadId = AeadId.Chacha20Poly1305

AeadId.Chacha20Poly1305 (0x0003)

keySize: number = 32

32

nonceSize: number = 12

12

tagSize: number = 16

16

Methods

  • Creates an AEAD encryption context which has seal/open operation.

    Parameters

    • key: ArrayBuffer

      A byte string of the raw key.

    Returns AeadEncryptionContext

    An AEAD encryption context.