boringssl/crypto/bn
David Benjamin 17cf2cb1d2 Work around language and compiler bug in memcpy, etc.
Most C standard library functions are undefined if passed NULL, even
when the corresponding length is zero. This gives them (and, in turn,
all functions which call them) surprising behavior on empty arrays.
Some compilers will miscompile code due to this rule. See also
https://www.imperialviolet.org/2016/06/26/nonnull.html

Add OPENSSL_memcpy, etc., wrappers which avoid this problem.

BUG=23

Change-Id: I95f42b23e92945af0e681264fffaf578e7f8465e
Reviewed-on: https://boringssl-review.googlesource.com/12928
Commit-Queue: David Benjamin <davidben@google.com>
Reviewed-by: Adam Langley <agl@google.com>
2016-12-21 20:34:47 +00:00
..
asm Remove RSAZ-512. 2016-12-14 22:12:50 +00:00
add.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
bn_asn1.c
bn_test.cc Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
bn_tests.txt Remove RSAZ-512. 2016-12-14 22:12:50 +00:00
bn.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
check_bn_tests.go
CMakeLists.txt Remove rsaz-x86_64.pl from CMake inputs. 2016-12-19 08:39:37 -08:00
cmp.c
convert.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
ctx.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
div.c Remove the non-no_branch branch of BN_div. 2016-12-17 19:11:19 +00:00
exponentiation.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
gcd.c Remove the non-no_branch branch of BN_div. 2016-12-17 19:11:19 +00:00
generic.c Fix up macros. 2016-10-18 18:28:23 +00:00
internal.h Calculate Montgomery RR without division. 2016-12-16 17:41:01 +00:00
kronecker.c Fix BN_kronecker on unreachable BN_rshift error. 2016-12-12 21:40:20 +00:00
montgomery_inv.c Calculate Montgomery RR without division. 2016-12-16 17:41:01 +00:00
montgomery.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
mul.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
prime.c Add constants for BN_rand and use them. 2016-08-18 18:18:31 +00:00
random.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
rsaz_exp.c Remove RSAZ-512. 2016-12-14 22:12:50 +00:00
rsaz_exp.h Remove RSAZ-512. 2016-12-14 22:12:50 +00:00
shift.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
sqrt.c Check for BN_lshift failure in BN_sqrt. 2016-11-29 00:55:56 +00:00