Software APIs
ibex.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 #ifndef OPENTITAN_SW_DEVICE_LIB_CRYPTO_DRIVERS_IBEX_H_
5 #define OPENTITAN_SW_DEVICE_LIB_CRYPTO_DRIVERS_IBEX_H_
6 
7 #include <stdbool.h>
8 #include <stddef.h>
9 #include <stdint.h>
10 
11 #include "sw/device/lib/crypto/impl/status.h"
12 
13 /**
14  * Wait for random data in the RND_DATA CSR to be valid.
15  *
16  * Returns OTCRYPTO_OK when the random data is valid.
17  *
18  * @return OTCRYPTO_OK.
19  */
20 status_t ibex_wait_rnd_valid(void);
21 
22 /**
23  * Get random data from the EDN0 interface.
24  *
25  * Returns 32 bits of randomness from EDN0.
26  *
27  * @param rnd_data The random data pointer.
28  * @return OTCRYPTO_OK.
29  */
30 status_t ibex_rnd_data_read(uint32_t *rnd_data);
31 
32 /**
33  * Get information on the state of the RND_DATA CSR.
34  *
35  * Returns the status of the randomness interface.
36  *
37  * @param rnd_status The status pointer.
38  * @return OTCRYPTO_OK.
39  */
40 status_t ibex_rnd_status_read(uint32_t *rnd_status);
41 
42 #endif // OPENTITAN_SW_DEVICE_LIB_CRYPTO_DRIVERS_IBEX_H_