dc55e4f70f
felem_neg does not produce an output within the tight bounds suitable for felem_contract. This affects build configurations which set enable-ec_nistp_64_gcc_128. point_double and point_add, in the non-z*_is_zero cases, tolerate and fix up the wider bounds, so this only affects point_add calls where the other point is infinity. Thus it only affects the final addition in arbitrary-point multiplication, giving the wrong y-coordinate. This is a no-op for ECDH and ECDSA, which only use the x-coordinate of arbitrary-point operations. Note: ecp_nistp521.c has the same issue in that the documented preconditions are violated by the test case. I have not addressed this in this PR. ecp_nistp521.c does not immediately produce the wrong answer; felem_contract there appears to be a bit more tolerant than its documented preconditions. However, I haven't checked the point_add property above holds. ecp_nistp521.c should either get this same fix, to be conservative, or have the bounds analysis and comments reworked for the wider bounds. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5779) |
||
---|---|---|
.. | ||
asm | ||
curve448 | ||
build.info | ||
curve25519.c | ||
ec2_mult.c | ||
ec2_oct.c | ||
ec2_smpl.c | ||
ec_ameth.c | ||
ec_asn1.c | ||
ec_check.c | ||
ec_curve.c | ||
ec_cvt.c | ||
ec_err.c | ||
ec_key.c | ||
ec_kmeth.c | ||
ec_lcl.h | ||
ec_lib.c | ||
ec_mult.c | ||
ec_oct.c | ||
ec_pmeth.c | ||
ec_print.c | ||
ecdh_kdf.c | ||
ecdh_ossl.c | ||
ecdsa_ossl.c | ||
ecdsa_sign.c | ||
ecdsa_vrf.c | ||
eck_prn.c | ||
ecp_mont.c | ||
ecp_nist.c | ||
ecp_nistp224.c | ||
ecp_nistp256.c | ||
ecp_nistp521.c | ||
ecp_nistputil.c | ||
ecp_nistz256.c | ||
ecp_nistz256_table.c | ||
ecp_oct.c | ||
ecp_smpl.c | ||
ecx_meth.c |