uefi_specs/hyperv/
crypto.rs1use self::packed_nums::*;
7use crate::hyperv::common::EfiStatus64NoErrorBit;
8use open_enum::open_enum;
9use zerocopy::FromBytes;
10use zerocopy::Immutable;
11use zerocopy::IntoBytes;
12use zerocopy::KnownLayout;
13
14#[allow(non_camel_case_types)]
15mod packed_nums {
16 pub type u64_ne = zerocopy::U64<zerocopy::NativeEndian>;
17}
18
19open_enum! {
20 #[derive(IntoBytes, FromBytes, Immutable, KnownLayout)]
27 pub enum CryptoCommand: u32 {
28 COMPUTE_HASH = 0,
29 VERIFY_RSA_PKCS_1 = 1,
30 VERIFY_PKCS_7 = 2,
31 VERIFY_AUTHENTICODE = 3,
32 LOG_EVENT_DEPRECATED = 4,
33 GET_RANDOM_NUMBER = 5,
34 }
35}
36
37#[repr(C)]
39#[derive(Debug, Clone, Copy, IntoBytes, FromBytes, Immutable, KnownLayout)]
40pub struct CryptoCommandDescriptor {
41 pub command: CryptoCommand,
42 pub status: EfiStatus64NoErrorBit,
43}
44
45#[repr(C)]
47#[derive(Debug, IntoBytes, FromBytes, Immutable, KnownLayout)]
48pub struct CryptoGetRandomNumberParams {
49 pub buffer_address: u64_ne,
50 pub buffer_size: u32,
51}