CryptoPkg: Add rand function for BaseCryptLibMbedTls
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4177 Add rand function for BaseCryptLibMbedTls. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Yi Li <yi1.li@intel.com> Signed-off-by: Wenxing Hou <wenxing.hou@intel.com> Reviewed-by: Yi Li <yi1.li@intel.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
This commit is contained in:
@@ -22,4 +22,20 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
//
|
||||
#include <mbedtls/mbedtls_config.h>
|
||||
|
||||
/**
|
||||
The MbedTLS function f_rng, which MbedtlsRand implements.
|
||||
|
||||
@param[in] RngState Not used, just for compatibility with mbedlts.
|
||||
@param[out] Output Pointer to buffer to receive random value.
|
||||
@param[in] Len Size of random bytes to generate.
|
||||
|
||||
@retval 0 Pseudorandom byte stream generated successfully.
|
||||
@retval Non-0 Pseudorandom number generator fails to generate due to lack of entropy.
|
||||
**/
|
||||
INT32
|
||||
MbedtlsRand (
|
||||
VOID *RngState,
|
||||
UINT8 *Output,
|
||||
UINTN Len
|
||||
);
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user