Lightweight Cryptography Primitives
 All Data Structures Files Functions Variables Typedefs Macros Pages
Data Structures | Macros | Typedefs | Variables
aead-metadata.h File Reference

Metadata defintions for AEAD and hashing schemes. More...

#include <stddef.h>

Go to the source code of this file.

Data Structures

struct  aead_cipher_t
 Meta-information about an AEAD cipher. More...
 
struct  aead_hash_algorithm_t
 Meta-information about a hash algorithm that is related to an AEAD. More...
 

Macros

#define AEAD_FLAG_NONE   0x0000
 No special AEAD features.
 
#define AEAD_FLAG_LITTLE_ENDIAN   0x0001
 The natural byte order of the AEAD cipher is little-endian. More...
 
#define AEAD_FLAG_SC_PROTECT_KEY   0x0002
 The AEAD mode provides side-channel protection for the key.
 
#define AEAD_FLAG_SC_PROTECT_ALL   0x0004
 The AEAD mode provides side-channel protection for all block operations.
 
#define AEAD_FLAG_SLOW   0x0008
 Algorithm is very slow in software, so performance frameworks may want to use a different testing approach to avoid taking too long.
 
#define AEAD_FLAG_MASKED   0x0010
 Algorithm uses masking to protect sensitive material.
 

Typedefs

typedef int(* aead_cipher_encrypt_t )(unsigned char *c, size_t *clen, const unsigned char *m, size_t mlen, const unsigned char *ad, size_t adlen, const unsigned char *npub, const unsigned char *k)
 Encrypts and authenticates a packet with an AEAD scheme. More...
 
typedef int(* aead_cipher_decrypt_t )(unsigned char *m, size_t *mlen, const unsigned char *c, size_t clen, const unsigned char *ad, size_t adlen, const unsigned char *npub, const unsigned char *k)
 Decrypts and authenticates a packet with an AEAD scheme. More...
 
typedef int(* aead_cipher_pk_init_t )(unsigned char *pk, const unsigned char *k)
 Initializes a pre-computed key for an AEAD scheme. More...
 
typedef int(* aead_hash_t )(unsigned char *out, const unsigned char *in, size_t inlen)
 Hashes a block of input data. More...
 
typedef void(* aead_hash_init_t )(void *state)
 Initializes the state for a hashing operation. More...
 
typedef void(* aead_hash_update_t )(void *state, const unsigned char *in, size_t inlen)
 Updates a hash state with more input data. More...
 
typedef void(* aead_hash_finalize_t )(void *state, unsigned char *out)
 Returns the final hash value from a hashing operation. More...
 
typedef void(* aead_xof_absorb_t )(void *state, const unsigned char *in, size_t inlen)
 Aborbs more input data into an XOF state. More...
 
typedef void(* aead_xof_squeeze_t )(void *state, unsigned char *out, size_t outlen)
 Squeezes output data from an XOF state. More...
 

Variables

aead_cipher_t const aesgcm128_cipher
 Meta-information block for the AES-128-GCM cipher.
 
aead_cipher_t const aesgcm192_cipher
 Meta-information block for the AES-192-GCM cipher.
 
aead_cipher_t const aesgcm256_cipher
 Meta-information block for the AES-256-GCM cipher.
 
aead_cipher_t const ascon128_cipher
 Meta-information block for the ASCON-128 cipher.
 
aead_cipher_t const ascon128a_cipher
 Meta-information block for the ASCON-128a cipher.
 
aead_cipher_t const ascon80pq_cipher
 Meta-information block for the ASCON-80pq cipher.
 
aead_hash_algorithm_t const ascon_hash_algorithm
 Meta-information block for the ASCON-HASH algorithm.
 
aead_hash_algorithm_t const ascon_hasha_algorithm
 Meta-information block for the ASCON-HASHA algorithm.
 
aead_hash_algorithm_t const ascon_xof_algorithm
 Meta-information block for the ASCON-XOF algorithm.
 
aead_hash_algorithm_t const ascon_xofa_algorithm
 Meta-information block for the ASCON-XOFA algorithm.
 
aead_cipher_t const ascon128_masked_cipher
 Meta-information block for the masked ASCON-128 cipher.
 
aead_cipher_t const ascon128a_masked_cipher
 Meta-information block for the masked ASCON-128a cipher.
 
aead_cipher_t const ascon80pq_masked_cipher
 Meta-information block for the masked ASCON-80pq cipher.
 
aead_cipher_t const ascon128_siv_cipher
 Meta-information block for the ASCON-128-SIV cipher.
 
aead_cipher_t const ascon128a_siv_cipher
 Meta-information block for the ASCON-128a-SIV cipher.
 
aead_cipher_t const ascon80pq_siv_cipher
 Meta-information block for the ASCON-80pq-SIV cipher.
 
aead_cipher_t const delirium_cipher
 Meta-information block for the Delirium cipher.
 
aead_cipher_t const dumbo_cipher
 Meta-information block for the Dumbo cipher.
 
aead_cipher_t const jumbo_cipher
 Meta-information block for the Jumbo cipher.
 
aead_cipher_t const gift_cofb_cipher
 Meta-information block for the GIFT-COFB cipher.
 
aead_cipher_t const gift_cofb_masked_cipher
 Meta-information block for the masked GIFT-COFB cipher.
 
aead_cipher_t const grain128_aead_cipher
 Meta-information block for the Grain-128AEAD cipher.
 
aead_cipher_t const isap_keccak_128a_cipher
 Meta-information block for the ISAP-K-128A cipher.
 
aead_cipher_t const isap_ascon_128a_cipher
 Meta-information block for the ISAP-A-128A cipher.
 
aead_cipher_t const isap_keccak_128_cipher
 Meta-information block for the ISAP-K-128 cipher.
 
aead_cipher_t const isap_ascon_128_cipher
 Meta-information block for the ISAP-A-128 cipher.
 
aead_cipher_t const isap_keccak_128a_pk_cipher
 Meta-information block for the pre-computed ISAP-K-128A cipher.
 
aead_cipher_t const isap_ascon_128a_pk_cipher
 Meta-information block for the pre-computed ISAP-A-128A cipher.
 
aead_cipher_t const isap_keccak_128_pk_cipher
 Meta-information block for the pre-computed ISAP-K-128 cipher.
 
aead_cipher_t const isap_ascon_128_pk_cipher
 Meta-information block for the pre-computed ISAP-A-128 cipher.
 
aead_cipher_t const photon_beetle_128_cipher
 Meta-information block for the PHOTON-Beetle-AEAD-ENC-128 cipher.
 
aead_cipher_t const photon_beetle_32_cipher
 Meta-information block for the PHOTON-Beetle-AEAD-ENC-32 cipher.
 
aead_hash_algorithm_t const photon_beetle_hash_algorithm
 Meta-information block for the PHOTON-Beetle-HASH algorithm.
 
aead_cipher_t const romulus_n_cipher
 Meta-information block for the Romulus-N cipher.
 
aead_cipher_t const romulus_m_cipher
 Meta-information block for the Romulus-M cipher.
 
aead_cipher_t const romulus_t_cipher
 Meta-information block for the Romulus-T cipher.
 
aead_hash_algorithm_t const romulus_hash_algorithm
 Meta-information block for the Romulus-H hash algorithm.
 
aead_hash_algorithm_t const romulus_xof_algorithm
 Meta-information block for the Romulus-H based XOF algorithm.
 
aead_cipher_t const schwaemm_256_128_cipher
 Meta-information block for the Schwaemm256-128 cipher.
 
aead_cipher_t const schwaemm_192_192_cipher
 Meta-information block for the Schwaemm192-192 cipher.
 
aead_cipher_t const schwaemm_128_128_cipher
 Meta-information block for the Schwaemm128-128 cipher.
 
aead_cipher_t const schwaemm_256_256_cipher
 Meta-information block for the Schwaemm256-256 cipher.
 
aead_hash_algorithm_t const esch_256_hash_algorithm
 Meta-information block for the Esch256 hash algorithm.
 
aead_hash_algorithm_t const esch_384_hash_algorithm
 Meta-information block for the Esch384 hash algorithm.
 
aead_hash_algorithm_t const esch_256_xof_algorithm
 Meta-information block for the XOEsch256 XOF algorithm.
 
aead_hash_algorithm_t const esch_384_xof_algorithm
 Meta-information block for the XOEsch384 XOF algorithm.
 
aead_cipher_t const tiny_jambu_128_cipher
 Meta-information block for the TinyJAMBU-128 cipher.
 
aead_cipher_t const tiny_jambu_192_cipher
 Meta-information block for the TinyJAMBU-192 cipher.
 
aead_cipher_t const tiny_jambu_256_cipher
 Meta-information block for the TinyJAMBU-256 cipher.
 
aead_cipher_t const tiny_jambu_128_masked_cipher
 Meta-information block for the masked TinyJAMBU-128 cipher.
 
aead_cipher_t const tiny_jambu_192_masked_cipher
 Meta-information block for the masked TinyJAMBU-192 cipher.
 
aead_cipher_t const tiny_jambu_256_masked_cipher
 Meta-information block for the masked TinyJAMBU-256 cipher.
 
aead_cipher_t const xoodyak_cipher
 Meta-information block for the Xoodyak cipher.
 
aead_hash_algorithm_t const xoodyak_hash_algorithm
 Meta-information block for the Xoodyak hash algorithm.
 
aead_cipher_t const xoodyak_masked_cipher
 Meta-information block for the masked Xoodyak cipher.
 

Detailed Description

Metadata defintions for AEAD and hashing schemes.

This module provides metadata about the other implementations that is useful for testing and benchmarking frameworks, but isn't part of the main code for the algorithms.

Macro Definition Documentation

#define AEAD_FLAG_LITTLE_ENDIAN   0x0001

The natural byte order of the AEAD cipher is little-endian.

If this flag is not present, then the natural byte order of the AEAD cipher should be assumed to be big-endian.

The natural byte order may be useful when formatting packet sequence numbers as nonces. The application needs to know whether the sequence number should be packed into the leading or trailing bytes of the nonce.

Typedef Documentation

typedef int(* aead_cipher_decrypt_t)(unsigned char *m, size_t *mlen, const unsigned char *c, size_t clen, const unsigned char *ad, size_t adlen, const unsigned char *npub, const unsigned char *k)

Decrypts and authenticates a packet with an AEAD scheme.

Parameters
mBuffer to receive the plaintext message on output.
mlenReceives the length of the plaintext message on output.
cBuffer that contains the ciphertext and authentication tag to decrypt.
clenLength of the input data in bytes, which includes the ciphertext and the authentication tag.
adBuffer that contains associated data to authenticate along with the packet but which does not need to be encrypted.
adlenLength of the associated data in bytes.
npubPoints to the public nonce for the packet.
kPoints to the key to use to decrypt the packet.
Returns
0 on success, -1 if the authentication tag was incorrect, or some other negative number if there was an error in the parameters.
typedef int(* aead_cipher_encrypt_t)(unsigned char *c, size_t *clen, const unsigned char *m, size_t mlen, const unsigned char *ad, size_t adlen, const unsigned char *npub, const unsigned char *k)

Encrypts and authenticates a packet with an AEAD scheme.

Parameters
cBuffer to receive the output.
clenOn exit, set to the length of the output which includes the ciphertext and the authentication tag.
mBuffer that contains the plaintext message to encrypt.
mlenLength of the plaintext message in bytes.
adBuffer that contains associated data to authenticate along with the packet but which does not need to be encrypted.
adlenLength of the associated data in bytes.
npubPoints to the public nonce for the packet.
kPoints to the key to use to encrypt the packet.
Returns
0 on success, or a negative value if there was an error in the parameters.
typedef int(* aead_cipher_pk_init_t)(unsigned char *pk, const unsigned char *k)

Initializes a pre-computed key for an AEAD scheme.

Parameters
pkPoints to the object to receive the pre-computed key value.
kPoints to the bytes of the key.
Returns
0 on success, or a negative value if there was an error in the parameters.
typedef void(* aead_hash_finalize_t)(void *state, unsigned char *out)

Returns the final hash value from a hashing operation.

Parameters
Hashstate to be finalized.
outPoints to the output buffer to receive the hash value.
typedef void(* aead_hash_init_t)(void *state)

Initializes the state for a hashing operation.

Parameters
stateHash state to be initialized.
typedef int(* aead_hash_t)(unsigned char *out, const unsigned char *in, size_t inlen)

Hashes a block of input data.

Parameters
outBuffer to receive the hash output.
inPoints to the input data to be hashed.
inlenLength of the input data in bytes.
Returns
Returns zero on success or -1 if there was an error in the parameters.
typedef void(* aead_hash_update_t)(void *state, const unsigned char *in, size_t inlen)

Updates a hash state with more input data.

Parameters
stateHash state to be updated.
inPoints to the input data to be incorporated into the state.
inlenLength of the input data to be incorporated into the state.
typedef void(* aead_xof_absorb_t)(void *state, const unsigned char *in, size_t inlen)

Aborbs more input data into an XOF state.

Parameters
stateXOF state to be updated.
inPoints to the input data to be absorbed into the state.
inlenLength of the input data to be absorbed into the state.
See Also
ascon_xof_init(), ascon_xof_squeeze()
typedef void(* aead_xof_squeeze_t)(void *state, unsigned char *out, size_t outlen)

Squeezes output data from an XOF state.

Parameters
stateXOF state to squeeze the output data from.
outPoints to the output buffer to receive the squeezed data.
outlenNumber of bytes of data to squeeze out of the state.