diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2014-02-06 10:29:51 +0400 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2014-02-06 10:29:51 +0400 |
commit | 7c506b7b529d1fa7db803e63e3efb5d6fa2a421b (patch) | |
tree | 8ab149d4874d33cb44ff5a3fabd1ee09810bbacc /core/src/main/java/org/bouncycastle/crypto/kems/ECIESKeyEncapsulation.java | |
parent | cdb6db9df8b3f19116c97e46de93c1cd6074c8ef (diff) |
Use FixedPointCombMultiplier for most base-point multiplications
Diffstat (limited to 'core/src/main/java/org/bouncycastle/crypto/kems/ECIESKeyEncapsulation.java')
-rwxr-xr-x | core/src/main/java/org/bouncycastle/crypto/kems/ECIESKeyEncapsulation.java | 6 |
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) }; |