efi_rng.h 796 B

12345678910111213141516171819202122232425262728
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (c) 2019, Linaro Limited
  4. */
  5. #if !defined _EFI_RNG_H_
  6. #define _EFI_RNG_H_
  7. #include <efi.h>
  8. #include <efi_api.h>
  9. /* EFI random number generation protocol related GUID definitions */
  10. #define EFI_RNG_ALGORITHM_RAW \
  11. EFI_GUID(0xe43176d7, 0xb6e8, 0x4827, 0xb7, 0x84, \
  12. 0x7f, 0xfd, 0xc4, 0xb6, 0x85, 0x61)
  13. struct efi_rng_protocol {
  14. efi_status_t (EFIAPI *get_info)(struct efi_rng_protocol *protocol,
  15. efi_uintn_t *rng_algorithm_list_size,
  16. efi_guid_t *rng_algorithm_list);
  17. efi_status_t (EFIAPI *get_rng)(struct efi_rng_protocol *protocol,
  18. efi_guid_t *rng_algorithm,
  19. efi_uintn_t rng_value_length, uint8_t *rng_value);
  20. };
  21. efi_status_t platform_get_rng_device(struct udevice **dev);
  22. #endif /* _EFI_RNG_H_ */