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>2013-09-28 20:20:24 +0400
committerPeter Dettman <peter.dettman@bouncycastle.org>2013-09-28 20:20:24 +0400
commit2d0f484008da488474a00694e6fc5ed848f59950 (patch)
treefa30b9ba1bbb305363baa41c7ee969cd17e7fb59 /core/src/main/java/org/bouncycastle/math
parentf4f32676b75a63a20c8234d782a386ebb8e6d520 (diff)
Fix equal-x check for lambda-projective addition
Diffstat (limited to 'core/src/main/java/org/bouncycastle/math')
-rw-r--r--core/src/main/java/org/bouncycastle/math/ec/ECPoint.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/src/main/java/org/bouncycastle/math/ec/ECPoint.java b/core/src/main/java/org/bouncycastle/math/ec/ECPoint.java
index 2529bf71..74ef362c 100644
--- a/core/src/main/java/org/bouncycastle/math/ec/ECPoint.java
+++ b/core/src/main/java/org/bouncycastle/math/ec/ECPoint.java
@@ -1227,7 +1227,7 @@ public abstract class ECPoint
}
ECFieldElement A = S1.add(S2);
- ECFieldElement B = U1.add(U2).square();
+ ECFieldElement B = U1.add(U2);
if (B.isZero())
{
@@ -1239,6 +1239,8 @@ public abstract class ECPoint
return (ECPoint.F2m)curve.getInfinity();
}
+ B = B.square();
+
ECFieldElement AU1 = A.multiply(U1);
ECFieldElement AU2 = A.multiply(U2);
ECFieldElement ABZ2 = A.multiply(B);