Lines Matching +full:0 +full:- +full:127
1 /*===----------------- keylockerintrin.h - KL Intrinsics -------------------===
21 *===-----------------------------------------------------------------------===
40 /// the key is permitted. The 256-bit encryption key is loaded from the two
41 /// explicit operands (__enkey_lo and __enkey_hi). The 128-bit integrity key is
49 /// IF CPL > 0 // LOADKWKEY only allowed at ring 0 (supervisor mode)
50 /// GP (0)
56 /// GP (0)
58 /// IF __ctl[31:5] != 0 // Reserved bit in __ctl is set
59 /// GP (0)
61 /// IF __ctl[0] AND (CPUID.19H.ECX[0] == 0) // NoBackup is not supported on this part
62 /// GP (0)
64 /// IF (__ctl[4:1] == 1) AND (CPUID.19H.ECX[1] == 0) // KeySource of 1 is not supported on this part
65 /// GP (0)
67 /// IF (__ctl[4:1] == 0) // KeySource of 0.
68 /// IWKey.Encryption Key[127:0] := __enkey_hi[127:0]:
69 /// IWKey.Encryption Key[255:128] := __enkey_lo[127:0]
70 /// IWKey.IntegrityKey[127:0] := __intkey[127:0]
71 /// IWKey.NoBackup := __ctl[0]
73 /// ZF := 0
75 /// IF HW_NRND_GEN.ready == 1 // Full-entropy random data from RDSEED was received
76 /// IWKey.Encryption Key[127:0] := __enkey_hi[127:0] XOR HW_NRND_GEN.data[127:0]
77 /// IWKey.Encryption Key[255:128] := __enkey_lo[127:0] XOR HW_NRND_GEN.data[255:128]
78 /// IWKey.Encryption Key[255:0] := __enkey_hi[127:0]:__enkey_lo[127:0] XOR HW_NRND_GEN.data[255…
79 /// IWKey.IntegrityKey[127:0] := __intkey[127:0] XOR HW_NRND_GEN.data[383:256]
80 /// IWKey.NoBackup := __ctl[0]
82 /// ZF := 0
88 /// OF := 0
89 /// SF := 0
90 /// AF := 0
91 /// PF := 0
92 /// CF := 0
100 /// Wrap a 128-bit AES key from __key into a key handle and output in
101 /// ((__m128i*)__h) to ((__m128i*)__h) + 2 and a 32-bit value as return.
109 /// InputKey[127:0] := __key[127:0]
110 /// KeyMetadata[2:0] := __htype[2:0]
111 /// KeyMetadata[23:3] := 0 // Reserved for future usage
112 /// KeyMetadata[27:24] := 0 // KeyType is AES-128 (value of 0)
113 /// KeyMetadata[127:28] := 0 // Reserved for future usage
114 /// Handle[383:0] := WrapKey128(InputKey[127:0], KeyMetadata[127:0],
115 /// IWKey.Integrity Key[127:0], IWKey.Encryption Key[255:0])
116 /// dst[0] := IWKey.NoBackup
117 /// dst[4:1] := IWKey.KeySource[3:0]
118 /// dst[31:5] := 0
119 /// MEM[__h+127:__h] := Handle[127:0] // AAD
122 /// OF := 0
123 /// SF := 0
124 /// ZF := 0
125 /// AF := 0
126 /// PF := 0
127 /// CF := 0
134 /// Wrap a 256-bit AES key from __key_hi:__key_lo into a key handle, then
136 /// a 32-bit value as return.
144 /// InputKey[127:0] := __key_lo[127:0]
146 /// KeyMetadata[2:0] := __htype[2:0]
147 /// KeyMetadata[23:3] := 0 // Reserved for future usage
148 /// KeyMetadata[27:24] := 1 // KeyType is AES-256 (value of 1)
149 /// KeyMetadata[127:28] := 0 // Reserved for future usage
150 /// Handle[511:0] := WrapKey256(InputKey[255:0], KeyMetadata[127:0],
151 /// IWKey.Integrity Key[127:0], IWKey.Encryption Key[255:0])
152 /// dst[0] := IWKey.NoBackup
153 /// dst[4:1] := IWKey.KeySource[3:0]
154 /// dst[31:5] := 0
155 /// MEM[__h+127:__h] := Handle[127:0] // AAD
157 /// MEM[__h+383:__h+256] := Handle[383:256] // CipherText[127:0]
159 /// OF := 0
160 /// SF := 0
161 /// ZF := 0
162 /// AF := 0
163 /// PF := 0
164 /// CF := 0
174 /// the 128-bit key in the handle from the __h. It stores the result in the
182 /// Handle[383:0] := MEM[__h+383:__h] // Load is not guaranteed to be atomic.
183 /// IllegalHandle := ( HandleReservedBitSet (Handle[383:0]) ||
184 /// (Handle[127:0] AND (CPL > 0)) ||
186 /// HandleKeyType (Handle[383:0]) != HANDLE_KEY_TYPE_AES128 )
190 /// (UnwrappedKey, Authentic) := UnwrapKeyAndAuthenticate384 (Handle[383:0], IWKey)
191 /// IF (Authentic == 0)
194 /// MEM[__odata+127:__odata] := AES128Encrypt (__idata[127:0], UnwrappedKey)
195 /// ZF := 0
199 /// OF := 0
200 /// SF := 0
201 /// AF := 0
202 /// PF := 0
203 /// CF := 0
211 /// the 256-bit key in the handle from the __h. It stores the result in the
219 /// Handle[511:0] := MEM[__h+511:__h] // Load is not guaranteed to be atomic.
220 /// IllegalHandle := ( HandleReservedBitSet (Handle[511:0]) ||
221 /// (Handle[127:0] AND (CPL > 0)) ||
223 /// HandleKeyType (Handle[511:0]) != HANDLE_KEY_TYPE_AES256 )
226 /// MEM[__odata+127:__odata] := 0
228 /// (UnwrappedKey, Authentic) := UnwrapKeyAndAuthenticate512 (Handle[511:0], IWKey)
229 /// IF (Authentic == 0)
231 /// MEM[__odata+127:__odata] := 0
233 /// MEM[__odata+127:__odata] := AES256Encrypt (__idata[127:0], UnwrappedKey)
234 /// ZF := 0
238 /// OF := 0
239 /// SF := 0
240 /// AF := 0
241 /// PF := 0
242 /// CF := 0
250 /// the 128-bit key in the handle from the __h. It stores the result in the
258 /// Handle[383:0] := MEM[__h+383:__h] // Load is not guaranteed to be atomic.
259 /// IllegalHandle := (HandleReservedBitSet (Handle[383:0]) ||
260 /// (Handle[127:0] AND (CPL > 0)) ||
262 /// HandleKeyType (Handle[383:0]) != HANDLE_KEY_TYPE_AES128)
265 /// MEM[__odata+127:__odata] := 0
267 /// (UnwrappedKey, Authentic) := UnwrapKeyAndAuthenticate384 (Handle[383:0], IWKey)
268 /// IF (Authentic == 0)
270 /// MEM[__odata+127:__odata] := 0
272 /// MEM[__odata+127:__odata] := AES128Decrypt (__idata[127:0], UnwrappedKey)
273 /// ZF := 0
277 /// OF := 0
278 /// SF := 0
279 /// AF := 0
280 /// PF := 0
281 /// CF := 0
289 /// the 256-bit key in the handle from the __h. It stores the result in the
297 /// Handle[511:0] := MEM[__h+511:__h]
298 /// IllegalHandle := (HandleReservedBitSet (Handle[511:0]) ||
299 /// (Handle[127:0] AND (CPL > 0)) ||
301 /// HandleKeyType (Handle[511:0]) != HANDLE_KEY_TYPE_AES256)
304 /// MEM[__odata+127:__odata] := 0
306 /// (UnwrappedKey, Authentic) := UnwrapKeyAndAuthenticate512 (Handle[511:0], IWKey)
307 /// IF (Authentic == 0)
309 /// MEM[__odata+127:__odata] := 0
311 /// MEM[__odata+127:__odata] := AES256Decrypt (__idata[127:0], UnwrappedKey)
312 /// ZF := 0
316 /// OF := 0
317 /// SF := 0
318 /// AF := 0
319 /// PF := 0
320 /// CF := 0
338 /// Encrypt __idata[0] to __idata[7] using 128-bit AES key indicated by handle
348 /// IllegalHandle := ( HandleReservedBitSet (Handle[383:0]) ||
349 /// (Handle[127:0] AND (CPL > 0)) ||
351 /// HandleKeyType (Handle[383:0]) != HANDLE_KEY_TYPE_AES128 )
354 /// FOR i := 0 to 7
355 /// __odata[i] := 0
358 /// (UnwrappedKey, Authentic) := UnwrapKeyAndAuthenticate384 (Handle[383:0], IWKey)
359 /// IF Authentic == 0
361 /// FOR i := 0 to 7
362 /// __odata[i] := 0
365 /// FOR i := 0 to 7
368 /// ZF := 0
372 /// OF := 0
373 /// SF := 0
374 /// AF := 0
375 /// PF := 0
376 /// CF := 0
384 /// Encrypt __idata[0] to __idata[7] using 256-bit AES key indicated by handle
393 /// Handle[511:0] := MEM[__h+511:__h]
394 /// IllegalHandle := ( HandleReservedBitSet (Handle[511:0]) ||
395 /// (Handle[127:0] AND (CPL > 0)) ||
397 /// HandleKeyType (Handle[511:0]) != HANDLE_KEY_TYPE_AES512 )
400 /// FOR i := 0 to 7
401 /// __odata[i] := 0
404 /// (UnwrappedKey, Authentic) := UnwrapKeyAndAuthenticate512 (Handle[511:0], IWKey)
405 /// IF Authentic == 0
407 /// FOR i := 0 to 7
408 /// __odata[i] := 0
411 /// FOR i := 0 to 7
414 /// ZF := 0
418 /// OF := 0
419 /// SF := 0
420 /// AF := 0
421 /// PF := 0
422 /// CF := 0
430 /// Decrypt __idata[0] to __idata[7] using 128-bit AES key indicated by handle
439 /// Handle[383:0] := MEM[__h+383:__h]
440 /// IllegalHandle := ( HandleReservedBitSet (Handle[383:0]) ||
441 /// (Handle[127:0] AND (CPL > 0)) ||
446 /// FOR i := 0 to 7
447 /// __odata[i] := 0
450 /// (UnwrappedKey, Authentic) := UnwrapKeyAndAuthenticate384 (Handle[383:0], IWKey)
451 /// IF Authentic == 0
453 /// FOR i := 0 to 7
454 /// __odata[i] := 0
457 /// FOR i := 0 to 7
460 /// ZF := 0
464 /// OF := 0
465 /// SF := 0
466 /// AF := 0
467 /// PF := 0
468 /// CF := 0
476 /// Decrypt __idata[0] to __idata[7] using 256-bit AES key indicated by handle
485 /// Handle[511:0] := MEM[__h+511:__h]
486 /// IllegalHandle = ( HandleReservedBitSet (Handle[511:0]) ||
487 /// (Handle[127:0] AND (CPL > 0)) ||
492 /// FOR i := 0 to 7
493 /// __odata[i] := 0
496 /// (UnwrappedKey, Authentic) := UnwrapKeyAndAuthenticate512 (Handle[511:0], IWKey)
497 /// IF Authentic == 0
499 /// FOR i := 0 to 7
500 /// __odata[i] := 0
503 /// FOR i := 0 to 7
506 /// ZF := 0
510 /// OF := 0
511 /// SF := 0
512 /// AF := 0
513 /// PF := 0
514 /// CF := 0