diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2014-03-12 15:13:25 +0400 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2014-03-12 15:13:25 +0400 |
commit | 46533014857a7f9c26c9a15a177188d5202dbcd3 (patch) | |
tree | 2f454fec81430fe747f1a2316c8e87b096be37bd | |
parent | 67de29f9e593a52552f838bf3542a85ae7d8278f (diff) |
All subclasses to control the choice of width to use
-rw-r--r-- | core/src/main/java/org/bouncycastle/math/ec/FixedPointCombMultiplier.java | 8 |
1 files changed, 6 insertions, 2 deletions
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; + } } |