Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
torvalds
GitHub Repository: torvalds/linux
Path: blob/master/arch/x86/crypto/aria-avx.h
26424 views
1
/* SPDX-License-Identifier: GPL-2.0-or-later */
2
#ifndef ASM_X86_ARIA_AVX_H
3
#define ASM_X86_ARIA_AVX_H
4
5
#include <linux/types.h>
6
7
#define ARIA_AESNI_PARALLEL_BLOCKS 16
8
#define ARIA_AESNI_PARALLEL_BLOCK_SIZE (ARIA_BLOCK_SIZE * ARIA_AESNI_PARALLEL_BLOCKS)
9
10
#define ARIA_AESNI_AVX2_PARALLEL_BLOCKS 32
11
#define ARIA_AESNI_AVX2_PARALLEL_BLOCK_SIZE (ARIA_BLOCK_SIZE * ARIA_AESNI_AVX2_PARALLEL_BLOCKS)
12
13
#define ARIA_GFNI_AVX512_PARALLEL_BLOCKS 64
14
#define ARIA_GFNI_AVX512_PARALLEL_BLOCK_SIZE (ARIA_BLOCK_SIZE * ARIA_GFNI_AVX512_PARALLEL_BLOCKS)
15
16
asmlinkage void aria_aesni_avx_encrypt_16way(const void *ctx, u8 *dst,
17
const u8 *src);
18
asmlinkage void aria_aesni_avx_decrypt_16way(const void *ctx, u8 *dst,
19
const u8 *src);
20
asmlinkage void aria_aesni_avx_ctr_crypt_16way(const void *ctx, u8 *dst,
21
const u8 *src,
22
u8 *keystream, u8 *iv);
23
asmlinkage void aria_aesni_avx_gfni_encrypt_16way(const void *ctx, u8 *dst,
24
const u8 *src);
25
asmlinkage void aria_aesni_avx_gfni_decrypt_16way(const void *ctx, u8 *dst,
26
const u8 *src);
27
asmlinkage void aria_aesni_avx_gfni_ctr_crypt_16way(const void *ctx, u8 *dst,
28
const u8 *src,
29
u8 *keystream, u8 *iv);
30
31
asmlinkage void aria_aesni_avx2_encrypt_32way(const void *ctx, u8 *dst,
32
const u8 *src);
33
asmlinkage void aria_aesni_avx2_decrypt_32way(const void *ctx, u8 *dst,
34
const u8 *src);
35
asmlinkage void aria_aesni_avx2_ctr_crypt_32way(const void *ctx, u8 *dst,
36
const u8 *src,
37
u8 *keystream, u8 *iv);
38
asmlinkage void aria_aesni_avx2_gfni_encrypt_32way(const void *ctx, u8 *dst,
39
const u8 *src);
40
asmlinkage void aria_aesni_avx2_gfni_decrypt_32way(const void *ctx, u8 *dst,
41
const u8 *src);
42
asmlinkage void aria_aesni_avx2_gfni_ctr_crypt_32way(const void *ctx, u8 *dst,
43
const u8 *src,
44
u8 *keystream, u8 *iv);
45
46
struct aria_avx_ops {
47
void (*aria_encrypt_16way)(const void *ctx, u8 *dst, const u8 *src);
48
void (*aria_decrypt_16way)(const void *ctx, u8 *dst, const u8 *src);
49
void (*aria_ctr_crypt_16way)(const void *ctx, u8 *dst, const u8 *src,
50
u8 *keystream, u8 *iv);
51
void (*aria_encrypt_32way)(const void *ctx, u8 *dst, const u8 *src);
52
void (*aria_decrypt_32way)(const void *ctx, u8 *dst, const u8 *src);
53
void (*aria_ctr_crypt_32way)(const void *ctx, u8 *dst, const u8 *src,
54
u8 *keystream, u8 *iv);
55
void (*aria_encrypt_64way)(const void *ctx, u8 *dst, const u8 *src);
56
void (*aria_decrypt_64way)(const void *ctx, u8 *dst, const u8 *src);
57
void (*aria_ctr_crypt_64way)(const void *ctx, u8 *dst, const u8 *src,
58
u8 *keystream, u8 *iv);
59
60
61
};
62
#endif
63
64