1 files changed, 6 insertions, 2 deletions
diff --git a/crypto/src/math/ec/multiplier/FixedPointCombMultiplier.cs b/crypto/src/math/ec/multiplier/FixedPointCombMultiplier.cs
index 48ce4a56c..e3da3f7c2 100644
--- a/crypto/src/math/ec/multiplier/FixedPointCombMultiplier.cs
+++ b/crypto/src/math/ec/multiplier/FixedPointCombMultiplier.cs
@@ -21,8 +21,7 @@ namespace Org.BouncyCastle.Math.EC.Multiplier
throw new InvalidOperationException("fixed-point comb doesn't support scalars larger than the curve order");
}
- // TODO Call method to let subclasses select width
- int width = size > 257 ? 6 : 5;
+ int width = GetWidthForCombSize(size);
FixedPointPreCompInfo info = FixedPointUtilities.Precompute(p, width);
ECPoint[] lookupTable = info.PreComp;
@@ -50,5 +49,10 @@ namespace Org.BouncyCastle.Math.EC.Multiplier
return R;
}
+
+ protected virtual int GetWidthForCombSize(int combSize)
+ {
+ return combSize > 257 ? 6 : 5;
+ }
}
}
|