1ba3579e6STaehee Yoo /* SPDX-License-Identifier: GPL-2.0-or-later */ 2ba3579e6STaehee Yoo #ifndef ASM_X86_ARIA_AVX_H 3ba3579e6STaehee Yoo #define ASM_X86_ARIA_AVX_H 4ba3579e6STaehee Yoo 5ba3579e6STaehee Yoo #include <linux/types.h> 6ba3579e6STaehee Yoo 7ba3579e6STaehee Yoo #define ARIA_AESNI_PARALLEL_BLOCKS 16 837d8d3aeSTaehee Yoo #define ARIA_AESNI_PARALLEL_BLOCK_SIZE (ARIA_BLOCK_SIZE * ARIA_AESNI_PARALLEL_BLOCKS) 937d8d3aeSTaehee Yoo 1037d8d3aeSTaehee Yoo #define ARIA_AESNI_AVX2_PARALLEL_BLOCKS 32 1137d8d3aeSTaehee Yoo #define ARIA_AESNI_AVX2_PARALLEL_BLOCK_SIZE (ARIA_BLOCK_SIZE * ARIA_AESNI_AVX2_PARALLEL_BLOCKS) 1237d8d3aeSTaehee Yoo 13*c970d420STaehee Yoo #define ARIA_GFNI_AVX512_PARALLEL_BLOCKS 64 14*c970d420STaehee Yoo #define ARIA_GFNI_AVX512_PARALLEL_BLOCK_SIZE (ARIA_BLOCK_SIZE * ARIA_GFNI_AVX512_PARALLEL_BLOCKS) 15*c970d420STaehee Yoo 1637d8d3aeSTaehee Yoo asmlinkage void aria_aesni_avx_encrypt_16way(const void *ctx, u8 *dst, 1737d8d3aeSTaehee Yoo const u8 *src); 1837d8d3aeSTaehee Yoo asmlinkage void aria_aesni_avx_decrypt_16way(const void *ctx, u8 *dst, 1937d8d3aeSTaehee Yoo const u8 *src); 2037d8d3aeSTaehee Yoo asmlinkage void aria_aesni_avx_ctr_crypt_16way(const void *ctx, u8 *dst, 2137d8d3aeSTaehee Yoo const u8 *src, 2237d8d3aeSTaehee Yoo u8 *keystream, u8 *iv); 2337d8d3aeSTaehee Yoo asmlinkage void aria_aesni_avx_gfni_encrypt_16way(const void *ctx, u8 *dst, 2437d8d3aeSTaehee Yoo const u8 *src); 2537d8d3aeSTaehee Yoo asmlinkage void aria_aesni_avx_gfni_decrypt_16way(const void *ctx, u8 *dst, 2637d8d3aeSTaehee Yoo const u8 *src); 2737d8d3aeSTaehee Yoo asmlinkage void aria_aesni_avx_gfni_ctr_crypt_16way(const void *ctx, u8 *dst, 2837d8d3aeSTaehee Yoo const u8 *src, 2937d8d3aeSTaehee Yoo u8 *keystream, u8 *iv); 3037d8d3aeSTaehee Yoo 3137d8d3aeSTaehee Yoo asmlinkage void aria_aesni_avx2_encrypt_32way(const void *ctx, u8 *dst, 3237d8d3aeSTaehee Yoo const u8 *src); 3337d8d3aeSTaehee Yoo asmlinkage void aria_aesni_avx2_decrypt_32way(const void *ctx, u8 *dst, 3437d8d3aeSTaehee Yoo const u8 *src); 3537d8d3aeSTaehee Yoo asmlinkage void aria_aesni_avx2_ctr_crypt_32way(const void *ctx, u8 *dst, 3637d8d3aeSTaehee Yoo const u8 *src, 3737d8d3aeSTaehee Yoo u8 *keystream, u8 *iv); 3837d8d3aeSTaehee Yoo asmlinkage void aria_aesni_avx2_gfni_encrypt_32way(const void *ctx, u8 *dst, 3937d8d3aeSTaehee Yoo const u8 *src); 4037d8d3aeSTaehee Yoo asmlinkage void aria_aesni_avx2_gfni_decrypt_32way(const void *ctx, u8 *dst, 4137d8d3aeSTaehee Yoo const u8 *src); 4237d8d3aeSTaehee Yoo asmlinkage void aria_aesni_avx2_gfni_ctr_crypt_32way(const void *ctx, u8 *dst, 4337d8d3aeSTaehee Yoo const u8 *src, 4437d8d3aeSTaehee Yoo u8 *keystream, u8 *iv); 45ba3579e6STaehee Yoo 46ba3579e6STaehee Yoo struct aria_avx_ops { 47ba3579e6STaehee Yoo void (*aria_encrypt_16way)(const void *ctx, u8 *dst, const u8 *src); 48ba3579e6STaehee Yoo void (*aria_decrypt_16way)(const void *ctx, u8 *dst, const u8 *src); 49ba3579e6STaehee Yoo void (*aria_ctr_crypt_16way)(const void *ctx, u8 *dst, const u8 *src, 50ba3579e6STaehee Yoo u8 *keystream, u8 *iv); 5137d8d3aeSTaehee Yoo void (*aria_encrypt_32way)(const void *ctx, u8 *dst, const u8 *src); 5237d8d3aeSTaehee Yoo void (*aria_decrypt_32way)(const void *ctx, u8 *dst, const u8 *src); 5337d8d3aeSTaehee Yoo void (*aria_ctr_crypt_32way)(const void *ctx, u8 *dst, const u8 *src, 5437d8d3aeSTaehee Yoo u8 *keystream, u8 *iv); 55*c970d420STaehee Yoo void (*aria_encrypt_64way)(const void *ctx, u8 *dst, const u8 *src); 56*c970d420STaehee Yoo void (*aria_decrypt_64way)(const void *ctx, u8 *dst, const u8 *src); 57*c970d420STaehee Yoo void (*aria_ctr_crypt_64way)(const void *ctx, u8 *dst, const u8 *src, 58*c970d420STaehee Yoo u8 *keystream, u8 *iv); 59*c970d420STaehee Yoo 6037d8d3aeSTaehee Yoo 61ba3579e6STaehee Yoo }; 62ba3579e6STaehee Yoo #endif 63