Поделиться через


_mm_aeskeygenassist_si128

Microsoft Specific

Emits the Advanced Encryption Standard (AES) instruction aeskeygenassist. This instruction generates a round key for AES encryption.

__m128i _mm_aeskeygenassist_si128(
   __m128i ckey,
   const int rcon
); 

Parameters

Parameter

Description

[in] ckey

128 bits of data that is used to generate the AES encryption key.

[in] rcon

A round constant used to generate the AES encryption key.

Return value

The AES encryption key.

Requirements

Intrinsic

Architecture

_mm_aeskeygenassist_si128

x86, x64

Header file <wmmintrin.h>

Remarks

AES encryption requires 10 iterations of encryption with a 128 bit round key. Each round of encryption requires a different key. This instruction helps generate the round keys. The round keys can be generated independently of the encryption phase.

The rcon parameter is not just the round of encryption. It is a constant that helps generate a round key.

Example

#include <wmmintrin.h>
#include <stdio.h>

int main()
{
    __m128i a;
    a.m128i_u64[1] = 0x8899AABBCCDDEEFF;
    a.m128i_u64[0] = 0x0123456789ABCDEF;

    const int round = 5;

    __m128i key = _mm_aeskeygenassist_si128( a, round );

    printf_s("Key value: 0x%016I64x%016I64x\n",
                key.m128i_u64[1], key.m128i_u64[0]);


    return 0;
}
Key value: 0xeac4eea9c4eeacea857c266b7c266e85

See Also

Reference

Compiler Intrinsics

_mm_aesdec_si128

_mm_aesdeclast_si128

_mm_aesenc_si128

_mm_aesenclast_si128

AES Intrinsics