1use crate::{guid, Guid, Status};
4
5newtype_enum! {
6 pub enum RngAlgorithmType: Guid => {
9 EMPTY_ALGORITHM = guid!("00000000-0000-0000-0000-000000000000"),
12
13 ALGORITHM_RAW = guid!("e43176d7-b6e8-4827-b784-7ffdc4b68561"),
17
18 ALGORITHM_SP800_90_HASH_256 = guid!("a7af67cb-603b-4d42-ba21-70bfb6293f96"),
20
21 ALGORITHM_SP800_90_HMAC_256 = guid!("c5149b43-ae85-4f53-9982-b94335d3a9e7"),
23
24 ALGORITHM_SP800_90_CTR_256 = guid!("44f0de6e-4d8c-4045-a8c7-4dd168856b9e"),
26
27 ALGORITHM_X9_31_3DES = guid!("63c4785a-ca34-4012-a3c8-0b6a324f5546"),
29
30 ALGORITHM_X9_31_AES = guid!("acd03321-777e-4d3d-b1c8-20cfd88820c9"),
32 }
33}
34
35#[derive(Debug)]
37#[repr(C)]
38pub struct RngProtocol {
39 pub get_info: unsafe extern "efiapi" fn(
40 this: *mut RngProtocol,
41 algorithm_list_size: *mut usize,
42 algorithm_list: *mut RngAlgorithmType,
43 ) -> Status,
44
45 pub get_rng: unsafe extern "efiapi" fn(
46 this: *mut RngProtocol,
47 algorithm: *const RngAlgorithmType,
48 value_length: usize,
49 value: *mut u8,
50 ) -> Status,
51}
52
53impl RngProtocol {
54 pub const GUID: Guid = guid!("3152bca5-eade-433d-862e-c01cdc291f44");
55}