diff options
Diffstat (limited to 'src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Aes.cs')
-rw-r--r-- | src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Aes.cs | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Aes.cs b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Aes.cs new file mode 100644 index 000000000..412a0c2f1 --- /dev/null +++ b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Aes.cs @@ -0,0 +1,58 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Runtime.Intrinsics; + +namespace System.Runtime.Intrinsics.X86 +{ + /// <summary> + /// This class provides access to Intel AES hardware instructions via intrinsics + /// </summary> + [CLSCompliant(false)] + public abstract class Aes : Sse2 + { + internal Aes() { } + + public new static bool IsSupported { get => IsSupported; } + + /// <summary> + /// __m128i _mm_aesdec_si128 (__m128i a, __m128i RoundKey) + /// AESDEC xmm, xmm/m128 + /// </summary> + public static Vector128<byte> Decrypt(Vector128<byte> value, Vector128<byte> roundKey) => Decrypt(value, roundKey); + + /// <summary> + /// __m128i _mm_aesdeclast_si128 (__m128i a, __m128i RoundKey) + /// AESDECLAST xmm, xmm/m128 + /// </summary> + public static Vector128<byte> DecryptLast(Vector128<byte> value, Vector128<byte> roundKey) => DecryptLast(value, roundKey); + + /// <summary> + /// __m128i _mm_aesenc_si128 (__m128i a, __m128i RoundKey) + /// AESENC xmm, xmm/m128 + /// </summary> + public static Vector128<byte> Encrypt(Vector128<byte> value, Vector128<byte> roundKey) => Encrypt(value, roundKey); + + /// <summary> + /// __m128i _mm_aesenclast_si128 (__m128i a, __m128i RoundKey) + /// AESENCLAST xmm, xmm/m128 + /// </summary> + public static Vector128<byte> EncryptLast(Vector128<byte> value, Vector128<byte> roundKey) => EncryptLast(value, roundKey); + + /// <summary> + /// __m128i _mm_aesimc_si128 (__m128i a) + /// AESIMC xmm, xmm/m128 + /// </summary> + public static Vector128<byte> InverseMixColumns(Vector128<byte> value) => InverseMixColumns(value); + + /// <summary> + /// __m128i _mm_aeskeygenassist_si128 (__m128i a, const int imm8) + /// AESKEYGENASSIST xmm, xmm/m128, imm8 + /// </summary> + public static Vector128<byte> KeygenAssist(Vector128<byte> value, byte control) => KeygenAssist(value, control); + + } + +} |