// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2016 Linaro Ltd; <[email protected]> */ #include <linux/efi.h> #include <asm/efi.h> #include "efistub.h" efi_rng_protocol_t; efi_rng_protocol; /** * efi_get_random_bytes() - fill a buffer with random bytes * @size: size of the buffer * @out: caller allocated buffer to receive the random bytes * * The call will fail if either the firmware does not implement the * EFI_RNG_PROTOCOL or there are not enough random bytes available to fill * the buffer. * * Return: status code */ efi_status_t efi_get_random_bytes(unsigned long size, u8 *out) { … } /** * efi_random_get_seed() - provide random seed as configuration table * * The EFI_RNG_PROTOCOL is used to read random bytes. These random bytes are * saved as a configuration table which can be used as entropy by the kernel * for the initialization of its pseudo random number generator. * * If the EFI_RNG_PROTOCOL is not available or there are not enough random bytes * available, the configuration table will not be installed and an error code * will be returned. * * Return: status code */ efi_status_t efi_random_get_seed(void) { … }