package core:crypto/aegis

⌘K
Ctrl+K
or
/

    Overview

    package aegis implements the AEGIS-128L and AEGIS-256 Authenticated Encryption with Additional Data algorithms.

    See: https://www.ietf.org/archive/id/draft-irtf-cfrg-aegis-aead-12.txt

    Index

    Types (1)
    Variables (0)

    This section is empty.

    Procedure Groups (0)

    This section is empty.

    Types

    Context ¶

    Context :: struct {
    	_key:            [32]u8,
    	_key_len:        int,
    	_impl:           aes.Implementation,
    	_is_initialized: bool,
    }
     

    Context is a keyed AEGIS-128L or AEGIS-256 instance.

    Related Procedures With Parameters

    Constants

    IV_SIZE_128L ¶

    IV_SIZE_128L: int : 16
     

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

    IV_SIZE_256 ¶

    IV_SIZE_256: int : 32
     

    IV_SIZE_256 is the AEGIS-256 IV size in bytes.

    KEY_SIZE_128L ¶

    KEY_SIZE_128L: int : 16
     

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

    KEY_SIZE_256 ¶

    KEY_SIZE_256: int : 32
     

    KEY_SIZE_256 is the AEGIS-256 key size in bytes.

    TAG_SIZE_128 ¶

    TAG_SIZE_128: int : 16
     

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

    TAG_SIZE_256 ¶

    TAG_SIZE_256: int : 32
     

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

    Variables

    This section is empty.

    Procedures

    init ¶

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

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

    is_hardware_accelerated ¶

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

    is_hardware_accelerated returns true iff hardware accelerated AEGIS is supported.

    open ¶

    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 iff 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 "contextless" (ctx: ^Context) {…}
     

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

    seal ¶

    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.

    Procedure Groups

    This section is empty.

    Source Files

    Generation Information

    Generated with odin version dev-2025-03 (vendor "odin") Windows_amd64 @ 2025-03-25 21:11:15.149517300 +0000 UTC