summary refs log tree commit diff
path: root/crypto/src/math/ec
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2023-01-27 01:58:23 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2023-01-27 01:58:23 +0700
commite71fe27c302d36e6355d9da12f3d9ec51540825a (patch)
tree6aa065f627d14e659e68ae0cbe355b656af3e40f /crypto/src/math/ec
parentAdd CrlID.GetInstance methods, obsolete public constructor (diff)
downloadBouncyCastle.NET-ed25519-e71fe27c302d36e6355d9da12f3d9ec51540825a.tar.xz
Misc. cleanup after bc-fips-csharp updates
Diffstat (limited to 'crypto/src/math/ec')
-rw-r--r--crypto/src/math/ec/ECPoint.cs6
-rw-r--r--crypto/src/math/ec/abc/Tnaf.cs4
2 files changed, 3 insertions, 7 deletions
diff --git a/crypto/src/math/ec/ECPoint.cs b/crypto/src/math/ec/ECPoint.cs

index 1329ea0d0..4607c8cfe 100644 --- a/crypto/src/math/ec/ECPoint.cs +++ b/crypto/src/math/ec/ECPoint.cs
@@ -487,11 +487,7 @@ namespace Org.BouncyCastle.Math.EC public PreCompInfo Precompute(PreCompInfo existing) { - ValidityPreCompInfo info = existing as ValidityPreCompInfo; - if (info == null) - { - info = new ValidityPreCompInfo(); - } + ValidityPreCompInfo info = existing as ValidityPreCompInfo ?? new ValidityPreCompInfo(); if (info.HasFailed()) return info; diff --git a/crypto/src/math/ec/abc/Tnaf.cs b/crypto/src/math/ec/abc/Tnaf.cs
index fd073bb7b..88a4eeb96 100644 --- a/crypto/src/math/ec/abc/Tnaf.cs +++ b/crypto/src/math/ec/abc/Tnaf.cs
@@ -13,7 +13,7 @@ namespace Org.BouncyCastle.Math.EC.Abc * by Jerome A. Solinas. The paper first appeared in the Proceedings of * Crypto 1997. */ - internal class Tnaf + internal static class Tnaf { private static readonly BigInteger MinusOne = BigInteger.One.Negate(); private static readonly BigInteger MinusTwo = BigInteger.Two.Negate(); @@ -552,7 +552,7 @@ namespace Org.BouncyCastle.Math.EC.Abc return new BigInteger[] { dividend0, dividend1 }; } - protected static int GetShiftsForCofactor(BigInteger h) + private static int GetShiftsForCofactor(BigInteger h) { if (h != null && h.BitLength < 4) {