From 7fb2d13a8bb10d00f385366c65a7c0a087455d9a Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Wed, 27 Sep 2017 09:49:43 -0400 Subject: [PATCH] use BN_CTX_start and BN_CTX_end instead of removing BN_CTX_start --- libi2pd/Signature.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libi2pd/Signature.cpp b/libi2pd/Signature.cpp index 7a84a41b..c5c2419b 100644 --- a/libi2pd/Signature.cpp +++ b/libi2pd/Signature.cpp @@ -316,6 +316,7 @@ namespace crypto bool IsOnCurve (const EDDSAPoint& p, BN_CTX * ctx) const { + BN_CTX_start (ctx); BIGNUM * x2 = BN_CTX_get (ctx), * y2 = BN_CTX_get (ctx), * tmp = BN_CTX_get (ctx); BN_sqr (x2, p.x, ctx); // x^2 BN_sqr (y2, p.y, ctx); // y^2 @@ -352,7 +353,7 @@ namespace crypto BN_mod_mul (x, x, I, q, ctx); if (BN_is_odd (x)) BN_sub (x, q, x); - + BN_CTX_end (ctx); return x; }