Lightweight Cryptography Primitives
|
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. | |
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.
#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 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.
m | Buffer to receive the plaintext message on output. |
mlen | Receives the length of the plaintext message on output. |
c | Buffer that contains the ciphertext and authentication tag to decrypt. |
clen | Length of the input data in bytes, which includes the ciphertext and the authentication tag. |
ad | Buffer that contains associated data to authenticate along with the packet but which does not need to be encrypted. |
adlen | Length of the associated data in bytes. |
npub | Points to the public nonce for the packet. |
k | Points to the key to use to decrypt the packet. |
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.
c | Buffer to receive the output. |
clen | On exit, set to the length of the output which includes the ciphertext and the authentication tag. |
m | Buffer that contains the plaintext message to encrypt. |
mlen | Length of the plaintext message in bytes. |
ad | Buffer that contains associated data to authenticate along with the packet but which does not need to be encrypted. |
adlen | Length of the associated data in bytes. |
npub | Points to the public nonce for the packet. |
k | Points to the key to use to encrypt the packet. |
typedef int(* aead_cipher_pk_init_t)(unsigned char *pk, const unsigned char *k) |
Initializes a pre-computed key for an AEAD scheme.
pk | Points to the object to receive the pre-computed key value. |
k | Points to the bytes of the key. |
typedef void(* aead_hash_finalize_t)(void *state, unsigned char *out) |
Returns the final hash value from a hashing operation.
Hash | state to be finalized. |
out | Points to the output buffer to receive the hash value. |
typedef void(* aead_hash_init_t)(void *state) |
Initializes the state for a hashing operation.
state | Hash 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.
out | Buffer to receive the hash output. |
in | Points to the input data to be hashed. |
inlen | Length of the input data in bytes. |
typedef void(* aead_hash_update_t)(void *state, const unsigned char *in, size_t inlen) |
Updates a hash state with more input data.
state | Hash state to be updated. |
in | Points to the input data to be incorporated into the state. |
inlen | Length 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.
state | XOF state to be updated. |
in | Points to the input data to be absorbed into the state. |
inlen | Length of the input data to be absorbed into the state. |
typedef void(* aead_xof_squeeze_t)(void *state, unsigned char *out, size_t outlen) |
Squeezes output data from an XOF state.
state | XOF state to squeeze the output data from. |
out | Points to the output buffer to receive the squeezed data. |
outlen | Number of bytes of data to squeeze out of the state. |