Debian Codegraph @

cipher/camellia-aarch64-ce.c

raw
1 /* camellia-aarch64-ce.c - ARMv8/CE Camellia implementation
2 * Copyright (C) 2023 Jussi Kivilinna <[email protected]>
3 *
4 * This file is part of Libgcrypt.
5 *
6 * Libgcrypt is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation; either version 2.1 of
9 * the License, or (at your option) any later version.
10 *
11 * Libgcrypt is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this program; if not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #include <config.h>
21
22 #if defined(__AARCH64EL__) && \
23 defined(HAVE_COMPATIBLE_GCC_AARCH64_PLATFORM_AS) && \
24 defined(HAVE_GCC_INLINE_ASM_AARCH64_CRYPTO) && \
25 defined(HAVE_COMPATIBLE_CC_AARCH64_NEON_INTRINSICS) && \
26 (__GNUC__ >= 4)
27
28 #ifdef HAVE_GCC_ATTRIBUTE_OPTIMIZE
29 # define FUNC_ATTR_OPT __attribute__((optimize("-O2")))
30 #else
31 # define FUNC_ATTR_OPT
32 #endif
33
34 #define SIMD128_OPT_ATTR FUNC_ATTR_OPT
35
36 #define FUNC_ENC_BLK16 _gcry_camellia_aarch64ce_encrypt_blk16
37 #define FUNC_DEC_BLK16 _gcry_camellia_aarch64ce_decrypt_blk16
38 #define FUNC_KEY_SETUP _gcry_camellia_aarch64ce_keygen
39
40 #include "camellia-simd128.h"
41
42 #endif /* __AARCH64EL__ */