From 839879ee7ad82df31adc2a12cf237760d3fdfda5 Mon Sep 17 00:00:00 2001 From: David Hook Date: Mon, 14 Jan 2019 16:43:22 +1100 Subject: minor tweaks --- crypto/src/crypto/signers/EcGost3410_2012Signer.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'crypto/src') diff --git a/crypto/src/crypto/signers/EcGost3410_2012Signer.cs b/crypto/src/crypto/signers/EcGost3410_2012Signer.cs index cd50916dd..e7174ace6 100644 --- a/crypto/src/crypto/signers/EcGost3410_2012Signer.cs +++ b/crypto/src/crypto/signers/EcGost3410_2012Signer.cs @@ -1,7 +1,7 @@ using Org.BouncyCastle.Math; using System; using System.IO; -using NUnit.Core; + using Org.BouncyCastle.Crypto.Parameters; using Org.BouncyCastle.Math.EC; using Org.BouncyCastle.Math.EC.Multiplier; @@ -53,7 +53,7 @@ namespace Org.BouncyCastle.Crypto.Signers { if (!forSigning) { - throw new InvalidOperationException("not initialised for signing."); + throw new InvalidOperationException("not initialized for signing"); } byte[] mRev = new byte[message.Length]; // conversion is little-endian @@ -79,15 +79,18 @@ namespace Org.BouncyCastle.Crypto.Signers do { k = BigIntegers.CreateRandomBigInteger(n.BitLength, secureRandom); - } while (k.Equals(BigInteger.Zero)); // ECConstants.ZERO)); + } + while (k.Equals(BigInteger.Zero)); // ECConstants.ZERO)); ECPoint p = basePointMultiplier.Multiply(ec.G, k).Normalize(); r = p.AffineXCoord.ToBigInteger().Mod(n); - } while (r.Equals(BigInteger.Zero)); // ECConstants.ZERO)); + } + while (r.Equals(BigInteger.Zero)); // ECConstants.ZERO)); s = (k.Multiply(e)).Add(d.Multiply(r)).Mod(n); - } while (s.Equals(BigInteger.Zero)); // ECConstants.ZERO)); + } + while (s.Equals(BigInteger.Zero)); // ECConstants.ZERO)); return new BigInteger[] { r, s }; } @@ -97,7 +100,7 @@ namespace Org.BouncyCastle.Crypto.Signers { if (forSigning) { - throw new InvalidOperationException("not initialised for verification."); + throw new InvalidOperationException("not initialized for verification"); } @@ -146,6 +149,5 @@ namespace Org.BouncyCastle.Crypto.Signers { return new FixedPointCombMultiplier(); } - } } \ No newline at end of file -- cgit 1.4.1