/
Aes.cs
70 lines (59 loc) · 2.68 KB
/
Aes.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
namespace System.Runtime.Intrinsics.X86
{
/// <summary>
/// This class provides access to Intel AES hardware instructions via intrinsics
/// </summary>
[Intrinsic]
[CLSCompliant(false)]
public abstract class Aes : Sse2
{
internal Aes() { }
public static new bool IsSupported { get => IsSupported; }
[Intrinsic]
public new abstract class X64 : Sse2.X64
{
internal X64() { }
public static new bool IsSupported { get => IsSupported; }
}
/// <summary>
/// __m128i _mm_aesdec_si128 (__m128i a, __m128i RoundKey)
/// AESDEC xmm1, xmm2/m128
/// VAESDEC xmm1, xmm2, xmm3/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 xmm1, xmm2/m128
/// VAESDECLAST xmm1, xmm2, xmm3/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 xmm1, xmm2/m128
/// VAESENC xmm1, xmm2, xmm3/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 xmm1, xmm2/m128
/// VAESENCLAST xmm1, xmm2, xmm3/m128
/// </summary>
public static Vector128<byte> EncryptLast(Vector128<byte> value, Vector128<byte> roundKey) => EncryptLast(value, roundKey);
/// <summary>
/// __m128i _mm_aesimc_si128 (__m128i a)
/// AESIMC xmm1, xmm2/m128
/// VAESIMC xmm1, xmm2/m128
/// </summary>
public static Vector128<byte> InverseMixColumns(Vector128<byte> value) => InverseMixColumns(value);
/// <summary>
/// __m128i _mm_aeskeygenassist_si128 (__m128i a, const int imm8)
/// AESKEYGENASSIST xmm1, xmm2/m128, imm8
/// VAESKEYGENASSIST xmm1, xmm2/m128, imm8
/// </summary>
public static Vector128<byte> KeygenAssist(Vector128<byte> value, [ConstantExpected] byte control) => KeygenAssist(value, control);
}
}