blob: 7fd7126f593af5ff689fd09eacca89dff5ab996f [file] [log] [blame]
Thomas Gleixner2874c5f2019-05-27 08:55:01 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Herbert Xu63504492015-05-27 14:37:30 +08002/*
3 * geniv: IV generation
4 *
5 * Copyright (c) 2015 Herbert Xu <herbert@gondor.apana.org.au>
Herbert Xu63504492015-05-27 14:37:30 +08006 */
7
8#ifndef _CRYPTO_INTERNAL_GENIV_H
9#define _CRYPTO_INTERNAL_GENIV_H
10
11#include <crypto/internal/aead.h>
12#include <linux/spinlock.h>
Herbert Xu149a3972015-08-13 17:28:58 +080013#include <linux/types.h>
Herbert Xu63504492015-05-27 14:37:30 +080014
15struct aead_geniv_ctx {
16 spinlock_t lock;
17 struct crypto_aead *child;
Kees Cook8d605392018-09-18 19:10:51 -070018 struct crypto_sync_skcipher *sknull;
Herbert Xu149a3972015-08-13 17:28:58 +080019 u8 salt[] __attribute__ ((aligned(__alignof__(u32))));
Herbert Xu63504492015-05-27 14:37:30 +080020};
21
Herbert Xu149a3972015-08-13 17:28:58 +080022struct aead_instance *aead_geniv_alloc(struct crypto_template *tmpl,
Eric Biggerse72b48c2020-07-09 23:20:36 -070023 struct rtattr **tb);
Herbert Xu149a3972015-08-13 17:28:58 +080024int aead_init_geniv(struct crypto_aead *tfm);
25void aead_exit_geniv(struct crypto_aead *tfm);
26
Herbert Xu63504492015-05-27 14:37:30 +080027#endif /* _CRYPTO_INTERNAL_GENIV_H */