diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-06-24 11:49:55 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-06-24 11:49:55 +0700 |
commit | 33e4b035e8dc3721cd311956227ad29c0f8a97d0 (patch) | |
tree | 61afd296ddc5e40bad9a72c3c7976a16e2796e42 /crypto/src/math | |
parent | Simplify attributes (diff) | |
download | BouncyCastle.NET-ed25519-33e4b035e8dc3721cd311956227ad29c0f8a97d0.tar.xz |
Some modern syntax updates
Diffstat (limited to '')
-rw-r--r-- | crypto/src/math/ec/multiplier/FixedPointUtilities.cs | 2 | ||||
-rw-r--r-- | crypto/src/math/ec/multiplier/WTauNafMultiplier.cs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/crypto/src/math/ec/multiplier/FixedPointUtilities.cs b/crypto/src/math/ec/multiplier/FixedPointUtilities.cs index 88f178e24..fd158fae9 100644 --- a/crypto/src/math/ec/multiplier/FixedPointUtilities.cs +++ b/crypto/src/math/ec/multiplier/FixedPointUtilities.cs @@ -34,7 +34,7 @@ namespace Org.BouncyCastle.Math.EC.Multiplier public PreCompInfo Precompute(PreCompInfo existing) { - FixedPointPreCompInfo existingFP = (existing is FixedPointPreCompInfo) ? (FixedPointPreCompInfo)existing : null; + FixedPointPreCompInfo existingFP = existing as FixedPointPreCompInfo; ECCurve c = m_p.Curve; int bits = FixedPointUtilities.GetCombSize(c); diff --git a/crypto/src/math/ec/multiplier/WTauNafMultiplier.cs b/crypto/src/math/ec/multiplier/WTauNafMultiplier.cs index 4dce54440..8e50a161d 100644 --- a/crypto/src/math/ec/multiplier/WTauNafMultiplier.cs +++ b/crypto/src/math/ec/multiplier/WTauNafMultiplier.cs @@ -24,10 +24,10 @@ namespace Org.BouncyCastle.Math.EC.Multiplier */ protected override ECPoint MultiplyPositive(ECPoint point, BigInteger k) { - if (!(point is AbstractF2mPoint)) + AbstractF2mPoint p = point as AbstractF2mPoint; + if (p == null) throw new ArgumentException("Only AbstractF2mPoint can be used in WTauNafMultiplier"); - AbstractF2mPoint p = (AbstractF2mPoint)point; AbstractF2mCurve curve = (AbstractF2mCurve)p.Curve; int m = curve.FieldSize; sbyte a = (sbyte)curve.A.ToBigInteger().IntValue; |