From 7a1a1a5a24aed17bff66159e6bbc709faef2281a Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Wed, 26 Feb 2014 23:14:22 +0700 Subject: Add extra arg to AddWord() and add variant of Copy() --- crypto/src/math/ec/custom/sec/SecP521R1Field.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crypto/src/math/ec/custom') diff --git a/crypto/src/math/ec/custom/sec/SecP521R1Field.cs b/crypto/src/math/ec/custom/sec/SecP521R1Field.cs index cfe3202cd..f57804778 100644 --- a/crypto/src/math/ec/custom/sec/SecP521R1Field.cs +++ b/crypto/src/math/ec/custom/sec/SecP521R1Field.cs @@ -23,7 +23,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec public static void AddOne(uint[] x, uint[] z) { - Array.Copy(x, 0, z, 0, 16); + Nat.Copy(16, x, z); uint c = Nat.Inc(16, z, 0) + x[16]; if (c > P16 || (c == P16 && Nat.Eq(16, z, P))) { @@ -87,7 +87,7 @@ namespace Org.BouncyCastle.Math.EC.Custom.Sec public static void Reduce23(uint[] z) { uint z16 = z[16]; - uint c = Nat.AddWord(16, z16 >> 9, z) + (z16 & P16); + uint c = Nat.AddWord(16, z16 >> 9, z, 0) + (z16 & P16); if (c > P16 || (c == P16 && Nat.Eq(16, z, P))) { c += Nat.Inc(16, z, 0); -- cgit 1.5.1