boringssl/util
David Benjamin 0a211dfe91 Remove BN_FLG_CONSTTIME.
BN_FLG_CONSTTIME is a ridiculous API and easy to mess up
(CVE-2016-2178). Instead, code that needs a particular algorithm which
preserves secrecy of some arguemnt should call into that algorithm
directly.

This is never set outside the library and is finally unused within the
library! Credit for all this goes almost entirely to Brian Smith. I just
took care of the last bits.

Note there was one BN_FLG_CONSTTIME check that was still reachable, the
BN_mod_inverse in RSA key generation. However, it used the same code in
both cases for even moduli and φ(n) is even if n is not a power of two.
Traditionally, RSA keys are not powers of two, even though it would make
the modular reductions a lot easier.

When reviewing, check that I didn't remove a BN_FLG_CONSTTIME that led
to a BN_mod_exp(_mont) or BN_mod_inverse call (with the exception of the
RSA one mentioned above). They should all go to functions for the
algorithms themselves like BN_mod_exp_mont_consttime.

This CL shows the checks are a no-op for all our tests:
https://boringssl-review.googlesource.com/c/12927/

BUG=125

Change-Id: I19cbb375cc75aac202bd76b51ca098841d84f337
Reviewed-on: https://boringssl-review.googlesource.com/12926
Reviewed-by: Adam Langley <alangley@gmail.com>
2017-01-12 02:00:44 +00:00
..
bot Don't extract archives if unchanged. 2016-12-02 18:36:32 +00:00
32-bit-toolchain.cmake
all_tests.go Improve -valgrind error-handling. 2016-09-21 17:25:32 +00:00
all_tests.json Remove New Hope key agreement. 2016-12-10 01:06:31 +00:00
BUILD.toplevel Replace Scoped* heap types with bssl::UniquePtr. 2016-09-01 22:22:54 +00:00
diff_asm.go Add a tool to diff assembly files against OpenSSL. 2016-06-27 21:48:50 +00:00
doc.config Remove New Hope key agreement. 2016-12-10 01:06:31 +00:00
doc.css Link back to the main page in documentation. 2016-05-20 15:36:00 +00:00
doc.go Remove BN_FLG_CONSTTIME. 2017-01-12 02:00:44 +00:00
generate_build_files.py Define BORINGSSL_SHARED_LIBRARY when building tests with Bazel. 2016-11-17 20:49:27 +00:00
generate-asm-lcov.py Fixing assembly coverage 2016-03-23 18:23:42 +00:00
generate-coverage.sh Add a GCOV option to CMakeLists.txt. 2017-01-03 13:17:57 +00:00
make_errors.go Fix mixed comment markers. 2016-08-01 14:52:39 +00:00
run_android_tests.go Fix Android bots. 2016-11-15 01:45:19 +00:00