#include <crypto/algapi.h>
#include <crypto/internal/aead.h>
#include <crypto/internal/simd.h>
#include <crypto/internal/skcipher.h>
#include <crypto/scatterwalk.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/jump_label.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/scatterlist.h>
#include <asm/simd.h>
#include "aegis.h"
#define AEGIS128_NONCE_SIZE …
#define AEGIS128_STATE_BLOCKS …
#define AEGIS128_KEY_SIZE …
#define AEGIS128_MIN_AUTH_SIZE …
#define AEGIS128_MAX_AUTH_SIZE …
struct aegis_state { … };
struct aegis_ctx { … };
static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_simd);
static const union aegis_block crypto_aegis_const[2] = …;
static bool aegis128_do_simd(void)
{ … }
static void crypto_aegis128_update(struct aegis_state *state)
{ … }
static void crypto_aegis128_update_a(struct aegis_state *state,
const union aegis_block *msg,
bool do_simd)
{ … }
static void crypto_aegis128_update_u(struct aegis_state *state, const void *msg,
bool do_simd)
{ … }
static void crypto_aegis128_init(struct aegis_state *state,
const union aegis_block *key,
const u8 *iv)
{ … }
static void crypto_aegis128_ad(struct aegis_state *state,
const u8 *src, unsigned int size,
bool do_simd)
{ … }
static void crypto_aegis128_wipe_chunk(struct aegis_state *state, u8 *dst,
const u8 *src, unsigned int size)
{ … }
static void crypto_aegis128_encrypt_chunk(struct aegis_state *state, u8 *dst,
const u8 *src, unsigned int size)
{ … }
static void crypto_aegis128_decrypt_chunk(struct aegis_state *state, u8 *dst,
const u8 *src, unsigned int size)
{ … }
static void crypto_aegis128_process_ad(struct aegis_state *state,
struct scatterlist *sg_src,
unsigned int assoclen,
bool do_simd)
{ … }
static __always_inline
int crypto_aegis128_process_crypt(struct aegis_state *state,
struct skcipher_walk *walk,
void (*crypt)(struct aegis_state *state,
u8 *dst, const u8 *src,
unsigned int size))
{ … }
static void crypto_aegis128_final(struct aegis_state *state,
union aegis_block *tag_xor,
u64 assoclen, u64 cryptlen)
{ … }
static int crypto_aegis128_setkey(struct crypto_aead *aead, const u8 *key,
unsigned int keylen)
{ … }
static int crypto_aegis128_setauthsize(struct crypto_aead *tfm,
unsigned int authsize)
{ … }
static int crypto_aegis128_encrypt_generic(struct aead_request *req)
{ … }
static int crypto_aegis128_decrypt_generic(struct aead_request *req)
{ … }
static int crypto_aegis128_encrypt_simd(struct aead_request *req)
{ … }
static int crypto_aegis128_decrypt_simd(struct aead_request *req)
{ … }
static struct aead_alg crypto_aegis128_alg_generic = …;
static struct aead_alg crypto_aegis128_alg_simd = …;
static int __init crypto_aegis128_module_init(void)
{ … }
static void __exit crypto_aegis128_module_exit(void)
{ … }
subsys_initcall(crypto_aegis128_module_init);
module_exit(crypto_aegis128_module_exit);
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_ALIAS_CRYPTO(…) …;
MODULE_ALIAS_CRYPTO(…) …;
MODULE_ALIAS_CRYPTO(…) …;