^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-or-later */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * geniv: IV generation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright (c) 2015 Herbert Xu <herbert@gondor.apana.org.au>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #ifndef _CRYPTO_INTERNAL_GENIV_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #define _CRYPTO_INTERNAL_GENIV_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <crypto/internal/aead.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <linux/spinlock.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) struct aead_geniv_ctx {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) spinlock_t lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) struct crypto_aead *child;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) struct crypto_sync_skcipher *sknull;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) u8 salt[] __attribute__ ((aligned(__alignof__(u32))));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) struct aead_instance *aead_geniv_alloc(struct crypto_template *tmpl,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) struct rtattr **tb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) int aead_init_geniv(struct crypto_aead *tfm);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) void aead_exit_geniv(struct crypto_aead *tfm);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #endif /* _CRYPTO_INTERNAL_GENIV_H */