pub unsafe fn _mm_loadiwkey(
control: u32,
integrity_key: __m128i,
key_lo: __m128i,
key_hi: __m128i,
)
🔬This is a nightly-only experimental API. (
keylocker_x86
#134813)Available on (x86 or x86-64) and target feature
kl
and x86-64 only.Expand description
Load internal wrapping key (IWKey). The 32-bit unsigned integer control
specifies IWKey’s KeySource
and whether backing up the key is permitted. IWKey’s 256-bit encryption key is loaded from key_lo
and key_hi
.
control[0]
: NoBackup bit. If set, the IWKey cannot be backed up.control[1:4]
: KeySource bits. These bits specify the encoding method of the IWKey. The only allowed values are0
(AES GCM SIV wrapping algorithm with the specified key) and1
(AES GCM SIV wrapping algorithm with random keys enforced by hardware). After calling_mm_loadiwkey
with KeySource set to1
, software must checkZF
to ensure that the key was loaded successfully. Using any other value may result in a General Protection Exception.control[5:31]
: Reserved for future use, must be set to0
.
Note that setting the NoBackup bit and using the KeySource value 1
requires hardware support. These
permissions can be found by calling __cpuid(0x19)
and checking the ECX[0:1]
bits. Failing to follow
these restrictions may result in a General Protection Exception.