]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wolfSSL: Fix crypto_ec_point_y_sqr()
authorSean Parkinson <sean@wolfssl.com>
Thu, 29 Mar 2018 04:55:55 +0000 (14:55 +1000)
committerJouni Malinen <j@w1.fi>
Wed, 2 May 2018 10:32:51 +0000 (13:32 +0300)
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>
src/crypto/crypto_wolfssl.c

index 11f7b361ac0e0ac4486a51800cb78ca7288e71f6..2fce6b84d4d850e499adb4d9f0887d34c9d9b0a9 100644 (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)