summary refs log tree commit diff
path: root/crypto/src/math/ec
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/math/ec')
-rw-r--r--crypto/src/math/ec/multiplier/FixedPointUtilities.cs2
-rw-r--r--crypto/src/math/ec/multiplier/WTauNafMultiplier.cs4
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;