aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
Diffstat (limited to 'os')
-rw-r--r--os/hal/include/hal_crypto.h2
-rw-r--r--os/hal/ports/STM32/LLD/CRYPv1/hal_crypto_lld.c5
-rw-r--r--os/hal/ports/STM32/LLD/CRYPv1/hal_crypto_lld.h2
-rw-r--r--os/hal/src/hal_crypto.c10
-rw-r--r--os/hal/templates/hal_crypto_lld.c6
-rw-r--r--os/hal/templates/hal_crypto_lld.h2
6 files changed, 16 insertions, 11 deletions
diff --git a/os/hal/include/hal_crypto.h b/os/hal/include/hal_crypto.h
index 2b0ad6b0e..78f164692 100644
--- a/os/hal/include/hal_crypto.h
+++ b/os/hal/include/hal_crypto.h
@@ -376,7 +376,7 @@ extern "C" {
cryerror_t cryHMACSHA512Final(CRYDriver *cryp,
HMACSHA512Context *hmacsha512ctxp,
uint8_t *out);
- cryerror_t cryTRNG(CRYDriver *cryp, uint8_t *out);
+ cryerror_t cryTRNG(CRYDriver *cryp, size_t size, uint8_t *out);
#ifdef __cplusplus
}
#endif
diff --git a/os/hal/ports/STM32/LLD/CRYPv1/hal_crypto_lld.c b/os/hal/ports/STM32/LLD/CRYPv1/hal_crypto_lld.c
index b32596814..edd2e09b0 100644
--- a/os/hal/ports/STM32/LLD/CRYPv1/hal_crypto_lld.c
+++ b/os/hal/ports/STM32/LLD/CRYPv1/hal_crypto_lld.c
@@ -1314,7 +1314,8 @@ cryerror_t cry_lld_HMACSHA512_final(CRYDriver *cryp,
* @brief True random numbers generator.
*
* @param[in] cryp pointer to the @p CRYDriver object
- * @param[out] out 128 bits output buffer
+ * @param[in] size size of output buffer
+ * @param[out] out output buffer
* @return The operation status.
* @retval CRY_NOERROR if the operation succeeded.
* @retval CRY_ERR_INV_ALGO if the operation is unsupported on this
@@ -1324,7 +1325,7 @@ cryerror_t cry_lld_HMACSHA512_final(CRYDriver *cryp,
*
* @notapi
*/
-cryerror_t cry_lld_TRNG(CRYDriver *cryp, uint8_t *out) {
+cryerror_t cry_lld_TRNG(CRYDriver *cryp, size_t size, uint8_t *out) {
(void)cryp;
(void)out;
diff --git a/os/hal/ports/STM32/LLD/CRYPv1/hal_crypto_lld.h b/os/hal/ports/STM32/LLD/CRYPv1/hal_crypto_lld.h
index 641e3913a..74566ba37 100644
--- a/os/hal/ports/STM32/LLD/CRYPv1/hal_crypto_lld.h
+++ b/os/hal/ports/STM32/LLD/CRYPv1/hal_crypto_lld.h
@@ -357,7 +357,7 @@ extern "C" {
uint8_t *out);
#endif
#if (CRY_LLD_SUPPORTS_TRNG == TRUE) || defined(__DOXYGEN__)
- cryerror_t cry_lld_TRNG(CRYDriver *cryp, uint8_t *out);
+ cryerror_t cry_lld_TRNG(CRYDriver *cryp, size_t size, uint8_t *out);
#endif
#ifdef __cplusplus
}
diff --git a/os/hal/src/hal_crypto.c b/os/hal/src/hal_crypto.c
index f49987878..7d9461d38 100644
--- a/os/hal/src/hal_crypto.c
+++ b/os/hal/src/hal_crypto.c
@@ -1700,7 +1700,8 @@ cryerror_t cryHMACSHA512Final(CRYDriver *cryp,
* @brief True random numbers generator.
*
* @param[in] cryp pointer to the @p CRYDriver object
- * @param[out] out 128 bits output buffer
+ * @param[in] size size of output buffer
+ * @param[out] out output buffer
* @return The operation status.
* @retval CRY_NOERROR if the operation succeeded.
* @retval CRY_ERR_INV_ALGO if the operation is unsupported on this
@@ -1710,18 +1711,19 @@ cryerror_t cryHMACSHA512Final(CRYDriver *cryp,
*
* @api
*/
-cryerror_t cryTRNG(CRYDriver *cryp, uint8_t *out) {
+cryerror_t cryTRNG(CRYDriver *cryp, size_t size, uint8_t *out) {
osalDbgCheck((cryp != NULL) && (out != NULL));
osalDbgAssert(cryp->state == CRY_READY, "not ready");
#if CRY_LLD_SUPPORTS_TRNG == TRUE
- return cry_lld_TRNG(cryp, out);
+ return cry_lld_TRNG(cryp, size, out);
#elif HAL_CRY_USE_FALLBACK == TRUE
- return cry_fallback_TRNG(cryp, out);
+ return cry_fallback_TRNG(cryp, size, out);
#else
(void)cryp;
+ (void)size;
(void)out;
return CRY_ERR_INV_ALGO;
diff --git a/os/hal/templates/hal_crypto_lld.c b/os/hal/templates/hal_crypto_lld.c
index 5b08cacd1..0d1656787 100644
--- a/os/hal/templates/hal_crypto_lld.c
+++ b/os/hal/templates/hal_crypto_lld.c
@@ -1314,7 +1314,8 @@ cryerror_t cry_lld_HMACSHA512_final(CRYDriver *cryp,
* @brief True random numbers generator.
*
* @param[in] cryp pointer to the @p CRYDriver object
- * @param[out] out 128 bits output buffer
+ * @param[in] size size of output buffer
+ * @param[out] out output buffer
* @return The operation status.
* @retval CRY_NOERROR if the operation succeeded.
* @retval CRY_ERR_INV_ALGO if the operation is unsupported on this
@@ -1324,9 +1325,10 @@ cryerror_t cry_lld_HMACSHA512_final(CRYDriver *cryp,
*
* @notapi
*/
-cryerror_t cry_lld_TRNG(CRYDriver *cryp, uint8_t *out) {
+cryerror_t cry_lld_TRNG(CRYDriver *cryp, size_t size, uint8_t *out) {
(void)cryp;
+ (void)size;
(void)out;
return CRY_ERR_INV_ALGO;
diff --git a/os/hal/templates/hal_crypto_lld.h b/os/hal/templates/hal_crypto_lld.h
index d3def1e53..23f592ec3 100644
--- a/os/hal/templates/hal_crypto_lld.h
+++ b/os/hal/templates/hal_crypto_lld.h
@@ -357,7 +357,7 @@ extern "C" {
uint8_t *out);
#endif
#if (CRY_LLD_SUPPORTS_TRNG == TRUE) || defined(__DOXYGEN__)
- cryerror_t cry_lld_TRNG(CRYDriver *cryp, uint8_t *out);
+ cryerror_t cry_lld_TRNG(CRYDriver *cryp, size_t size, uint8_t *out);
#endif
#ifdef __cplusplus
}