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-02-06 10:29:51 +0400
committerPeter Dettman <peter.dettman@bouncycastle.org>2014-02-06 10:29:51 +0400
commit7c506b7b529d1fa7db803e63e3efb5d6fa2a421b (patch)
tree8ab149d4874d33cb44ff5a3fabd1ee09810bbacc /core/src/main/java/org/bouncycastle/crypto/kems/ECIESKeyEncapsulation.java
parentcdb6db9df8b3f19116c97e46de93c1cd6074c8ef (diff)
Use FixedPointCombMultiplier for most base-point multiplications
Diffstat (limited to 'core/src/main/java/org/bouncycastle/crypto/kems/ECIESKeyEncapsulation.java')
-rwxr-xr-xcore/src/main/java/org/bouncycastle/crypto/kems/ECIESKeyEncapsulation.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/src/main/java/org/bouncycastle/crypto/kems/ECIESKeyEncapsulation.java b/core/src/main/java/org/bouncycastle/crypto/kems/ECIESKeyEncapsulation.java
index dcdb752a..746d26ca 100755
--- a/core/src/main/java/org/bouncycastle/crypto/kems/ECIESKeyEncapsulation.java
+++ b/core/src/main/java/org/bouncycastle/crypto/kems/ECIESKeyEncapsulation.java
@@ -13,7 +13,9 @@ import org.bouncycastle.crypto.params.ECPublicKeyParameters;
import org.bouncycastle.crypto.params.KDFParameters;
import org.bouncycastle.crypto.params.KeyParameter;
import org.bouncycastle.math.ec.ECCurve;
+import org.bouncycastle.math.ec.ECMultiplier;
import org.bouncycastle.math.ec.ECPoint;
+import org.bouncycastle.math.ec.FixedPointCombMultiplier;
import org.bouncycastle.util.Arrays;
import org.bouncycastle.util.BigIntegers;
@@ -121,8 +123,10 @@ public class ECIESKeyEncapsulation
// Compute the static-ephemeral key agreement
BigInteger rPrime = CofactorMode ? r.multiply(h).mod(n) : r;
+ ECMultiplier basePointMultiplier = new FixedPointCombMultiplier();
+
ECPoint[] ghTilde = new ECPoint[]{
- ecParams.getG().multiply(r),
+ basePointMultiplier.multiply(ecParams.getG(), r),
ecPubKey.getQ().multiply(rPrime)
};