18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci#ifndef ASM_X86_SERPENT_AVX_H 38c2ecf20Sopenharmony_ci#define ASM_X86_SERPENT_AVX_H 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ci#include <crypto/b128ops.h> 68c2ecf20Sopenharmony_ci#include <crypto/serpent.h> 78c2ecf20Sopenharmony_ci#include <linux/types.h> 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_cistruct crypto_skcipher; 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci#define SERPENT_PARALLEL_BLOCKS 8 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_cistruct serpent_xts_ctx { 148c2ecf20Sopenharmony_ci struct serpent_ctx tweak_ctx; 158c2ecf20Sopenharmony_ci struct serpent_ctx crypt_ctx; 168c2ecf20Sopenharmony_ci}; 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ciasmlinkage void serpent_ecb_enc_8way_avx(const void *ctx, u8 *dst, 198c2ecf20Sopenharmony_ci const u8 *src); 208c2ecf20Sopenharmony_ciasmlinkage void serpent_ecb_dec_8way_avx(const void *ctx, u8 *dst, 218c2ecf20Sopenharmony_ci const u8 *src); 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ciasmlinkage void serpent_cbc_dec_8way_avx(const void *ctx, u8 *dst, 248c2ecf20Sopenharmony_ci const u8 *src); 258c2ecf20Sopenharmony_ciasmlinkage void serpent_ctr_8way_avx(const void *ctx, u8 *dst, const u8 *src, 268c2ecf20Sopenharmony_ci le128 *iv); 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ciasmlinkage void serpent_xts_enc_8way_avx(const void *ctx, u8 *dst, 298c2ecf20Sopenharmony_ci const u8 *src, le128 *iv); 308c2ecf20Sopenharmony_ciasmlinkage void serpent_xts_dec_8way_avx(const void *ctx, u8 *dst, 318c2ecf20Sopenharmony_ci const u8 *src, le128 *iv); 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ciextern void __serpent_crypt_ctr(const void *ctx, u8 *dst, const u8 *src, 348c2ecf20Sopenharmony_ci le128 *iv); 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_ciextern void serpent_xts_enc(const void *ctx, u8 *dst, const u8 *src, le128 *iv); 378c2ecf20Sopenharmony_ciextern void serpent_xts_dec(const void *ctx, u8 *dst, const u8 *src, le128 *iv); 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_ciextern int xts_serpent_setkey(struct crypto_skcipher *tfm, const u8 *key, 408c2ecf20Sopenharmony_ci unsigned int keylen); 418c2ecf20Sopenharmony_ci 428c2ecf20Sopenharmony_ci#endif 43