diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2018-04-15 21:12:11 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2018-04-15 21:12:11 +0700 |
commit | d79a501212d4012139c714e361577669c75171aa (patch) | |
tree | f78e8c7d34c9448698e17bc341fd8d293814dd3e /crypto/src/math/raw/Nat192.cs | |
parent | Update Readme.html for SHA-3 perf. opts. (diff) | |
download | BouncyCastle.NET-ed25519-d79a501212d4012139c714e361577669c75171aa.tar.xz |
Cache-safety for EC lookup tables
- creation of cache-safe lookup tables delegated to ECCurve - FixedPointCombMultiplier uses cache-safe lookup table - FixedPointCombMultiplier avoids BigInteger.TestBit
Diffstat (limited to 'crypto/src/math/raw/Nat192.cs')
-rw-r--r-- | crypto/src/math/raw/Nat192.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/crypto/src/math/raw/Nat192.cs b/crypto/src/math/raw/Nat192.cs index 3099bafab..06c75aa54 100644 --- a/crypto/src/math/raw/Nat192.cs +++ b/crypto/src/math/raw/Nat192.cs @@ -145,6 +145,16 @@ namespace Org.BouncyCastle.Math.Raw z[5] = x[5]; } + public static void Copy(uint[] x, int xOff, uint[] z, int zOff) + { + z[zOff + 0] = x[xOff + 0]; + z[zOff + 1] = x[xOff + 1]; + z[zOff + 2] = x[xOff + 2]; + z[zOff + 3] = x[xOff + 3]; + z[zOff + 4] = x[xOff + 4]; + z[zOff + 5] = x[xOff + 5]; + } + public static void Copy64(ulong[] x, ulong[] z) { z[0] = x[0]; @@ -152,6 +162,13 @@ namespace Org.BouncyCastle.Math.Raw z[2] = x[2]; } + public static void Copy64(ulong[] x, int xOff, ulong[] z, int zOff) + { + z[zOff + 0] = x[xOff + 0]; + z[zOff + 1] = x[xOff + 1]; + z[zOff + 2] = x[xOff + 2]; + } + public static uint[] Create() { return new uint[6]; |