blob: c8d577fe42e347f3173ffe406267bfbe06252bc2 [file] [log] [blame]
Alexei Fedorov719714f2019-10-03 10:57:53 +01001/*
Shruti Gupta9d0cfe82023-04-17 10:57:26 +01002 * Copyright (c) 2019-2023, Arm Limited. All rights reserved.
Alexei Fedorov719714f2019-10-03 10:57:53 +01003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef PAUTH_H
8#define PAUTH_H
9
Shruti Gupta9d0cfe82023-04-17 10:57:26 +010010#include <stdbool.h>
Alexei Fedorov719714f2019-10-03 10:57:53 +010011#include <stdint.h>
12
13#ifdef __aarch64__
14/* Initialize 128-bit ARMv8.3-PAuth key */
15uint128_t init_apkey(void);
16
17/* Program APIAKey_EL1 key and enable ARMv8.3-PAuth */
18void pauth_init_enable(void);
Alexei Fedorov52fd7332020-01-08 14:02:18 +000019
20/* Disable ARMv8.3-PAuth */
21void pauth_disable(void);
Shruti Gupta9d0cfe82023-04-17 10:57:26 +010022
23/*
24 * Fill Pauth Keys and template with random values if keys werenot initialized earlier,
25 * Else Copy PAuth key registers to template.
26 */
27void pauth_test_lib_fill_regs_and_template(void);
28
29/* Read and Compare PAuth registers with provided template values. */
30bool pauth_test_lib_compare_template(void);
31
32/* Read and Store PAuth registers in template. */
33void pauth_test_lib_read_keys(void);
34
35/* Test PAuth instructions. */
36void pauth_test_lib_test_intrs(void);
37
Alexei Fedorov719714f2019-10-03 10:57:53 +010038#endif /* __aarch64__ */
39
40#endif /* PAUTH_H */