Debian Codegraph @

others/mbedtls/tf-psa-crypto/drivers/pqcp/mldsa-native/dev/fips202/aarch64/x1_v84a.h

raw
1 /*
2 * Copyright (c) The mlkem-native project authors
3 * Copyright (c) The mldsa-native project authors
4 * SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
5 */
6
7 #ifndef MLD_FIPS202_NATIVE_AARCH64_X1_V84A_H
8 #define MLD_FIPS202_NATIVE_AARCH64_X1_V84A_H
9
10 #if !defined(__ARM_FEATURE_SHA3)
11 #error This backend can only be used if SHA3 extensions are available.
12 #endif
13
14 /* Part of backend API */
15 #define MLD_USE_FIPS202_X1_NATIVE
16 /* Guard for assembly file */
17 #define MLD_FIPS202_AARCH64_NEED_X1_V84A
18
19 #if !defined(__ASSEMBLER__)
20 #include "../api.h"
21 #include "src/fips202_native_aarch64.h"
22 static MLD_INLINE int mld_keccak_f1600_x1_native(uint64_t *state)
23 {
24 if (!mld_sys_check_capability(MLD_SYS_CAP_SHA3))
25 {
26 return MLD_NATIVE_FUNC_FALLBACK;
27 }
28
29 mld_keccak_f1600_x1_v84a_asm(state, mld_keccakf1600_round_constants);
30 return MLD_NATIVE_FUNC_SUCCESS;
31 }
32 #endif /* !__ASSEMBLER__ */
33
34 #endif /* !MLD_FIPS202_NATIVE_AARCH64_X1_V84A_H */