From c9d95ff161e66b2b87d6ee33ea3aa17646007e3f Mon Sep 17 00:00:00 2001 From: orignal Date: Fri, 8 Jan 2016 10:21:43 -0500 Subject: [PATCH] eliminate one extra multipilication --- Signature.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Signature.cpp b/Signature.cpp index 40f8ce6c..13612327 100644 --- a/Signature.cpp +++ b/Signature.cpp @@ -378,7 +378,9 @@ namespace crypto auto x = RecoverX (y, ctx); if (BN_is_bit_set (x, 0) != isHighestBitSet) BN_sub (x, q, x); // x = q - x - EDDSAPoint p {x, y}; + BIGNUM * z = BN_new (), * t = BN_new (); + BN_one (z); BN_mod_mul (t, x, y, q, ctx); // pre-calculate t + EDDSAPoint p {x, y, z, t}; if (!IsOnCurve (p, ctx)) LogPrint (eLogError, "Decoded point is not on 25519"); return p;