TianoCore EDK2 master
Loading...
Searching...
No Matches
BlockIoCrypto.h
Go to the documentation of this file.
1
13#ifndef __BLOCK_IO_CRYPTO_H__
14#define __BLOCK_IO_CRYPTO_H__
15
16#include <Protocol/BlockIo.h>
17
18#define EFI_BLOCK_IO_CRYPTO_PROTOCOL_GUID \
19 { \
20 0xa00490ba, 0x3f1a, 0x4b4c, {0xab, 0x90, 0x4f, 0xa9, 0x97, 0x26, 0xa1, 0xe8} \
21 }
22
24
28typedef struct {
29 //
30 // If Event is NULL, then blocking I/O is performed. If Event is not NULL and
31 // non-blocking I/O is supported, then non-blocking I/O is performed, and
32 // Event will be signaled when the read request is completed and data was
33 // decrypted (when Index was specified).
34 //
35 EFI_EVENT Event;
36 //
37 // Defines whether or not the signaled event encountered an error.
38 //
39 EFI_STATUS TransactionStatus;
41
42typedef struct {
43 //
44 // GUID of the algorithm.
45 //
46 EFI_GUID Algorithm;
47 //
48 // Specifies KeySizein bits used with this Algorithm.
49 //
50 UINT64 KeySize;
51 //
52 // Specifies bitmask of block sizes supported by this algorithm.
53 // Bit j being set means that 2^j bytes crypto block size is supported.
54 //
55 UINT64 CryptoBlockSizeBitMask;
57
65typedef struct {
66 UINT64 InputSize;
68
69#define EFI_BLOCK_IO_CRYPTO_ALGO_GUID_AES_XTS \
70 { \
71 0x2f87ba6a, 0x5c04, 0x4385, {0xa7, 0x80, 0xf3, 0xbf, 0x78, 0xa9, 0x7b, 0xec} \
72 }
73
74extern EFI_GUID gEfiBlockIoCryptoAlgoAesXtsGuid;
75
76typedef struct {
78 UINT64 CryptoBlockNumber;
79 UINT64 CryptoBlockByteSize;
81
82#define EFI_BLOCK_IO_CRYPTO_ALGO_GUID_AES_CBC_MICROSOFT_BITLOCKER \
83 { \
84 0x689e4c62, 0x70bf, 0x4cf3, {0x88, 0xbb, 0x33, 0xb3, 0x18, 0x26, 0x86, 0x70} \
85 }
86
87extern EFI_GUID gEfiBlockIoCryptoAlgoAesCbcMsBitlockerGuid;
88
89typedef struct {
91 UINT64 CryptoBlockByteOffset;
92 UINT64 CryptoBlockByteSize;
94
95#define EFI_BLOCK_IO_CRYPTO_INDEX_ANY 0xFFFFFFFFFFFFFFFF
96
97typedef struct {
98 //
99 // Is inline cryptographic capability supported on this device.
100 //
101 BOOLEAN Supported;
102 //
103 // Maximum number of keys that can be configured at the same time.
104 //
105 UINT64 KeyCount;
106 //
107 // Number of supported capabilities.
108 //
109 UINT64 CapabilityCount;
110 //
111 // Array of supported capabilities.
112 //
113 EFI_BLOCK_IO_CRYPTO_CAPABILITY Capabilities[1];
115
116typedef struct {
117 //
118 // Configuration table index. A special Index EFI_BLOCK_IO_CRYPTO_INDEX_ANY can be
119 // used to set any available entry in the configuration table.
120 //
121 UINT64 Index;
122 //
123 // Identifies the owner of the configuration table entry. Entry can also be used
124 // with the Nil value to clear key from the configuration table index.
125 //
126 EFI_GUID KeyOwnerGuid;
127 //
128 // A supported capability to be used. The CryptoBlockSizeBitMask field of the
129 // structure should have only one bit set from the supported mask.
130 //
132 //
133 // Pointer to the key. The size of the key is defined by the KeySize field of
134 // the capability specified by the Capability parameter.
135 //
136 VOID *CryptoKey;
138
139typedef struct {
140 //
141 // Configuration table index.
142 //
143 UINT64 Index;
144 //
145 // Identifies the current owner of the entry.
146 //
147 EFI_GUID KeyOwnerGuid;
148 //
149 // The capability to be used. The CryptoBlockSizeBitMask field of the structure
150 // has only one bit set from the supported mask.
151 //
154
180typedef
184 IN BOOLEAN ExtendedVerification
185 );
186
213typedef
218 );
219
282typedef
286 IN UINT64 ConfigurationCount,
289 );
290
323typedef
327 IN UINT64 StartIndex,
328 IN UINT64 ConfigurationCount,
329 IN EFI_GUID *KeyOwnerGuid OPTIONAL,
331 );
332
388typedef
392 IN UINT32 MediaId,
393 IN EFI_LBA LBA,
395 IN UINT64 BufferSize,
396 OUT VOID *Buffer,
397 IN UINT64 *Index OPTIONAL,
398 IN VOID *CryptoIvInput OPTIONAL
399 );
400
454typedef
458 IN UINT32 MediaId,
459 IN EFI_LBA LBA,
461 IN UINT64 BufferSize,
462 IN VOID *Buffer,
463 IN UINT64 *Index OPTIONAL,
464 IN VOID *CryptoIvInput OPTIONAL
465 );
466
499typedef
504 );
505
511 EFI_BLOCK_IO_MEDIA *Media;
518 EFI_BLOCK_IO_CRYPTO_FLUSH FlushBlocks;
519};
520
521extern EFI_GUID gEfiBlockIoCryptoProtocolGuid;
522
523#endif
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)
EFI_STATUS(EFIAPI * EFI_BLOCK_IO_CRYPTO_GET_CAPABILITIES)(IN EFI_BLOCK_IO_CRYPTO_PROTOCOL *This, OUT EFI_BLOCK_IO_CRYPTO_CAPABILITIES *Capabilities)
EFI_STATUS(EFIAPI * EFI_BLOCK_IO_CRYPTO_RESET)(IN EFI_BLOCK_IO_CRYPTO_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
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)
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)
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)
EFI_STATUS(EFIAPI * EFI_BLOCK_IO_CRYPTO_FLUSH)(IN EFI_BLOCK_IO_CRYPTO_PROTOCOL *This, IN OUT EFI_BLOCK_IO_CRYPTO_TOKEN *Token)
#define OPTIONAL
Definition: Base.h:290
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
UINT64 EFI_LBA
Definition: UefiBaseType.h:45
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_EVENT
Definition: UefiBaseType.h:37
Definition: Base.h:213