blob: 608e5e367e3d10a9fd85781e7e78272c3824b264 [file] [log] [blame]
Jerry Yu49231312023-01-10 16:57:21 +08001/*
2 * Arm64 crypto engine support functions
3 *
4 * Copyright The Mbed TLS Contributors
5 * SPDX-License-Identifier: Apache-2.0
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License"); you may
8 * not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19
20#include <string.h>
21#include "common.h"
22
23#if defined(MBEDTLS_AESCE_C)
24
25#include "aesce.h"
26
27#if defined(MBEDTLS_HAVE_ARM64)
28
29#if defined(__clang__)
30# if __clang_major__ < 4
31# error "A more recent Clang is required for MBEDTLS_AES_C"
32# endif
33#elif defined(__GNUC__)
34# if __GNUC__ < 6
35# error "A more recent GCC is required for MBEDTLS_AES_C"
36# endif
37#else
38# error "Only GCC and Clang supported for MBEDTLS_AES_C"
39#endif
40
41#if !defined(__ARM_FEATURE_CRYPTO)
42# error "`crypto` feature moddifier MUST be enabled for MBEDTLS_AESCE_C."
43# error "Typical option for GCC and Clang is `-march=armv8-a+crypto`."
44#endif /* !__ARM_FEATURE_CRYPTO */
45
46#include <arm_neon.h>
47
48#endif /* MBEDTLS_HAVE_ARM64 */
49
50#endif /* MBEDTLS_AESCE_C */