`AEGIS-128L` and `AEGIS-256` AEAD algorithms. Where AEAD stands for Authenticated Encryption with Additional Data. See: - [[ https://www.ietf.org/archive/id/draft-irtf-cfrg-aegis-aead-12.txt ]]

Collection Info

View Source
Collection
core
Path
crypto/aegis
Entries
12

Source Files

Constants

6

IV_SIZE_128L #

Source
IV_SIZE_128L :: 16

IV_SIZE_128L is the AEGIS-128L IV size in bytes.

IV_SIZE_256 #

Source
IV_SIZE_256 :: 32

IV_SIZE_256 is the AEGIS-256 IV size in bytes.

KEY_SIZE_128L #

Source
KEY_SIZE_128L :: 16

KEY_SIZE_128L is the AEGIS-128L key size in bytes.

KEY_SIZE_256 #

Source
KEY_SIZE_256 :: 32

KEY_SIZE_256 is the AEGIS-256 key size in bytes.

TAG_SIZE_128 #

Source
TAG_SIZE_128 :: 16

TAG_SIZE_128 is the AEGIS-128L or AEGIS-256 128-bit tag size in bytes.

TAG_SIZE_256 #

Source
TAG_SIZE_256 :: 32

TAG_SIZE_256 is the AEGIS-128L or AEGIS-256 256-bit tag size in bytes.

Types

1

Procedures

5

init #

Source
init :: proc(ctx: ^Context, key: []u8, impl: Implementation = aes.DEFAULT_IMPLEMENTATION) {…}

init initializes a Context with the provided key, for AEGIS-128L or AEGIS-256.

is_hardware_accelerated #

Source
is_hardware_accelerated :: proc "contextless" () -> bool {…}

is_hardware_accelerated returns true if and only if (⟺) hardware accelerated AEGIS is supported.

open #

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

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 #

Source
reset :: proc "contextless" (ctx: ^Context) {…}

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

seal #

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

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.