]> git.proxmox.com Git - mirror_edk2.git/blob - SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RdRand.h
SecurityPkg: Apply uncrustify changes
[mirror_edk2.git] / SecurityPkg / RandomNumberGenerator / RngDxe / Rand / RdRand.h
1 /** @file
2 Header for the RDRAND APIs used by RNG DXE driver.
3
4 Support API definitions for RDRAND instruction access, which will leverage
5 Intel Secure Key technology to provide high-quality random numbers for use
6 in applications, or entropy for seeding other random number generators.
7 Refer to http://software.intel.com/en-us/articles/intel-digital-random-number
8 -generator-drng-software-implementation-guide/ for more information about Intel
9 Secure Key technology.
10
11 Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
12 (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
13 SPDX-License-Identifier: BSD-2-Clause-Patent
14
15 **/
16
17 #ifndef __RD_RAND_H__
18 #define __RD_RAND_H__
19
20 #include <Library/BaseLib.h>
21 #include <Library/BaseMemoryLib.h>
22 #include <Library/UefiBootServicesTableLib.h>
23 #include <Library/TimerLib.h>
24 #include <Protocol/Rng.h>
25
26 /**
27 Generate high-quality entropy source through RDRAND.
28
29 @param[in] Length Size of the buffer, in bytes, to fill with.
30 @param[out] Entropy Pointer to the buffer to store the entropy data.
31
32 @retval EFI_SUCCESS Entropy generation succeeded.
33 @retval EFI_NOT_READY Failed to request random data.
34
35 **/
36 EFI_STATUS
37 EFIAPI
38 RdRandGenerateEntropy (
39 IN UINTN Length,
40 OUT UINT8 *Entropy
41 );
42
43 #endif // __RD_RAND_H__