openssl/crypto/ec
David Benjamin dc55e4f70f Fix a bug in ecp_nistp224.c.
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)
2018-04-03 16:09:20 -04:00
..
asm ec/asm/x25519-x86_64.pl: remove redundant carry chain. 2018-03-01 13:59:28 +01:00
curve448 curve448/field.h: relax alignment, as it doesn't work universally. 2018-03-22 11:50:44 +01:00
build.info Add x25519-x86_64.pl module, mod 2^255-19 primitives. 2018-02-21 10:13:59 +01:00
curve25519.c ec/curve25519.c: resolve regression with Android NDK's arm64 gcc. 2018-03-13 19:31:53 +01:00
ec2_mult.c Modify Sun copyright to follow OpenSSL style 2017-06-20 11:13:45 -04:00
ec2_oct.c Modify Sun copyright to follow OpenSSL style 2017-06-20 11:13:45 -04:00
ec2_smpl.c Address some code-analysis issues. 2017-12-08 10:49:41 -05:00
ec_ameth.c Support public key and param check in EVP interface 2017-11-20 07:20:30 +01:00
ec_asn1.c Copyright update of more files that have changed this year 2018-01-19 13:34:03 +01:00
ec_check.c Copyright consolidation 06/10 2016-05-17 14:51:04 -04:00
ec_curve.c Update copyright year 2018-03-20 13:08:46 +00:00
ec_cvt.c Modify Sun copyright to follow OpenSSL style 2017-06-20 11:13:45 -04:00
ec_err.c Set error code on alloc failures 2018-04-03 11:31:16 -04:00
ec_key.c Set error code on alloc failures 2018-04-03 11:31:16 -04:00
ec_kmeth.c Fix const correctness of EC_KEY_METHOD_get_* 2017-07-23 11:34:11 +02:00
ec_lcl.h Integrate X448 and Ed448 into libcrypto 2018-03-02 10:14:31 +00:00
ec_lib.c Set error code on alloc failures 2018-04-03 11:31:16 -04:00
ec_mult.c Consistent formatting for sizeof(foo) 2017-12-07 19:11:49 -05:00
ec_oct.c Set error code on alloc failures 2018-04-03 11:31:16 -04:00
ec_pmeth.c Set error code on alloc failures 2018-04-03 11:31:16 -04:00
ec_print.c Set error code on alloc failures 2018-04-03 11:31:16 -04:00
ecdh_kdf.c check return values for EVP_Digest*() APIs 2016-07-15 14:09:05 +01:00
ecdh_ossl.c Update copyright year 2018-04-03 13:57:12 +01:00
ecdsa_ossl.c Update copyright years on all files merged since Jan 1st 2018 2018-01-09 05:49:01 +01:00
ecdsa_sign.c Useless includes 2016-06-18 16:30:24 -04:00
ecdsa_vrf.c Useless includes 2016-06-18 16:30:24 -04:00
eck_prn.c Remove parentheses of return. 2017-10-18 16:05:06 +01:00
ecp_mont.c Modify Sun copyright to follow OpenSSL style 2017-06-20 11:13:45 -04:00
ecp_nist.c Modify Sun copyright to follow OpenSSL style 2017-06-20 11:13:45 -04:00
ecp_nistp224.c Fix a bug in ecp_nistp224.c. 2018-04-03 16:09:20 -04:00
ecp_nistp256.c Update copyright year 2018-02-27 13:59:42 +00:00
ecp_nistp521.c Update copyright year 2018-02-27 13:59:42 +00:00
ecp_nistputil.c Copyright consolidation 06/10 2016-05-17 14:51:04 -04:00
ecp_nistz256.c Fix --strict-warnings with C90 2018-01-09 10:46:44 -05:00
ecp_nistz256_table.c Copyright consolidation 05/10 2016-05-17 15:38:09 -04:00
ecp_oct.c Many spelling fixes/typo's corrected. 2017-11-11 19:03:10 -05:00
ecp_smpl.c Consistent formatting for sizeof(foo) 2017-12-07 19:11:49 -05:00
ecx_meth.c Update copyright year 2018-03-20 13:08:46 +00:00