summaryrefslogtreecommitdiff
path: root/bcprov/src/main/java/org/bouncycastle/math/ec/custom/sec/SecP256R1Field.java
diff options
context:
space:
mode:
authorSergio Giro <sgiro@google.com>2016-12-28 14:18:01 +0000
committerSergio Giro <sgiro@google.com>2016-12-28 14:24:48 +0000
commit4caba4cfca3316673ae4e330e8a47932bed8a53a (patch)
treee07a69dfb26ae60a0491ee08813d462b8212ad50 /bcprov/src/main/java/org/bouncycastle/math/ec/custom/sec/SecP256R1Field.java
parent8cee817d7fdffd1f46d4ae09f1b8d91c3a76a655 (diff)
downloadbouncycastle-4caba4cfca3316673ae4e330e8a47932bed8a53a.tar.gz
bouncycastle: Android tree with upstream code for version 1.56
Test: no tests needed, this branch is for easy diffing against upstream Change-Id: Ib75613e1211e7f02f225b9020ba31f2b45acc8d8
Diffstat (limited to 'bcprov/src/main/java/org/bouncycastle/math/ec/custom/sec/SecP256R1Field.java')
-rw-r--r--bcprov/src/main/java/org/bouncycastle/math/ec/custom/sec/SecP256R1Field.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/bcprov/src/main/java/org/bouncycastle/math/ec/custom/sec/SecP256R1Field.java b/bcprov/src/main/java/org/bouncycastle/math/ec/custom/sec/SecP256R1Field.java
index 5a066d81..1e04f4b9 100644
--- a/bcprov/src/main/java/org/bouncycastle/math/ec/custom/sec/SecP256R1Field.java
+++ b/bcprov/src/main/java/org/bouncycastle/math/ec/custom/sec/SecP256R1Field.java
@@ -112,9 +112,10 @@ public class SecP256R1Field
long t4 = xx12 + xx13;
long t5 = xx13 + xx14;
long t6 = xx14 + xx15;
+ long t7 = t5 - t0;
long cc = 0;
- cc += (xx[0] & M) + t0 - t3 - t5;
+ cc += (xx[0] & M) - t3 - t7;
z[0] = (int)cc;
cc >>= 32;
cc += (xx[1] & M) + t1 - t4 - t6;
@@ -123,7 +124,7 @@ public class SecP256R1Field
cc += (xx[2] & M) + t2 - t5;
z[2] = (int)cc;
cc >>= 32;
- cc += (xx[3] & M) + (t3 << 1) + xx13 - xx15 - t0;
+ cc += (xx[3] & M) + (t3 << 1) + t7 - t6;
z[3] = (int)cc;
cc >>= 32;
cc += (xx[4] & M) + (t4 << 1) + xx14 - t1;
@@ -132,7 +133,7 @@ public class SecP256R1Field
cc += (xx[5] & M) + (t5 << 1) - t2;
z[5] = (int)cc;
cc >>= 32;
- cc += (xx[6] & M) + (t6 << 1) + t5 - t0;
+ cc += (xx[6] & M) + (t6 << 1) + t7;
z[6] = (int)cc;
cc >>= 32;
cc += (xx[7] & M) + (xx15 << 1) + xx08 - t2 - t4;