Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2014-03-12 15:13:25 +0400
committerPeter Dettman <peter.dettman@bouncycastle.org>2014-03-12 15:13:25 +0400
commit46533014857a7f9c26c9a15a177188d5202dbcd3 (patch)
tree2f454fec81430fe747f1a2316c8e87b096be37bd /core/src/main/java/org
parent67de29f9e593a52552f838bf3542a85ae7d8278f (diff)
All subclasses to control the choice of width to use
Diffstat (limited to 'core/src/main/java/org')
-rw-r--r--core/src/main/java/org/bouncycastle/math/ec/FixedPointCombMultiplier.java8
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;
+ }
}