Update ASoftFallback.cs

This commit is contained in:
LDj3SNuD 2018-08-19 02:02:00 +02:00 committed by GitHub
parent f6eb52d1c1
commit c4c2a87f5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -410,6 +410,42 @@ namespace ChocolArm64.Instruction
}
#endregion
#region "Aes"
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Vector128<float> Decrypt(Vector128<float> value, Vector128<float> roundKey)
{
if (!Sse.IsSupported)
{
throw new PlatformNotSupportedException();
}
return ACryptoHelper.AESInvSubBytes(ACryptoHelper.AESInvShiftRows(Sse.Xor(value, roundKey)));
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Vector128<float> Encrypt(Vector128<float> value, Vector128<float> roundKey)
{
if (!Sse.IsSupported)
{
throw new PlatformNotSupportedException();
}
return ACryptoHelper.AESSubBytes(ACryptoHelper.AESShiftRows(Sse.Xor(value, roundKey)));
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Vector128<float> InverseMixColumns(Vector128<float> value)
{
return ACryptoHelper.AESInvMixColumns(value);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Vector128<float> MixColumns(Vector128<float> value)
{
return ACryptoHelper.AESMixColumns(value);
}
#endregion
#region "Sha256"
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Vector128<float> HashLower(Vector128<float> hash_abcd, Vector128<float> hash_efgh, Vector128<float> wk)