CryptoSys API Library Manual

An interface for Authenticated Encryption with Associated Data (AEAD)

The AEAD functions and Aead Class methods provide AEAD encryption and decryption based on [RFC5116]. The following AEAD algorithms are provided:

The functions AEAD_Encrypt and AEAD_Decrypt provide a simple, stateless interface to do one-off computations. These two functions deal with the authenticated tag separately. The functions AEAD_EncryptWithTag and AEAD_DecryptWithTag provide one-off AEAD encryption but append the tag to the end of the output.

If you need to process a large quantity of data in chunks, use the stateful, incremental functions AEAD_InitKey, AEAD_SetNonce, ..., AEAD_Destroy. The correct sequence to call these functions is described below.

Note also that the AEAD_AES_xxx_GCM algorithms only support 128- and 256-bit AES keys and the IV (nonce) must be exactly 12 bytes long. If you want to use AES-GCM with AES-192 or an IV of a different length, use the older GCM functions.

Table of parameters as defined in Section 4 of [RFC5116] (all values in octets):

ParameterAES_128_GCMAES_256_GCMCHACHA20_POLY1305Description
K_LEN163232Fixed key length
P_MAX2^36 - 312^36 - 312^38 - 64Max plaintext length
A_MAX2^61 - 12^61 - 12^64 - 1Max AAD length
N_MIN121212Min nonce length
N_MAX121212Max nonce length
C_MAX2^36 - 152^36 - 152^38 - 48Max ciphertext length

The tag length for all supported algorithms is 16 octets. Note that the maximum length of a byte array in this toolkit is limited to 2^32 - 1.

[PREV: Extensions to block cipher functions for files...]   [Contents]   [Index]   
   [NEXT: Correct sequence for AEAD incremental functions...]

Copyright © 2001-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-01-07T07:42:00Z.