core/crypto/chacha20poly1305

chacha20poly1305

Types

1

Constants

4

Procedures

5

init_xchacha

init_xchacha :: proc(ctx: ^Context, key: []u8, impl = chacha20.DEFAULT_IMPLEMENTATION)Source

init_xchacha initializes a Context with the provided key, for AEAD_XChaCha20_Poly1305.

Note: While there are multiple definitions of XChaCha20-Poly1305 this sticks to the IETF draft and uses a 32-bit counter.

open

open :: proc( ctx: ^Context, dst: []u8, iv: []u8, aad: []u8, ciphertext: []u8, tag: []u8, ) -> (bool)Source

open authenticates the aad and ciphertext, and decrypts the ciphertext, with the provided Context, iv, and tag, and stores the output in dst, returning true if and only if (⟺) the authentication was successful. If authentication fails, the destination buffer will be zeroed.

dst and plaintext MUST alias exactly or not at all.

reset

reset :: proc(ctx: ^Context)Source

reset sanitizes the Context. The Context must be re-initialized to be used again.

seal

seal :: proc( ctx: ^Context, dst: []u8, tag: []u8, iv: []u8, aad: []u8, plaintext: []u8, )Source

seal encrypts the plaintext and authenticates the aad and ciphertext, with the provided Context and iv, stores the output in dst and tag.

dst and plaintext MUST alias exactly or not at all.

Reference search

Find anything

Documentation preferences

Settings

System theme variants

Used only while Theme is set to System.