Software APIs
usage_constraints.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_SILICON_CREATOR_LIB_SIGVERIFY_USAGE_CONSTRAINTS_H_
6 #define OPENTITAN_SW_DEVICE_SILICON_CREATOR_LIB_SIGVERIFY_USAGE_CONSTRAINTS_H_
7 
8 #include "sw/device/silicon_creator/lib/manifest.h"
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif // __cplusplus
13 
14 /**
15  * Gets the usage constraints struct that is used for verifying boot stage
16  * images stored in flash.
17  *
18  * This function reads
19  * - The device identifier from the life cycle controller,
20  * - Creator and owner manufacturing states from the OTP,
21  * - The life cycle state from life cycle controller, and
22  * masks the fields of `usage_constraints` according to the given
23  * `selector_bits`.
24  *
25  * See also: `manifest_usage_constraints_t`.
26  *
27  * @param selector_bits Selector bits of the manifest of the ROM_EXT to be
28  * verified.
29  * @param[out] usage_constraints Usage constraints.
30  */
31 void sigverify_usage_constraints_get(
32  uint32_t selector_bits, manifest_usage_constraints_t *usage_constraints);
33 
34 #ifdef __cplusplus
35 } // extern "C"
36 #endif // __cplusplus
37 
38 #endif // OPENTITAN_SW_DEVICE_SILICON_CREATOR_LIB_SIGVERIFY_USAGE_CONSTRAINTS_H_