TianoCore EDK2 master
Loading...
Searching...
No Matches
rand_pool.c File Reference
#include "crypto/rand.h"
#include <openssl/aes.h>
#include <Uefi.h>
#include <Library/RngLib.h>

Go to the source code of this file.

Functions

STATIC BOOLEAN EFIAPI RandGetBytes (IN UINTN Length, OUT UINT8 *RandBuffer)
 
size_t ossl_pool_acquire_entropy (RAND_POOL *pool)
 
int ossl_pool_add_nonce_data (RAND_POOL *pool)
 
int rand_pool_add_additional_data (RAND_POOL *pool)
 
int ossl_rand_pool_init (VOID)
 
VOID ossl_rand_pool_cleanup (VOID)
 
VOID ossl_rand_pool_keep_random_devices_open (int keep)
 

Detailed Description

OpenSSL_1_1_1b doesn't implement rand_pool_* functions for UEFI. The file implement these functions.

Copyright (c) 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file rand_pool.c.

Function Documentation

◆ ossl_pool_acquire_entropy()

size_t ossl_pool_acquire_entropy ( RAND_POOL *  pool)

Definition at line 77 of file rand_pool.c.

◆ ossl_pool_add_nonce_data()

int ossl_pool_add_nonce_data ( RAND_POOL *  pool)

Definition at line 108 of file rand_pool.c.

◆ ossl_rand_pool_cleanup()

VOID ossl_rand_pool_cleanup ( VOID  )

Definition at line 155 of file rand_pool.c.

◆ ossl_rand_pool_init()

int ossl_rand_pool_init ( VOID  )

Definition at line 142 of file rand_pool.c.

◆ ossl_rand_pool_keep_random_devices_open()

VOID ossl_rand_pool_keep_random_devices_open ( int  keep)

Definition at line 167 of file rand_pool.c.

◆ rand_pool_add_additional_data()

int rand_pool_add_additional_data ( RAND_POOL *  pool)

Definition at line 125 of file rand_pool.c.

◆ RandGetBytes()

STATIC BOOLEAN EFIAPI RandGetBytes ( IN UINTN  Length,
OUT UINT8 *  RandBuffer 
)

Calls RandomNumber64 to fill a buffer of arbitrary size with random bytes. This is a shim layer to RngLib.

Parameters
[in]LengthSize of the buffer, in bytes, to fill with.
[out]RandBufferPointer to the buffer to store the random result.
Return values
TRUERandom bytes generation succeeded.
FALSEFailed to request random bytes.

Definition at line 31 of file rand_pool.c.