25#error "Never use <keylockerintrin.h> directly; include <immintrin.h> instead."
28#ifndef _KEYLOCKERINTRIN_H
29#define _KEYLOCKERINTRIN_H
31#if !defined(__SCE__) || __has_feature(modules) || defined(__KL__)
34#define __DEFAULT_FN_ATTRS \
35 __attribute__((__always_inline__, __nodebug__, __target__("kl"),\
36 __min_vector_width__(128)))
96 __m128i __enkey_lo, __m128i __enkey_hi) {
97 __builtin_ia32_loadiwkey (__intkey, __enkey_lo, __enkey_hi, __ctl);
131 return __builtin_ia32_encodekey128_u32(__htype, (__v2di)__key, __h);
169 return __builtin_ia32_encodekey256_u32(__htype, (__v2di)__key_lo,
170 (__v2di)__key_hi, __h);
207 return __builtin_ia32_aesenc128kl_u8((__v2di *)__odata, (__v2di)__idata, __h);
246 return __builtin_ia32_aesenc256kl_u8((__v2di *)__odata, (__v2di)__idata, __h);
285 return __builtin_ia32_aesdec128kl_u8((__v2di *)__odata, (__v2di)__idata, __h);
324 return __builtin_ia32_aesdec256kl_u8((__v2di *)__odata, (__v2di)__idata, __h);
327#undef __DEFAULT_FN_ATTRS
331#if !defined(__SCE__) || __has_feature(modules) || defined(__WIDEKL__)
334#define __DEFAULT_FN_ATTRS \
335 __attribute__((__always_inline__, __nodebug__, __target__("kl,widekl"),\
336 __min_vector_width__(128)))
380 return __builtin_ia32_aesencwide128kl_u8((__v2di *)__odata,
381 (
const __v2di *)__idata, __h);
426 return __builtin_ia32_aesencwide256kl_u8((__v2di *)__odata,
427 (
const __v2di *)__idata, __h);
472 return __builtin_ia32_aesdecwide128kl_u8((__v2di *)__odata,
473 (
const __v2di *)__idata, __h);
518 return __builtin_ia32_aesdecwide256kl_u8((__v2di *)__odata,
519 (
const __v2di *)__idata, __h);
522#undef __DEFAULT_FN_ATTRS
static __inline__ unsigned char __DEFAULT_FN_ATTRS _mm_aesencwide256kl_u8(__m128i __odata[8], const __m128i __idata[8], const void *__h)
Encrypt __idata[0] to __idata[7] using 256-bit AES key indicated by handle at __h and store each resu...
static __inline__ unsigned char __DEFAULT_FN_ATTRS _mm_aesdec256kl_u8(__m128i *__odata, __m128i __idata, const void *__h)
The AESDEC256KL performs 10 rounds of AES to decrypt the __idata using the 256-bit key in the handle ...
static __inline__ unsigned char __DEFAULT_FN_ATTRS _mm_aesenc128kl_u8(__m128i *__odata, __m128i __idata, const void *__h)
The AESENC128KL performs 10 rounds of AES to encrypt the __idata using the 128-bit key in the handle ...
#define __DEFAULT_FN_ATTRS
static __inline__ void __DEFAULT_FN_ATTRS _mm_loadiwkey(unsigned int __ctl, __m128i __intkey, __m128i __enkey_lo, __m128i __enkey_hi)
Load internal wrapping key from __intkey, __enkey_lo and __enkey_hi.
static __inline__ unsigned int __DEFAULT_FN_ATTRS _mm_encodekey128_u32(unsigned int __htype, __m128i __key, void *__h)
Wrap a 128-bit AES key from __key into a key handle and output in ((__m128i*)__h) to ((__m128i*)__h) ...
static __inline__ unsigned char __DEFAULT_FN_ATTRS _mm_aesencwide128kl_u8(__m128i __odata[8], const __m128i __idata[8], const void *__h)
Encrypt __idata[0] to __idata[7] using 128-bit AES key indicated by handle at __h and store each resu...
static __inline__ unsigned int __DEFAULT_FN_ATTRS _mm_encodekey256_u32(unsigned int __htype, __m128i __key_lo, __m128i __key_hi, void *__h)
Wrap a 256-bit AES key from __key_hi:__key_lo into a key handle, then output handle in ((__m128i*)__h...
static __inline__ unsigned char __DEFAULT_FN_ATTRS _mm_aesdec128kl_u8(__m128i *__odata, __m128i __idata, const void *__h)
The AESDEC128KL performs 10 rounds of AES to decrypt the __idata using the 128-bit key in the handle ...
static __inline__ unsigned char __DEFAULT_FN_ATTRS _mm_aesenc256kl_u8(__m128i *__odata, __m128i __idata, const void *__h)
The AESENC256KL performs 14 rounds of AES to encrypt the __idata using the 256-bit key in the handle ...
static __inline__ unsigned char __DEFAULT_FN_ATTRS _mm_aesdecwide256kl_u8(__m128i __odata[8], const __m128i __idata[8], const void *__h)
Decrypt __idata[0] to __idata[7] using 256-bit AES key indicated by handle at __h and store each resu...
static __inline__ unsigned char __DEFAULT_FN_ATTRS _mm_aesdecwide128kl_u8(__m128i __odata[8], const __m128i __idata[8], const void *__h)
Decrypt __idata[0] to __idata[7] using 128-bit AES key indicated by handle at __h and store each resu...