Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions wolfcrypt/src/curve25519.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,15 @@ int wc_curve25519_make_pub(int public_size, byte* pub, int private_size,
#endif /* !WOLFSSL_CURVE25519_BLINDING */
#endif /* FREESCALE_LTC_ECC */

/* If WOLFSSL_CURVE25519_BLINDING is defined, this check is run in
* wc_curve25519_make_pub_blind since it could be called directly. */
#if !defined(WOLFSSL_CURVE25519_BLINDING) || defined(FREESCALE_LTC_ECC)
if (ret == 0) {
ret = wc_curve25519_check_public(pub, (word32)public_size,
EC25519_LITTLE_ENDIAN);
}
#endif

return ret;
}

Expand Down Expand Up @@ -297,6 +306,11 @@ int wc_curve25519_make_pub_blind(int public_size, byte* pub, int private_size,
ret = curve25519_smul_blind(pub, priv, (byte*)kCurve25519BasePoint, rng);
#endif

if (ret == 0) {
ret = wc_curve25519_check_public(pub, (word32)public_size,
EC25519_LITTLE_ENDIAN);
}

return ret;
}
#endif
Expand Down Expand Up @@ -463,11 +477,6 @@ int wc_curve25519_make_key(WC_RNG* rng, int keysize, curve25519_key* key)
ret = wc_curve25519_make_pub((int)sizeof(key->p.point), key->p.point,
(int)sizeof(key->k), key->k);
#endif
if (ret == 0) {
ret = wc_curve25519_check_public(key->p.point,
(word32)sizeof(key->p.point),
EC25519_LITTLE_ENDIAN);
}
key->pubSet = (ret == 0);
}
#endif
Expand Down