SecurityPkg/RandomNumberGenerator/RngDxe/RdRand.h File Reference


Defines

#define RETRY_LIMIT   10

Functions

EFI_STATUS EFIAPI IsRdRandSupported (VOID)
BOOLEAN EFIAPI RdRand16Step (OUT UINT16 *Rand)
BOOLEAN EFIAPI RdRand32Step (OUT UINT32 *Rand)
BOOLEAN EFIAPI RdRand64Step (OUT UINT64 *Rand)
EFI_STATUS EFIAPI RdRand16 (OUT UINT16 *Rand, IN BOOLEAN NeedRetry)
EFI_STATUS EFIAPI RdRand32 (OUT UINT32 *Rand, IN BOOLEAN NeedRetry)
EFI_STATUS EFIAPI RdRand64 (OUT UINT64 *Rand, IN BOOLEAN NeedRetry)
EFI_STATUS EFIAPI RdRandWord (OUT UINTN *Rand, IN BOOLEAN NeedRetry)
EFI_STATUS EFIAPI RdRandGetWords (IN UINTN Length, OUT UINTN *RandBuffer)
EFI_STATUS EFIAPI RdRandGetBytes (IN UINTN Length, OUT UINT8 *RandBuffer)
EFI_STATUS EFIAPI RdRandGenerateEntropy (IN UINTN Length, OUT UINT8 *Entropy)

Detailed Description

Header for the RDRAND APIs used by RNG DXE driver.

Support API definitions for RDRAND instruction access, which will leverage Intel Secure Key technology to provide high-quality random numbers for use in applications, or entropy for seeding other random number generators. Refer to http://software.intel.com/en-us/articles/intel-digital-random-number -generator-drng-software-implementation-guide/ for more information about Intel Secure Key technology.

Copyright (c) 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.


Define Documentation

#define RETRY_LIMIT   10

Referenced by RdRand16(), RdRand32(), and RdRand64().


Function Documentation

EFI_STATUS EFIAPI IsRdRandSupported ( VOID   ) 

Determines whether or not RDRAND instruction is supported by the host hardware.

Return values:
EFI_SUCCESS RDRAND instruction supported.
EFI_UNSUPPORTED RDRAND instruction not supported.

References BOOLEAN(), EFI_STATUS(), RDRAND_MASK, and TRUE.

Referenced by RngDriverEntry().

EFI_STATUS EFIAPI RdRand16 ( OUT UINT16 *  Rand,
IN BOOLEAN  NeedRetry 
)

Calls RDRAND to obtain a 16-bit random number.

Parameters:
[out] Rand Buffer pointer to store the random result.
[in] NeedRetry Determine whether or not to loop retry.
Return values:
EFI_SUCCESS RDRAND call was successful.
EFI_NOT_READY Failed attempts to call RDRAND.

References RdRand16Step(), and RETRY_LIMIT.

BOOLEAN EFIAPI RdRand16Step ( OUT UINT16 *  Rand  ) 

Generates a 16-bit random number through RDRAND instruction.

Parameters:
[out] Rand Buffer pointer to store the random result.
Return values:
TRUE RDRAND call was successful.
FALSE Failed attempts to call RDRAND.

References BOOLEAN().

Referenced by RdRand16().

EFI_STATUS EFIAPI RdRand32 ( OUT UINT32 *  Rand,
IN BOOLEAN  NeedRetry 
)

Calls RDRAND to obtain a 32-bit random number.

Parameters:
[out] Rand Buffer pointer to store the random result.
[in] NeedRetry Determine whether or not to loop retry.
Return values:
EFI_SUCCESS RDRAND call was successful.
EFI_NOT_READY Failed attempts to call RDRAND.

References RdRand32Step(), and RETRY_LIMIT.

Referenced by RdRandGetWords(), and RdRandWord().

BOOLEAN EFIAPI RdRand32Step ( OUT UINT32 *  Rand  ) 

Generates a 32-bit random number through RDRAND instruction.

Parameters:
[out] Rand Buffer pointer to store the random result.
Return values:
TRUE RDRAND call was successful.
FALSE Failed attempts to call RDRAND.

References BOOLEAN().

Referenced by RdRand32(), and RdRand64Step().

EFI_STATUS EFIAPI RdRand64 ( OUT UINT64 *  Rand,
IN BOOLEAN  NeedRetry 
)

Calls RDRAND to obtain a 64-bit random number.

Parameters:
[out] Rand Buffer pointer to store the random result.
[in] NeedRetry Determine whether or not to loop retry.
Return values:
EFI_SUCCESS RDRAND call was successful.
EFI_NOT_READY Failed attempts to call RDRAND.

References RdRand64Step(), and RETRY_LIMIT.

Referenced by RdRandGetWords(), and RdRandWord().

BOOLEAN EFIAPI RdRand64Step ( OUT UINT64 *  Rand  ) 

Generates a 64-bit random number through RDRAND instruction.

Parameters:
[out] Rand Buffer pointer to store the random result.
Return values:
TRUE RDRAND call was successful.
FALSE Failed attempts to call RDRAND.

References BOOLEAN(), RdRand32Step(), and TRUE.

Referenced by RdRand64().

EFI_STATUS EFIAPI RdRandGenerateEntropy ( IN UINTN  Length,
OUT UINT8 *  Entropy 
)

Generate high-quality entropy source through RDRAND.

Parameters:
[in] Length Size of the buffer, in bytes, to fill with.
[out] Entropy Pointer to the buffer to store the entropy data.
Return values:
EFI_SUCCESS Entropy generation succeeded.
EFI_NOT_READY Failed to request random data.

References EFI_STATUS(), RdRandGetSeed128(), and UINTN().

Referenced by RngGetRNG().

EFI_STATUS EFIAPI RdRandGetBytes ( IN UINTN  Length,
OUT UINT8 *  RandBuffer 
)

Calls RDRAND to fill a buffer of arbitrary size with random bytes.

Parameters:
[in] Length Size of the buffer, in bytes, to fill with.
[out] RandBuffer Pointer to the buffer to store the random result.
Return values:
EFI_SUCCESS Random bytes generation succeeded.
EFI_NOT_READY Failed to request random bytes.

References EFI_STATUS(), RdRandGetWords(), RdRandWord(), TRUE, and UINTN().

Referenced by RdRandGetSeed128(), and RngGetRNG().

EFI_STATUS EFIAPI RdRandGetWords ( IN UINTN  Length,
OUT UINTN *  RandBuffer 
)

Calls RDRAND to request multiple word-length random numbers.

Parameters:
[in] Length Size of the buffer, in words, to fill with.
[out] RandBuffer Pointer to the buffer to store the random result.
Return values:
EFI_SUCCESS Random words generation succeeded.
EFI_NOT_READY Failed to request random words.

References EFI_STATUS(), RdRand32(), RdRand64(), and TRUE.

Referenced by RdRandGetBytes().

EFI_STATUS EFIAPI RdRandWord ( OUT UINTN *  Rand,
IN BOOLEAN  NeedRetry 
)

Calls RDRAND to request a word-length random number.

Parameters:
[out] Rand Buffer pointer to store the random number.
[in] NeedRetry Determine whether or not to loop retry.
Return values:
EFI_SUCCESS Random word generation succeeded.
EFI_NOT_READY Failed to request random word.

References RdRand32(), and RdRand64().

Referenced by RdRandGetBytes().


Generated on Thu Sep 24 23:44:24 2015 for SecurityPkg[ALL] by  doxygen 1.5.7.1