162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * geniv: IV generation
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Copyright (c) 2015 Herbert Xu <herbert@gondor.apana.org.au>
662306a36Sopenharmony_ci */
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci#ifndef _CRYPTO_INTERNAL_GENIV_H
962306a36Sopenharmony_ci#define _CRYPTO_INTERNAL_GENIV_H
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci#include <crypto/internal/aead.h>
1262306a36Sopenharmony_ci#include <linux/spinlock.h>
1362306a36Sopenharmony_ci#include <linux/types.h>
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_cistruct aead_geniv_ctx {
1662306a36Sopenharmony_ci	spinlock_t lock;
1762306a36Sopenharmony_ci	struct crypto_aead *child;
1862306a36Sopenharmony_ci	struct crypto_sync_skcipher *sknull;
1962306a36Sopenharmony_ci	u8 salt[] __attribute__ ((aligned(__alignof__(u32))));
2062306a36Sopenharmony_ci};
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_cistruct aead_instance *aead_geniv_alloc(struct crypto_template *tmpl,
2362306a36Sopenharmony_ci				       struct rtattr **tb);
2462306a36Sopenharmony_ciint aead_init_geniv(struct crypto_aead *tfm);
2562306a36Sopenharmony_civoid aead_exit_geniv(struct crypto_aead *tfm);
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_ci#endif	/* _CRYPTO_INTERNAL_GENIV_H */
28