summaryrefslogtreecommitdiffstats
path: root/crypto/include/internal/bn_int.h
AgeCommit message (Collapse)Author
2018-07-22bn/bn_intern.c: const-ify bn_set_{static}_words.Andy Polyakov
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6738)
2018-07-18ec/ecdsa_ossl.c: revert blinding in ECDSA signature.Andy Polyakov
Originally suggested solution for "Return Of the Hidden Number Problem" is arguably too expensive. While it has marginal impact on slower curves, none to ~6%, optimized implementations suffer real penalties. Most notably sign with P-256 went more than 2 times[!] slower. Instead, just implement constant-time BN_mod_add_quick. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: David Benjamin <davidben@google.com> (Merged from https://github.com/openssl/openssl/pull/6664)
2018-07-12bn/bn_{mont|exp}.c: switch to zero-padded intermediate vectors.Andy Polyakov
Note that exported functions maintain original behaviour, so that external callers won't observe difference. While internally we can now perform Montogomery multiplication on fixed-length vectors, fixed at modulus size. The new functions, bn_to_mont_fixed_top and bn_mul_mont_fixed_top, are declared in bn_int.h, because one can use them even outside bn, e.g. in RSA, DSA, ECDSA... Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: David Benjamin <davidben@google.com> (Merged from https://github.com/openssl/openssl/pull/6662)
2018-06-22Remove __cplusplus preamble from internal headersNicola Tuveri
These headers are internal and never exposed to a cpp compiler, hence no need for the preamble. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/6554)
2017-02-28Remove dead code in bnMatt Caswell
There are a number of symbols in bn which are internal only and never used by anything. They should be removed. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2766)
2016-05-17Copyright consolidation 05/10Rich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-29Fix BN_hex2bn/BN_dec2bn NULL ptr/heap corruptionMatt Caswell
In the BN_hex2bn function the number of hex digits is calculated using an int value |i|. Later |bn_expand| is called with a value of |i * 4|. For large values of |i| this can result in |bn_expand| not allocating any memory because |i * 4| is negative. This leaves ret->d as NULL leading to a subsequent NULL ptr deref. For very large values of |i|, the calculation |i * 4| could be a positive value smaller than |i|. In this case memory is allocated to ret->d, but it is insufficiently sized leading to heap corruption. A similar issue exists in BN_dec2bn. This could have security consequences if BN_hex2bn/BN_dec2bn is ever called by user applications with very large untrusted hex/dec data. This is anticipated to be a rare occurrence. All OpenSSL internal usage of this function uses data that is not expected to be untrusted, e.g. config file data or application command line arguments. If user developed applications generate config file data based on untrusted data then it is possible that this could also lead to security consequences. This is also anticipated to be a rare. Issue reported by Guido Vranken. CVE-2016-0797 Reviewed-by: Andy Polyakov <appro@openssl.org>
2015-04-27Error checking and memory leak fixes in NISTZ256.Emilia Kasper
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-01-22Run util/openssl-format-source -v -c .Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2014-12-08Move bn internal functions into bn_int.h and bn_lcl.hMatt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2014-12-08Prepare for bn opaquify. Implement internal helper functions.Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>