From d396057109243ec6fe3642334ac9cf3e9cda072a Mon Sep 17 00:00:00 2001 From: Sean Parkinson Date: Thu, 29 Mar 2018 14:55:55 +1000 Subject: [PATCH] wolfSSL: Fix crypto_ec_point_y_sqr() Use the correct intermediate result from mp_sqrmod() in the following mp_mulmod() call (t is not initialized here; it is used only after this step). Signed-off-by: Sean Parkinson --- src/crypto/crypto_wolfssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crypto/crypto_wolfssl.c b/src/crypto/crypto_wolfssl.c index 11f7b361a..2fce6b84d 100644 --- a/src/crypto/crypto_wolfssl.c +++ b/src/crypto/crypto_wolfssl.c @@ -1625,7 +1625,7 @@ crypto_ec_point_compute_y_sqr(struct crypto_ec *e, goto done; if (mp_sqrmod((mp_int *) x, &e->prime, y2) != 0 || - mp_mulmod((mp_int *) x, &t, &e->prime, y2) != 0 || + mp_mulmod((mp_int *) x, y2, &e->prime, y2) != 0 || mp_mulmod((mp_int *) x, &e->a, &e->prime, &t) != 0 || mp_addmod(y2, &t, &e->prime, y2) != 0 || mp_addmod(y2, &e->b, &e->prime, y2) != 0)