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 <sean@wolfssl.com>
This commit is contained in:
Sean Parkinson 2018-03-29 14:55:55 +10:00 committed by Jouni Malinen
parent e3501ac18f
commit d396057109

View file

@ -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)