Skip to main content

## _mm_encodekey256_u32

# Function _mm_encodekey256_u32

1.89.0 · Source

    pub unsafe fn _mm_encodekey256_u32(
        key_params: u32,
        key_lo: __m128i,
        key_hi: __m128i,
        handle: *mut u8,
    ) -> u32

Available on x86 and target feature `kl` and (x86 or x86-64) only.
Expand description

Wrap a 256-bit AES key into a 512-bit key handle and stores it in `handle`. Returns the `control` parameter used to create the IWKey.

- `key_params[0]`: If set, this key can only be used by the Kernel.
- `key_params[1]`: If set, this key can not be used to encrypt.
- `key_params[2]`: If set, this key can not be used to decrypt.
- `key_params[31:3]`: Reserved for future use, must be set to `0`.

Note that these restrictions need hardware support, and the supported restrictions can be found by calling `__cpuid(0x19)` and checking the `EAX[0:2]` bits. Failing to follow these restrictions may result in a General Protection Exception.

Intel’s documentation