]>
git.proxmox.com Git - mirror_edk2.git/blob - CryptoPkg/Library/OpensslLib/rand_pool_noise_tsc.c
2 Provide rand noise source.
4 Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #include <Library/BaseLib.h>
10 #include <Library/DebugLib.h>
11 #include <Library/TimerLib.h>
14 Get 64-bit noise source
16 @param[out] Rand Buffer pointer to store 64-bit noise source
18 @retval TRUE Get randomness successfully.
19 @retval FALSE Failed to generate
34 RandPtr
= (UINT32
*)Rand
;
36 for (Index
= 0; Index
< 2; Index
++) {
37 *RandPtr
= (UINT32
) ((AsmReadTsc ()) & 0xFF);
39 MicroSecondDelay (10);