From 46533014857a7f9c26c9a15a177188d5202dbcd3 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Wed, 12 Mar 2014 18:13:25 +0700 Subject: All subclasses to control the choice of width to use --- .../java/org/bouncycastle/math/ec/FixedPointCombMultiplier.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'core/src/main/java/org') diff --git a/core/src/main/java/org/bouncycastle/math/ec/FixedPointCombMultiplier.java b/core/src/main/java/org/bouncycastle/math/ec/FixedPointCombMultiplier.java index 84fbf6a5..d2cc2e3b 100644 --- a/core/src/main/java/org/bouncycastle/math/ec/FixedPointCombMultiplier.java +++ b/core/src/main/java/org/bouncycastle/math/ec/FixedPointCombMultiplier.java @@ -20,8 +20,7 @@ public class FixedPointCombMultiplier extends AbstractECMultiplier throw new IllegalStateException("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 = FixedPointUtil.precompute(p, width); ECPoint[] lookupTable = info.getPreComp(); @@ -49,4 +48,9 @@ public class FixedPointCombMultiplier extends AbstractECMultiplier return R; } + + protected int getWidthForCombSize(int combSize) + { + return combSize > 257 ? 6 : 5; + } } -- cgit v1.2.3