Replaced entropy driver context with void * to support multiple entropy drivers
diff --git a/include/psa/crypto_entropy_driver.h b/include/psa/crypto_entropy_driver.h
index f5e383e..79b7f7f 100644
--- a/include/psa/crypto_entropy_driver.h
+++ b/include/psa/crypto_entropy_driver.h
@@ -40,10 +40,6 @@
*/
/**@{*/
-/** \brief A hardware-specific structure for a entropy providing hardware
- */
-typedef struct psa_drv_entropy_context_s psa_drv_entropy_context_t;
-
/** \brief Initialize an entropy driver
*
*
@@ -53,7 +49,7 @@
*
* \retval PSA_SUCCESS
*/
-typedef psa_status_t (*psa_drv_entropy_init_t)(psa_drv_entropy_context_t *p_context);
+typedef psa_status_t (*psa_drv_entropy_init_t)(void *p_context);
/** \brief Get a specified number of bits from the entropy source
*
@@ -81,7 +77,7 @@
*
* \retval PSA_SUCCESS
*/
-typedef psa_status_t (*psa_drv_entropy_get_bits_t)(psa_drv_entropy_context_t *p_context,
+typedef psa_status_t (*psa_drv_entropy_get_bits_t)(void *p_context,
uint8_t *p_buffer,
uint32_t buffer_size,
uint32_t *p_received_entropy_bits);
@@ -96,6 +92,8 @@
* If one of the functions is not implemented, it should be set to NULL.
*/
typedef struct {
+ /** The driver-specific size of the entropy context */
+ const size_t context_size;
/** Function that performs initialization for the entropy source */
psa_drv_entropy_init_t *p_init;
/** Function that performs the get_bits operation for the entropy source