xref: /freebsd/stand/efi/include/efirng.h (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause
3  *
4  * Copyright 2006 - 2016 Unified EFI, Inc.<BR>
5  * Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved.<BR>
6  * This program and the accompanying materials
7  * are licensed and made available under the terms and conditions of the BSD License
8  * which accompanies this distribution.  The full text of the license may be found at
9  * http://opensource.org/licenses/bsd-license.php
10  *
11  * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13  *
14  */
15 
16 #ifndef _EFIRNG_H
17 #define _EFIRNG_H
18 
19 #define EFI_RNG_PROTOCOL_GUID \
20     { 0x3152bca5, 0xeade, 0x433d, {0x86, 0x2e, 0xc0, 0x1c, 0xdc, 0x29, 0x1f, 0x44} }
21 
22 INTERFACE_DECL(_EFI_RNG_PROTOCOL);
23 
24 typedef EFI_GUID EFI_RNG_ALGORITHM;
25 
26 typedef
27 EFI_STATUS
28 (EFIAPI *EFI_RNG_GET_INFO) (
29     IN struct _EFI_RNG_PROTOCOL		*This,
30     IN  OUT UINTN			*RNGAlgorithmListSize,
31     OUT EFI_RNG_ALGORITHM		*RNGAlgorithmList
32     );
33 
34 typedef
35 EFI_STATUS
36 (EFIAPI *EFI_RNG_GET_RNG) (
37     IN struct _EFI_RNG_PROTOCOL		*This,
38     IN EFI_RNG_ALGORITHM		*RNGAlgorithm, OPTIONAL
39     IN UINTN				RNGValueLength,
40     OUT UINT8				*RNGValue
41     );
42 
43 typedef struct _EFI_RNG_PROTOCOL {
44 	EFI_RNG_GET_INFO	GetInfo;
45 	EFI_RNG_GET_RNG		GetRNG;
46 } EFI_RNG_PROTOCOL;
47 
48 static EFI_GUID			rng_guid = EFI_RNG_PROTOCOL_GUID;
49 
50 #endif /* _EFIRNG_H */
51