summaryrefslogtreecommitdiff
path: root/deps/openssl/openssl/crypto/bn/bn_prime.c
diff options
context:
space:
mode:
authorDaniel Bevenius <daniel.bevenius@gmail.com>2017-05-26 07:27:45 +0200
committerShigeki Ohtsu <ohtsu@ohtsu.org>2017-06-03 00:41:47 +0900
commitbd4a53493b4d130e39955a2497995707666cffd4 (patch)
treeca6d428d3eca9528608af14f0d969f8999e87c64 /deps/openssl/openssl/crypto/bn/bn_prime.c
parenta235e670a820107210be27e0cd266164763fb014 (diff)
downloadandroid-node-v8-bd4a53493b4d130e39955a2497995707666cffd4.tar.gz
android-node-v8-bd4a53493b4d130e39955a2497995707666cffd4.tar.bz2
android-node-v8-bd4a53493b4d130e39955a2497995707666cffd4.zip
deps: upgrade openssl sources to 1.0.2l
This replaces all sources of openssl-1.0.2l.tar.gz into deps/openssl/openssl Fixes: https://github.com/nodejs/node/issues/13161 PR-URL: https://github.com/nodejs/node/pull/13233 Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Diffstat (limited to 'deps/openssl/openssl/crypto/bn/bn_prime.c')
-rw-r--r--deps/openssl/openssl/crypto/bn/bn_prime.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/deps/openssl/openssl/crypto/bn/bn_prime.c b/deps/openssl/openssl/crypto/bn/bn_prime.c
index 8177fd2947..e911e15785 100644
--- a/deps/openssl/openssl/crypto/bn/bn_prime.c
+++ b/deps/openssl/openssl/crypto/bn/bn_prime.c
@@ -252,7 +252,6 @@ int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed,
BN_CTX *ctx = NULL;
BIGNUM *A1, *A1_odd, *check; /* taken from ctx */
BN_MONT_CTX *mont = NULL;
- const BIGNUM *A = NULL;
if (BN_cmp(a, BN_value_one()) <= 0)
return 0;
@@ -278,25 +277,14 @@ int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed,
goto err;
BN_CTX_start(ctx);
- /* A := abs(a) */
- if (a->neg) {
- BIGNUM *t;
- if ((t = BN_CTX_get(ctx)) == NULL)
- goto err;
- if (BN_copy(t, a) == NULL)
- goto err;
- t->neg = 0;
- A = t;
- } else
- A = a;
A1 = BN_CTX_get(ctx);
A1_odd = BN_CTX_get(ctx);
check = BN_CTX_get(ctx);
if (check == NULL)
goto err;
- /* compute A1 := A - 1 */
- if (!BN_copy(A1, A))
+ /* compute A1 := a - 1 */
+ if (!BN_copy(A1, a))
goto err;
if (!BN_sub_word(A1, 1))
goto err;
@@ -312,11 +300,11 @@ int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed,
if (!BN_rshift(A1_odd, A1, k))
goto err;
- /* Montgomery setup for computations mod A */
+ /* Montgomery setup for computations mod a */
mont = BN_MONT_CTX_new();
if (mont == NULL)
goto err;
- if (!BN_MONT_CTX_set(mont, A, ctx))
+ if (!BN_MONT_CTX_set(mont, a, ctx))
goto err;
for (i = 0; i < checks; i++) {
@@ -324,9 +312,9 @@ int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed,
goto err;
if (!BN_add_word(check, 1))
goto err;
- /* now 1 <= check < A */
+ /* now 1 <= check < a */
- j = witness(check, A, A1, A1_odd, k, ctx, mont);
+ j = witness(check, a, A1, A1_odd, k, ctx, mont);
if (j == -1)
goto err;
if (j) {