Software APIs
ibex_sca_commands.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_JSON_IBEX_SCA_COMMANDS_H_
6 #define OPENTITAN_SW_DEVICE_TESTS_PENETRATIONTESTS_JSON_IBEX_SCA_COMMANDS_H_
7 #include "sw/device/lib/ujson/ujson_derive.h"
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 // clang-format off
13 
14 #define IBEXSCA_SUBCOMMAND(_, value) \
15  value(_, Init) \
16  value(_, KeySideloading) \
17  value(_, RFRead) \
18  value(_, RFReadBatchFvsr) \
19  value(_, RFReadBatchRandom) \
20  value(_, RFWrite) \
21  value(_, RFWriteBatchFvsr) \
22  value(_, RFWriteBatchRandom) \
23  value(_, TLRead) \
24  value(_, TLReadBatchFvsr) \
25  value(_, TLReadBatchFvsrFixAddress) \
26  value(_, TLReadBatchRandom) \
27  value(_, TLReadBatchRandomFixAddress) \
28  value(_, TLWrite) \
29  value(_, TLWriteBatchFvsr) \
30  value(_, TLWriteBatchFvsrFixAddress) \
31  value(_, TLWriteBatchRandom) \
32  value(_, TLWriteBatchRandomFixAddress)
33 UJSON_SERDE_ENUM(IbexScaSubcommand, ibex_sca_subcommand_t, IBEXSCA_SUBCOMMAND);
34 
35 #define IBEXSCA_TEST_DATA(field, string) \
36  field(data, uint32_t, 8)
37 UJSON_SERDE_STRUCT(IbexScaTestData, ibex_sca_test_data_t, IBEXSCA_TEST_DATA);
38 
39 #define IBEXSCA_SALT(field, string) \
40  field(salt, uint32_t, 8)
41 UJSON_SERDE_STRUCT(IbexScaSalt, ibex_sca_salt_t, IBEXSCA_SALT);
42 
43 #define IBEXSCA_KEY(field, string) \
44  field(share0, uint32_t, 8) \
45  field(share1, uint32_t, 8)
46 UJSON_SERDE_STRUCT(IbexScaKey, ibex_sca_key_t, IBEXSCA_KEY);
47 
48 #define IBEXSCA_TEST_FVSR(field, string) \
49  field(num_iterations, uint32_t) \
50  field(fixed_data, uint32_t)
51 UJSON_SERDE_STRUCT(IbexScaTestFvsr, ibex_sca_test_fvsr_t, IBEXSCA_TEST_FVSR);
52 
53 #define IBEXSCA_RESULT(field, string) \
54  field(result, uint32_t)
55 UJSON_SERDE_STRUCT(IbexScaResult, ibex_sca_result_t, IBEXSCA_RESULT);
56 
57 #define IBEXSCA_BATCH(field, string) \
58  field(num_iterations, uint32_t)
59 UJSON_SERDE_STRUCT(IbexScaBatch, ibex_sca_batch_t, IBEXSCA_BATCH);
60 
61 // clang-format on
62 
63 #ifdef __cplusplus
64 }
65 #endif
66 #endif // OPENTITAN_SW_DEVICE_TESTS_PENETRATIONTESTS_JSON_IBEX_SCA_COMMANDS_H_