core/crypto/aegis
aegis
Types
1Constants
6IV_SIZE_128L
IV_SIZE_128L :: 16SourceIV_SIZE_128L is the AEGIS-128L IV size in bytes.
IV_SIZE_256
IV_SIZE_256 :: 32SourceIV_SIZE_256 is the AEGIS-256 IV size in bytes.
KEY_SIZE_128L
KEY_SIZE_128L :: 16SourceKEY_SIZE_128L is the AEGIS-128L key size in bytes.
KEY_SIZE_256
KEY_SIZE_256 :: 32SourceKEY_SIZE_256 is the AEGIS-256 key size in bytes.
TAG_SIZE_128
TAG_SIZE_128 :: 16SourceTAG_SIZE_128 is the AEGIS-128L or AEGIS-256 128-bit tag size in bytes.
TAG_SIZE_256
TAG_SIZE_256 :: 32SourceTAG_SIZE_256 is the AEGIS-128L or AEGIS-256 256-bit tag size in bytes.
Procedures
5init
init :: proc(ctx: ^Context, key: []u8, impl = aes.DEFAULT_IMPLEMENTATION)Sourceinit initializes a Context with the provided key, for AEGIS-128L or AEGIS-256.
is_hardware_accelerated
is_hardware_accelerated :: proc() -> (bool)Sourceis_hardware_accelerated returns true if and only if (⟺) hardware accelerated AEGIS is supported.
open
open :: proc(
ctx: ^Context,
dst: []u8,
iv: []u8,
aad: []u8,
ciphertext: []u8,
tag: []u8,
) -> (bool)Sourceopen 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)Sourcereset 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,
)Sourceseal 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.