]>
git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/X86RdRand.c
2 IA-32/x64 AsmRdRandxx()
3 Generates random number through CPU RdRand instruction.
5 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #include "BaseLibInternals.h"
13 Generates a 16-bit random number through RDRAND instruction.
15 if Rand is NULL, then ASSERT().
17 @param[out] Rand Buffer pointer to store the random result.
19 @retval TRUE RDRAND call was successful.
20 @retval FALSE Failed attempts to call RDRAND.
29 ASSERT (Rand
!= NULL
);
30 return InternalX86RdRand16 (Rand
);
34 Generates a 32-bit random number through RDRAND instruction.
36 if Rand is NULL, then ASSERT().
38 @param[out] Rand Buffer pointer to store the random result.
40 @retval TRUE RDRAND call was successful.
41 @retval FALSE Failed attempts to call RDRAND.
50 ASSERT (Rand
!= NULL
);
51 return InternalX86RdRand32 (Rand
);
55 Generates a 64-bit random number through RDRAND instruction.
57 if Rand is NULL, then ASSERT().
59 @param[out] Rand Buffer pointer to store the random result.
61 @retval TRUE RDRAND call was successful.
62 @retval FALSE Failed attempts to call RDRAND.
71 ASSERT (Rand
!= NULL
);
72 return InternalX86RdRand64 (Rand
);