Software APIs
lc_ctrl_fi.h
1 // Copyright lowRISC contributors (OpenTitan project).
2 // Licensed under the Apache License, Version 2.0, see LICENSE for details.
3 // SPDX-License-Identifier: Apache-2.0
4 
5 #ifndef OPENTITAN_SW_DEVICE_TESTS_PENETRATIONTESTS_FIRMWARE_FI_LC_CTRL_FI_H_
6 #define OPENTITAN_SW_DEVICE_TESTS_PENETRATIONTESTS_FIRMWARE_FI_LC_CTRL_FI_H_
7 
8 #include "sw/device/lib/base/status.h"
9 #include "sw/device/lib/ujson/ujson.h"
10 
11 /**
12  * Initializes the trigger and configures the device for the LC CTRL FI test.
13  *
14  * @param uj An initialized uJSON context.
15  * @return OK or error.
16  */
17 status_t handle_lc_ctrl_fi_init(ujson_t *uj);
18 
19 /**
20  * lc_ctrl.runtime_corruption command handler.
21  *
22  * Try to manipulate the LC state and counter using FI.
23  *
24  * Faults are injected during the trigger_high & trigger_low.
25  *
26  * @param uj An initialized uJSON context.
27  * @return OK or error.
28  */
29 status_t handle_lc_ctrl_fi_runtime_corruption(ujson_t *uj);
30 
31 /**
32  * LC CTRL FI command handler.
33  *
34  * Command handler for the LC CTRL FI command.
35  *
36  * @param uj An initialized uJSON context.
37  * @return OK or error.
38  */
39 status_t handle_lc_ctrl_fi(ujson_t *uj);
40 
41 #endif // OPENTITAN_SW_DEVICE_TESTS_PENETRATIONTESTS_FIRMWARE_FI_LC_CTRL_FI_H_