diff options
-rw-r--r-- | crypto/src/crypto/modes/gcm/GcmUtilities.cs | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/crypto/src/crypto/modes/gcm/GcmUtilities.cs b/crypto/src/crypto/modes/gcm/GcmUtilities.cs index e25092dce..97b34fb61 100644 --- a/crypto/src/crypto/modes/gcm/GcmUtilities.cs +++ b/crypto/src/crypto/modes/gcm/GcmUtilities.cs @@ -4,7 +4,6 @@ using System.Diagnostics; using System.Runtime.CompilerServices; #endif #if NETCOREAPP3_0_OR_GREATER -using System.Runtime.InteropServices; using System.Runtime.Intrinsics; using System.Runtime.Intrinsics.X86; #endif @@ -17,11 +16,6 @@ namespace Org.BouncyCastle.Crypto.Modes.Gcm { internal abstract class GcmUtilities { -#if NETCOREAPP3_0_OR_GREATER - private static readonly Vector128<byte> EndianMask = Vector128.Create((byte) - 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08); -#endif - internal struct FieldElement { internal ulong n0, n1; @@ -41,17 +35,6 @@ namespace Org.BouncyCastle.Crypto.Modes.Gcm #endif internal static void AsBytes(ulong x0, ulong x1, byte[] z) { -#if NETCOREAPP3_0_OR_GREATER - if (Ssse3.IsSupported && BitConverter.IsLittleEndian && Unsafe.SizeOf<Vector128<byte>>() == 16) - { - var X = Vector128.Create(x0, x1).AsByte(); - // TODO[Arm] System.Runtime.Intrinsics.Arm.AdvSimd.Reverse8 - var Z = Ssse3.Shuffle(X, EndianMask); - MemoryMarshal.Write(z.AsSpan(), ref Z); - return; - } -#endif - Pack.UInt64_To_BE(x0, z, 0); Pack.UInt64_To_BE(x1, z, 8); } @@ -69,17 +52,6 @@ namespace Org.BouncyCastle.Crypto.Modes.Gcm #endif internal static void AsFieldElement(byte[] x, out FieldElement z) { -#if NETCOREAPP3_0_OR_GREATER - if (Ssse3.IsSupported && BitConverter.IsLittleEndian && Unsafe.SizeOf<Vector128<byte>>() == 16) - { - var X = MemoryMarshal.Read<Vector128<byte>>(x.AsSpan()); - var Z = Ssse3.Shuffle(X, EndianMask).AsUInt64(); - z.n0 = Z.GetElement(0); - z.n1 = Z.GetElement(1); - return; - } -#endif - z.n0 = Pack.BE_To_UInt64(x, 0); z.n1 = Pack.BE_To_UInt64(x, 8); } |