core/crypto/aead

aead

Types

3

Algorithm

Algorithm :: enum int { Invalid = 0, AES_GCM_128 = 1, AES_GCM_192 = 2, AES_GCM_256 = 3, CHACHA20POLY1305 = 4, XCHACHA20POLY1305 = 5, AEGIS_128L = 6, AEGIS_128L_256 = 7, // AEGIS-128L (256-bit tag) AEGIS_256 = 8, AEGIS_256_256 = 9, // AEGIS-256 (256-bit tag) DEOXYS_II_256 = 10, }Source

Algorithm is the algorithm identifier associated with a given Context.

Constants

1

Variables

4

ALGORITHM_NAMES

ALGORITHM_NAMES :: [11]string = [Algorithm]string { .Invalid = "Invalid", .AES_GCM_128 = "AES-GCM-128", .AES_GCM_192 = "AES-GCM-192", .AES_GCM_256 = "AES-GCM-256", .CHACHA20POLY1305 = "chacha20poly1305", .XCHACHA20POLY1305 = "xchacha20poly1305", .AEGISSource

ALGORITM_NAMES is the Algorithm to algorithm name string.

Procedures

9

open_ctx

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

open_ctx 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.

open_oneshot

open_oneshot :: proc( algo: Algorithm, dst: []u8, key: []u8, iv: []u8, aad: []u8, ciphertext: []u8, tag: []u8, impl: Implementation, ) -> (bool)Source

open authenticates the aad and ciphertext, and decrypts the ciphertext, with the provided algorithm, key, 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 ciphertext 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_ctx

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

seal_ctx 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.

seal_oneshot

seal_oneshot :: proc( algo: Algorithm, dst: []u8, tag: []u8, key: []u8, iv: []u8, aad: []u8, plaintext: []u8, impl: Implementation, )Source

seal_oneshot encrypts the plaintext and authenticates the aad and ciphertext, with the provided algorithm, key, and iv, stores the output in dst and tag.

dst and plaintext MUST alias exactly or not at all.

Procedure Groups

2

Reference search

Find anything

Documentation preferences

Settings

System theme variants

Used only while Theme is set to System.