diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-12-03 17:25:25 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-12-03 17:25:25 +0700 |
commit | e576a376b11268ca954b95e1d7e451e283c2ba15 (patch) | |
tree | 60ca57e1458c1b6c37a8ffdda3b0d42c551a4984 /crypto/src/math/raw/Nat576.cs | |
parent | Missing file from commit (diff) | |
download | BouncyCastle.NET-ed25519-e576a376b11268ca954b95e1d7e451e283c2ba15.tar.xz |
Binary curve perf. opts.
Diffstat (limited to '')
-rw-r--r-- | crypto/src/math/raw/Nat576.cs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/crypto/src/math/raw/Nat576.cs b/crypto/src/math/raw/Nat576.cs index 174d52bcf..3525a0f05 100644 --- a/crypto/src/math/raw/Nat576.cs +++ b/crypto/src/math/raw/Nat576.cs @@ -33,6 +33,21 @@ namespace Org.BouncyCastle.Math.Raw z[zOff + 8] = x[xOff + 8]; } +#if NETCOREAPP2_1_OR_GREATER || NETSTANDARD2_1_OR_GREATER + public static void Copy64(ReadOnlySpan<ulong> x, Span<ulong> z) + { + z[0] = x[0]; + z[1] = x[1]; + z[2] = x[2]; + z[3] = x[3]; + z[4] = x[4]; + z[5] = x[5]; + z[6] = x[6]; + z[7] = x[7]; + z[8] = x[8]; + } +#endif + public static ulong[] Create64() { return new ulong[9]; @@ -71,7 +86,11 @@ namespace Org.BouncyCastle.Math.Raw return true; } +#if NETCOREAPP2_1_OR_GREATER || NETSTANDARD2_1_OR_GREATER + public static bool IsZero64(ReadOnlySpan<ulong> x) +#else public static bool IsZero64(ulong[] x) +#endif { for (int i = 0; i < 9; ++i) { |