XenevaOS
Loading...
Searching...
No Matches
BlockIoCrypto.h
Go to the documentation of this file.
1
19#ifndef __BLOCK_IO_CRYPTO_H__
20#define __BLOCK_IO_CRYPTO_H__
21
22#include <Protocol/BlockIo.h>
23
24#define EFI_BLOCK_IO_CRYPTO_PROTOCOL_GUID \
25 { \
26 0xa00490ba, 0x3f1a, 0x4b4c, {0xab, 0x90, 0x4f, 0xa9, 0x97, 0x26, 0xa1, 0xe8} \
27 }
28
30
34typedef struct {
35 //
36 // If Event is NULL, then blocking I/O is performed. If Event is not NULL and
37 // non-blocking I/O is supported, then non-blocking I/O is performed, and
38 // Event will be signaled when the read request is completed and data was
39 // decrypted (when Index was specified).
40 //
42 //
43 // Defines whether or not the signaled event encountered an error.
44 //
47
48typedef struct {
49 //
50 // GUID of the algorithm.
51 //
53 //
54 // Specifies KeySizein bits used with this Algorithm.
55 //
57 //
58 // Specifies bitmask of block sizes supported by this algorithm.
59 // Bit j being set means that 2^j bytes crypto block size is supported.
60 //
63
74
75#define EFI_BLOCK_IO_CRYPTO_ALGO_GUID_AES_XTS \
76 { \
77 0x2f87ba6a, 0x5c04, 0x4385, {0xa7, 0x80, 0xf3, 0xbf, 0x78, 0xa9, 0x7b, 0xec} \
78 }
79
81
87
88#define EFI_BLOCK_IO_CRYPTO_ALGO_GUID_AES_CBC_MICROSOFT_BITLOCKER \
89 { \
90 0x689e4c62, 0x70bf, 0x4cf3, {0x88, 0xbb, 0x33, 0xb3, 0x18, 0x26, 0x86, 0x70} \
91 }
92
94
100
101#define EFI_BLOCK_IO_CRYPTO_INDEX_ANY 0xFFFFFFFFFFFFFFFF
102
103typedef struct {
104 //
105 // Is inline cryptographic capability supported on this device.
106 //
108 //
109 // Maximum number of keys that can be configured at the same time.
110 //
112 //
113 // Number of supported capabilities.
114 //
116 //
117 // Array of supported capabilities.
118 //
121
122typedef struct {
123 //
124 // Configuration table index. A special Index EFI_BLOCK_IO_CRYPTO_INDEX_ANY can be
125 // used to set any available entry in the configuration table.
126 //
128 //
129 // Identifies the owner of the configuration table entry. Entry can also be used
130 // with the Nil value to clear key from the configuration table index.
131 //
133 //
134 // A supported capability to be used. The CryptoBlockSizeBitMask field of the
135 // structure should have only one bit set from the supported mask.
136 //
138 //
139 // Pointer to the key. The size of the key is defined by the KeySize field of
140 // the capability specified by the Capability parameter.
141 //
144
145typedef struct {
146 //
147 // Configuration table index.
148 //
150 //
151 // Identifies the current owner of the entry.
152 //
154 //
155 // The capability to be used. The CryptoBlockSizeBitMask field of the structure
156 // has only one bit set from the supported mask.
157 //
160
186typedef
190 IN BOOLEAN ExtendedVerification
191 );
192
219typedef
224 );
225
288typedef
292 IN UINT64 ConfigurationCount,
295 );
296
329typedef
333 IN UINT64 StartIndex,
334 IN UINT64 ConfigurationCount,
335 IN EFI_GUID *KeyOwnerGuid OPTIONAL,
337);
338
394typedef
398 IN UINT32 MediaId,
399 IN EFI_LBA LBA,
401 IN UINT64 BufferSize,
402 OUT VOID *Buffer,
403 IN UINT64 *Index OPTIONAL,
404 IN VOID *CryptoIvInput OPTIONAL
405 );
406
460typedef
464 IN UINT32 MediaId,
465 IN EFI_LBA LBA,
467 IN UINT64 BufferSize,
468 IN VOID *Buffer,
469 IN UINT64 *Index OPTIONAL,
470 IN VOID *CryptoIvInput OPTIONAL
471 );
472
505typedef
510 );
511
526
528
529#endif
530
#define EFIAPI
Definition ProcessorBind.h:172
unsigned int UINT32
Definition ProcessorBind.h:102
#define IN
Definition Base.h:347
#define OUT
Definition Base.h:352
#define OPTIONAL
Definition Base.h:358
EFI_GUID gEfiBlockIoCryptoAlgoAesCbcMsBitlockerGuid
EFI_STATUS(EFIAPI * EFI_BLOCK_IO_CRYPTO_WRITE_EXTENDED)(IN EFI_BLOCK_IO_CRYPTO_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA LBA, IN OUT EFI_BLOCK_IO_CRYPTO_TOKEN *Token, IN UINT64 BufferSize, IN VOID *Buffer, IN UINT64 *Index OPTIONAL, IN VOID *CryptoIvInput OPTIONAL)
Definition BlockIoCrypto.h:462
EFI_STATUS(EFIAPI * EFI_BLOCK_IO_CRYPTO_GET_CAPABILITIES)(IN EFI_BLOCK_IO_CRYPTO_PROTOCOL *This, OUT EFI_BLOCK_IO_CRYPTO_CAPABILITIES *Capabilities)
Definition BlockIoCrypto.h:221
EFI_GUID gEfiBlockIoCryptoProtocolGuid
EFI_STATUS(EFIAPI * EFI_BLOCK_IO_CRYPTO_RESET)(IN EFI_BLOCK_IO_CRYPTO_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
Definition BlockIoCrypto.h:188
EFI_STATUS(EFIAPI * EFI_BLOCK_IO_CRYPTO_READ_EXTENDED)(IN EFI_BLOCK_IO_CRYPTO_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA LBA, IN OUT EFI_BLOCK_IO_CRYPTO_TOKEN *Token, IN UINT64 BufferSize, OUT VOID *Buffer, IN UINT64 *Index OPTIONAL, IN VOID *CryptoIvInput OPTIONAL)
Definition BlockIoCrypto.h:396
EFI_STATUS(EFIAPI * EFI_BLOCK_IO_CRYPTO_SET_CONFIGURATION)(IN EFI_BLOCK_IO_CRYPTO_PROTOCOL *This, IN UINT64 ConfigurationCount, IN EFI_BLOCK_IO_CRYPTO_CONFIGURATION_TABLE_ENTRY *ConfigurationTable, OUT EFI_BLOCK_IO_CRYPTO_RESPONSE_CONFIGURATION_ENTRY *ResultingTable OPTIONAL)
Definition BlockIoCrypto.h:290
EFI_GUID gEfiBlockIoCryptoAlgoAesXtsGuid
EFI_STATUS(EFIAPI * EFI_BLOCK_IO_CRYPTO_GET_CONFIGURATION)(IN EFI_BLOCK_IO_CRYPTO_PROTOCOL *This, IN UINT64 StartIndex, IN UINT64 ConfigurationCount, IN EFI_GUID *KeyOwnerGuid OPTIONAL, OUT EFI_BLOCK_IO_CRYPTO_RESPONSE_CONFIGURATION_ENTRY *ConfigurationTable)
Definition BlockIoCrypto.h:331
EFI_STATUS(EFIAPI * EFI_BLOCK_IO_CRYPTO_FLUSH)(IN EFI_BLOCK_IO_CRYPTO_PROTOCOL *This, IN OUT EFI_BLOCK_IO_CRYPTO_TOKEN *Token)
Definition BlockIoCrypto.h:507
UINT64 EFI_LBA
Definition UefiBaseType.h:49
RETURN_STATUS EFI_STATUS
Definition UefiBaseType.h:33
VOID * EFI_EVENT
Definition UefiBaseType.h:41
#define VOID
Definition acefi.h:190
unsigned char BOOLEAN
Definition actypes.h:235
COMPILER_DEPENDENT_UINT64 UINT64
Definition actypes.h:239
Definition BlockIoCrypto.h:103
UINT64 KeyCount
Definition BlockIoCrypto.h:111
BOOLEAN Supported
Definition BlockIoCrypto.h:107
UINT64 CapabilityCount
Definition BlockIoCrypto.h:115
Definition BlockIoCrypto.h:48
UINT64 KeySize
Definition BlockIoCrypto.h:56
UINT64 CryptoBlockSizeBitMask
Definition BlockIoCrypto.h:61
EFI_GUID Algorithm
Definition BlockIoCrypto.h:52
Definition BlockIoCrypto.h:122
UINT64 Index
Definition BlockIoCrypto.h:127
VOID * CryptoKey
Definition BlockIoCrypto.h:142
EFI_GUID KeyOwnerGuid
Definition BlockIoCrypto.h:132
EFI_BLOCK_IO_CRYPTO_CAPABILITY Capability
Definition BlockIoCrypto.h:137
UINT64 CryptoBlockByteOffset
Definition BlockIoCrypto.h:97
EFI_BLOCK_IO_CRYPTO_IV_INPUT Header
Definition BlockIoCrypto.h:96
UINT64 CryptoBlockByteSize
Definition BlockIoCrypto.h:98
Definition BlockIoCrypto.h:82
UINT64 CryptoBlockNumber
Definition BlockIoCrypto.h:84
EFI_BLOCK_IO_CRYPTO_IV_INPUT Header
Definition BlockIoCrypto.h:83
UINT64 CryptoBlockByteSize
Definition BlockIoCrypto.h:85
Definition BlockIoCrypto.h:71
UINT64 InputSize
Definition BlockIoCrypto.h:72
Definition BlockIoCrypto.h:145
EFI_GUID KeyOwnerGuid
Definition BlockIoCrypto.h:153
EFI_BLOCK_IO_CRYPTO_CAPABILITY Capability
Definition BlockIoCrypto.h:158
UINT64 Index
Definition BlockIoCrypto.h:149
Definition BlockIoCrypto.h:34
EFI_STATUS TransactionStatus
Definition BlockIoCrypto.h:45
EFI_EVENT Event
Definition BlockIoCrypto.h:41
Definition BlockIo.h:134
Definition Base.h:281
Definition BlockIoCrypto.h:516
EFI_BLOCK_IO_CRYPTO_FLUSH FlushBlocks
Definition BlockIoCrypto.h:524
EFI_BLOCK_IO_CRYPTO_GET_CONFIGURATION GetConfiguration
Definition BlockIoCrypto.h:521
EFI_BLOCK_IO_CRYPTO_RESET Reset
Definition BlockIoCrypto.h:518
EFI_BLOCK_IO_CRYPTO_READ_EXTENDED ReadExtended
Definition BlockIoCrypto.h:522
EFI_BLOCK_IO_CRYPTO_GET_CAPABILITIES GetCapabilities
Definition BlockIoCrypto.h:519
EFI_BLOCK_IO_CRYPTO_SET_CONFIGURATION SetConfiguration
Definition BlockIoCrypto.h:520
EFI_BLOCK_IO_CRYPTO_WRITE_EXTENDED WriteExtended
Definition BlockIoCrypto.h:523
EFI_BLOCK_IO_MEDIA * Media
Definition BlockIoCrypto.h:517