File: cryptlib_rng.h

package info (click to toggle)
nvidia-open-gpu-kernel-modules 555.58.02-2
  • links: PTS, VCS
  • area: contrib
  • in suites: experimental
  • size: 89,204 kB
  • sloc: ansic: 1,149,014; cpp: 23,369; sh: 3,639; makefile: 607; python: 315
file content (30 lines) | stat: -rw-r--r-- 1,168 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/**
 *  Copyright Notice:
 *  Copyright 2021-2022 DMTF. All rights reserved.
 *  License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/libspdm/blob/main/LICENSE.md
 **/

#ifndef CRYPTLIB_RNG_H
#define CRYPTLIB_RNG_H

/*=====================================================================================
 *    Random Number Generation Primitive
 *=====================================================================================*/

/**
 * Generates a random byte stream of the specified size. If initialization, testing, or seeding of
 * the (pseudo)random number generator is required it should be done before this function is called.
 *
 * If output is NULL, then return false.
 * If this interface is not supported, then return false.
 *
 * @param[out]  output  Pointer to buffer to receive random value.
 * @param[in]   size    Size of random bytes to generate.
 *
 * @retval true   Random byte stream generated successfully.
 * @retval false  Generation of random byte stream failed.
 * @retval false  This interface is not supported.
 **/
extern bool libspdm_random_bytes(uint8_t *output, size_t size);

#endif /* CRYPTLIB_RNG_H */