aboutsummaryrefslogtreecommitdiffstats
path: root/src/math
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-02-25 23:39:44 +0000
committerlloyd <[email protected]>2010-02-25 23:39:44 +0000
commit6c80cb87f56f945d6d2580e770cc2abbb2360004 (patch)
tree32f7a4c2dd781c99d60ba7c03dd2babf90699b45 /src/math
parent08647db8877585a783797c8db22dc76233b200f0 (diff)
Simplify mult2_in_place slightly
Diffstat (limited to 'src/math')
-rw-r--r--src/math/numbertheory/point_gfp.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/math/numbertheory/point_gfp.cpp b/src/math/numbertheory/point_gfp.cpp
index 06c42d18c..3a4684899 100644
--- a/src/math/numbertheory/point_gfp.cpp
+++ b/src/math/numbertheory/point_gfp.cpp
@@ -196,15 +196,11 @@ void PointGFp::mult2_in_place()
BigInt x = mod_p.reduce(mod_p.square(M) - mod_p.multiply(2, S));
- BigInt y = mod_p.square(y_2);
+ BigInt U = mod_p.multiply(8, mod_p.square(y_2));
- BigInt z = mod_p.multiply(2, mod_p.reduce(y + y));
+ BigInt y = mod_p.reduce(mod_p.multiply(M, S - x) - U);
- BigInt U = mod_p.reduce(z + z);
-
- y = mod_p.reduce(mod_p.multiply(M, S - x) - U);
-
- z = mod_p.multiply(2, mod_p.multiply(coord_y, coord_z));
+ BigInt z = mod_p.multiply(2, mod_p.multiply(coord_y, coord_z));
coord_x = x;
coord_y = y;