From: Sean Parkinson Date: Thu, 29 Mar 2018 04:55:55 +0000 (+1000) Subject: wolfSSL: Fix crypto_ec_point_y_sqr() X-Git-Tag: hostap_2_7~365 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d396057109243ec6fe3642334ac9cf3e9cda072a;p=thirdparty%2Fhostap.git 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 --- 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)