diff options
Diffstat (limited to 'crypto/src/math')
-rw-r--r-- | crypto/src/math/raw/Nat256.cs | 12 | ||||
-rw-r--r-- | crypto/src/math/raw/Nat512.cs | 12 |
2 files changed, 12 insertions, 12 deletions
diff --git a/crypto/src/math/raw/Nat256.cs b/crypto/src/math/raw/Nat256.cs index 086ba53b1..47e0644f6 100644 --- a/crypto/src/math/raw/Nat256.cs +++ b/crypto/src/math/raw/Nat256.cs @@ -1391,9 +1391,9 @@ namespace Org.BouncyCastle.Math.Raw #if NETCOREAPP3_0_OR_GREATER if (Avx2.IsSupported && Unsafe.SizeOf<Vector256<byte>>() == 32) { - var X = MemoryMarshal.Cast<uint, byte>(x[..8]); - var Y = MemoryMarshal.Cast<uint, byte>(y[..8]); - var Z = MemoryMarshal.Cast<uint, byte>(z[..8]); + var X = MemoryMarshal.AsBytes(x[..8]); + var Y = MemoryMarshal.AsBytes(y[..8]); + var Z = MemoryMarshal.AsBytes(z[..8]); var X0 = MemoryMarshal.Read<Vector256<byte>>(X[0x00..0x20]); var Y0 = MemoryMarshal.Read<Vector256<byte>>(Y[0x00..0x20]); @@ -1406,9 +1406,9 @@ namespace Org.BouncyCastle.Math.Raw if (Sse2.IsSupported && Unsafe.SizeOf<Vector128<byte>>() == 16) { - var X = MemoryMarshal.Cast<uint, byte>(x[..8]); - var Y = MemoryMarshal.Cast<uint, byte>(y[..8]); - var Z = MemoryMarshal.Cast<uint, byte>(z[..8]); + var X = MemoryMarshal.AsBytes(x[..8]); + var Y = MemoryMarshal.AsBytes(y[..8]); + var Z = MemoryMarshal.AsBytes(z[..8]); var X0 = MemoryMarshal.Read<Vector128<byte>>(X[0x00..0x10]); var X1 = MemoryMarshal.Read<Vector128<byte>>(X[0x10..0x20]); diff --git a/crypto/src/math/raw/Nat512.cs b/crypto/src/math/raw/Nat512.cs index 37cf0b6ff..d94ae40da 100644 --- a/crypto/src/math/raw/Nat512.cs +++ b/crypto/src/math/raw/Nat512.cs @@ -69,9 +69,9 @@ namespace Org.BouncyCastle.Math.Raw #if NETCOREAPP3_0_OR_GREATER if (Avx2.IsSupported && Unsafe.SizeOf<Vector256<byte>>() == 32) { - var X = MemoryMarshal.Cast<uint, byte>(x[..16]); - var Y = MemoryMarshal.Cast<uint, byte>(y[..16]); - var Z = MemoryMarshal.Cast<uint, byte>(z[..16]); + var X = MemoryMarshal.AsBytes(x[..16]); + var Y = MemoryMarshal.AsBytes(y[..16]); + var Z = MemoryMarshal.AsBytes(z[..16]); var X0 = MemoryMarshal.Read<Vector256<byte>>(X[0x00..0x20]); var X1 = MemoryMarshal.Read<Vector256<byte>>(X[0x20..0x40]); @@ -89,9 +89,9 @@ namespace Org.BouncyCastle.Math.Raw if (Sse2.IsSupported && Unsafe.SizeOf<Vector128<byte>>() == 16) { - var X = MemoryMarshal.Cast<uint, byte>(x[..16]); - var Y = MemoryMarshal.Cast<uint, byte>(y[..16]); - var Z = MemoryMarshal.Cast<uint, byte>(z[..16]); + var X = MemoryMarshal.AsBytes(x[..16]); + var Y = MemoryMarshal.AsBytes(y[..16]); + var Z = MemoryMarshal.AsBytes(z[..16]); var X0 = MemoryMarshal.Read<Vector128<byte>>(X[0x00..0x10]); var X1 = MemoryMarshal.Read<Vector128<byte>>(X[0x10..0x20]); |