summaryrefslogtreecommitdiff
path: root/bcprov/src/main/java/org/bouncycastle/math/ec/custom
diff options
context:
space:
mode:
authorSergio Giro <sgiro@google.com>2016-12-28 14:46:40 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2016-12-28 14:46:40 +0000
commiteaf604a467ff401cd0e0f74051ff5afa9e07359d (patch)
treee07a69dfb26ae60a0491ee08813d462b8212ad50 /bcprov/src/main/java/org/bouncycastle/math/ec/custom
parent8cee817d7fdffd1f46d4ae09f1b8d91c3a76a655 (diff)
parent4caba4cfca3316673ae4e330e8a47932bed8a53a (diff)
downloadbouncycastle-eaf604a467ff401cd0e0f74051ff5afa9e07359d.tar.gz
Merge "bouncycastle: Android tree with upstream code for version 1.56" into upstream-master
Diffstat (limited to 'bcprov/src/main/java/org/bouncycastle/math/ec/custom')
-rw-r--r--bcprov/src/main/java/org/bouncycastle/math/ec/custom/sec/SecP256R1Field.java7
-rw-r--r--bcprov/src/main/java/org/bouncycastle/math/ec/custom/sec/SecP384R1Field.java7
2 files changed, 8 insertions, 6 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;
diff --git a/bcprov/src/main/java/org/bouncycastle/math/ec/custom/sec/SecP384R1Field.java b/bcprov/src/main/java/org/bouncycastle/math/ec/custom/sec/SecP384R1Field.java
index fcbb8727..164a7957 100644
--- a/bcprov/src/main/java/org/bouncycastle/math/ec/custom/sec/SecP384R1Field.java
+++ b/bcprov/src/main/java/org/bouncycastle/math/ec/custom/sec/SecP384R1Field.java
@@ -107,9 +107,10 @@ public class SecP384R1Field
long t4 = xx17 + xx21;
long t5 = xx21 - xx23;
long t6 = xx22 - xx23;
+ long t7 = t0 + t5;
long cc = 0;
- cc += (xx[0] & M) + t0 + t5;
+ cc += (xx[0] & M) + t7;
z[0] = (int)cc;
cc >>= 32;
cc += (xx[1] & M) + xx23 - t0 + t1;
@@ -118,10 +119,10 @@ public class SecP384R1Field
cc += (xx[2] & M) - xx21 - t1 + t2;
z[2] = (int)cc;
cc >>= 32;
- cc += (xx[3] & M) + t0 - t2 + t3 + t5;
+ cc += (xx[3] & M) - t2 + t3 + t7;
z[3] = (int)cc;
cc >>= 32;
- cc += (xx[4] & M) + xx16 + xx21 + t0 + t1 - t3 + t5;
+ cc += (xx[4] & M) + xx16 + xx21 + t1 - t3 + t7;
z[4] = (int)cc;
cc >>= 32;
cc += (xx[5] & M) - xx16 + t1 + t2 + t4;