xref: /linux/tools/testing/selftests/arm64/pauth/helper.h (revision cbecf716ca618fd44feda6bd9a64a8179d031fc5)
1e74e1d55SBoyan Karatotev /* SPDX-License-Identifier: GPL-2.0 */
2e74e1d55SBoyan Karatotev /* Copyright (C) 2020 ARM Limited */
3e74e1d55SBoyan Karatotev 
4e74e1d55SBoyan Karatotev #ifndef _HELPER_H_
5e74e1d55SBoyan Karatotev #define _HELPER_H_
6e74e1d55SBoyan Karatotev 
7766d95b1SBoyan Karatotev #include <stdlib.h>
8766d95b1SBoyan Karatotev 
9*806a15b2SBoyan Karatotev #define NKEYS 5
10*806a15b2SBoyan Karatotev 
11*806a15b2SBoyan Karatotev struct signatures {
12*806a15b2SBoyan Karatotev 	size_t keyia;
13*806a15b2SBoyan Karatotev 	size_t keyib;
14*806a15b2SBoyan Karatotev 	size_t keyda;
15*806a15b2SBoyan Karatotev 	size_t keydb;
16*806a15b2SBoyan Karatotev 	size_t keyg;
17*806a15b2SBoyan Karatotev };
18*806a15b2SBoyan Karatotev 
19e74e1d55SBoyan Karatotev void pac_corruptor(void);
20e74e1d55SBoyan Karatotev 
21766d95b1SBoyan Karatotev /* PAuth sign a value with key ia and modifier value 0 */
22766d95b1SBoyan Karatotev size_t keyia_sign(size_t val);
23766d95b1SBoyan Karatotev size_t keyib_sign(size_t val);
24766d95b1SBoyan Karatotev size_t keyda_sign(size_t val);
25766d95b1SBoyan Karatotev size_t keydb_sign(size_t val);
26766d95b1SBoyan Karatotev size_t keyg_sign(size_t val);
27766d95b1SBoyan Karatotev 
28e74e1d55SBoyan Karatotev #endif
29