1 /**
2  *  Copyright Notice:
3  *  Copyright 2021-2022 DMTF. All rights reserved.
4  *  License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/libspdm/blob/main/LICENSE.md
5  **/
6 
7 #ifndef CRYPTLIB_RNG_H
8 #define CRYPTLIB_RNG_H
9 
10 /*=====================================================================================
11  *    Random Number Generation Primitive
12  *=====================================================================================*/
13 
14 /**
15  * Generates a random byte stream of the specified size. If initialization, testing, or seeding of
16  * the (pseudo)random number generator is required it should be done before this function is called.
17  *
18  * If output is NULL, then return false.
19  * If this interface is not supported, then return false.
20  *
21  * @param[out]  output  Pointer to buffer to receive random value.
22  * @param[in]   size    Size of random bytes to generate.
23  *
24  * @retval true   Random byte stream generated successfully.
25  * @retval false  Generation of random byte stream failed.
26  * @retval false  This interface is not supported.
27  **/
28 extern bool libspdm_random_bytes(uint8_t *output, size_t size);
29 
30 #endif /* CRYPTLIB_RNG_H */
31