The documentation is currently being reviewed, so you may see some inconsistencies between sections.
For the complete documentation index, see llms.txt. This page is also available as Markdown.

HChaCha20

Purpose

HChaCha20 is a pseudorandom function (PRF) based on ChaCha20 and HSalsa20. It takes a 512-bit input and produces a 256-bit output. This makes it suitable for fast key derivation from high-entropy input keying material, as done for XChaCha20.

Usage

DeriveKey

Fills a span with output keying material derived from high-entropy input keying material, a nonce, and an optional personalization constant for domain separation.

HChaCha20.DeriveKey(Span<byte> outputKeyingMaterial, ReadOnlySpan<byte> inputKeyingMaterial, ReadOnlySpan<byte> nonce, ReadOnlySpan<byte> personalization = default)

Exceptions

ArgumentOutOfRangeException

outputKeyingMaterial has a length not equal to OutputSize.

ArgumentOutOfRangeException

inputKeyingMaterial has a length not equal to KeySize.

ArgumentOutOfRangeException

nonce has a length not equal to NonceSize.

ArgumentOutOfRangeException

personalization has a length greater than 0 but not equal to PersonalizationSize.

ArgumentException

personalization cannot be all-zero and must have asymmetry.

Constants

These are used for validation and/or save you defining your own constants.

Notes

Last updated