Use this file to discover all available pages before exploring further.
The Config class controls every algorithm choice in @ecies/post-quantum. It lets you select the ML-KEM key encapsulation variant, the AEAD symmetric cipher, and the nonce length — and exposes computed getters that resolve these choices into concrete cryptographic modules and payload sizes used internally by encrypt() and decrypt().
Nonce length in bytes for AES-256-GCM. Defaults to 16. Accepted values are 12 or 16. This property is ignored when symmetricAlgorithm is "xchacha20" — XChaCha20-Poly1305 always uses a 24-byte nonce.
Returns the PKE ciphertext size in bytes for the current asymmetricAlgorithm. Used internally by decrypt() to split the leading pke_ciphertext from the rest of the encrypted payload.
DEFAULT_CONFIG is a pre-constructed, exported singleton Config instance with the following defaults:
Property
Default value
asymmetricAlgorithm
"ml-kem-768"
symmetricAlgorithm
"aes-256-gcm"
symmetricNonceLength
16
It is the value used by encrypt() and decrypt() when no config argument is supplied.
DEFAULT_CONFIG is a mutable singleton. Assigning to its properties (e.g. DEFAULT_CONFIG.asymmetricAlgorithm = "ml-kem-1024") will affect every subsequent encrypt() and decrypt() call that relies on the default. For isolated or non-default configuration, always construct a fresh new Config() instance instead.