Skip to content
Snippets Groups Projects
Commit 6e11deb8 authored by Niels Möller's avatar Niels Möller
Browse files

(struct nettle_aead): Tentative interface for

authenticated encryption with associated data.

Rev: nettle/nettle-internal.h:1.3
parent dde540df
Branches
Tags
No related merge requests found
......@@ -74,4 +74,54 @@ extern const struct nettle_cipher nettle_openssl_cast128;
extern const struct nettle_hash nettle_openssl_md5;
extern const struct nettle_hash nettle_openssl_sha1;
/* Tentative interface for "authenticated encryption with associated
data" algorithms. Should be moved to nettle-meta.h when stable. */
struct nettle_aead
{
const char *name;
unsigned context_size;
/* Block size of the input, and the size of the output digest */
unsigned block_size;
/* Suggested key size; other sizes are sometimes possible. */
unsigned key_size;
nettle_set_key_func *set_key;
nettle_set_key_func *set_iv;
nettle_hash_update_func *update;
nettle_crypt_func *encrypt;
nettle_crypt_func *decrypt;
nettle_hash_digest_func *digest;
};
#define _NETTLE_AEAD(type, TYPE, name, key_size) { \
#type "-" #name #key_size, \
sizeof(struct type##_##name##_ctx), \
TYPE##_BLOCK_SIZE, \
key_size / 8, \
(nettle_set_key_func *) type##_##name##_set_key, \
(nettle_set_key_func *) type##_##name##_set_iv, \
(nettle_hash_update_func *) type##_##name##_update, \
(nettle_crypt_func *) type##_##name##_encrypt, \
(nettle_crypt_func *) type##_##name##_decrypt, \
(nettle_hash_digest_func *) type##_##name##_digest, \
}
const struct nettle_aead nettle_gcm_aes128;
const struct nettle_aead nettle_gcm_aes192;
const struct nettle_aead nettle_gcm_aes256;
const struct nettle_aead nettle_gcm_camellia128;
const struct nettle_aead nettle_gcm_camellia192;
const struct nettle_aead nettle_gcm_camellia256;
const struct nettle_aead nettle_gcm_serpent128;
const struct nettle_aead nettle_gcm_serpent192;
const struct nettle_aead nettle_gcm_serpent256;
const struct nettle_aead nettle_gcm_twofish128;
const struct nettle_aead nettle_gcm_twofish192;
const struct nettle_aead nettle_gcm_twofish256;
#endif /* NETTLE_INTERNAL_H_INCLUDED */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment