diff --git a/BUILDING.md b/BUILDING.md index 46f27e3f..19dbe015 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -150,7 +150,14 @@ corresponding ARM feature. Note that if a feature is enabled in this way, but not actually supported at run-time, BoringSSL will likely crash. -# Running tests +## Binary Size + +The implementations of some algorithms require a trade-off between binary size +and performance. For instance, BoringSSL's fastest P-256 implementation uses a +148 KiB pre-computed table. To optimize instead for binary size, pass +`-DOPENSSL_SMALL=1` to CMake or define the `OPENSSL_SMALL` preprocessor symbol. + +# Running Tests There are two sets of tests: the C/C++ tests and the blackbox tests. For former are built by Ninja and can be run from the top-level directory with `go run diff --git a/CMakeLists.txt b/CMakeLists.txt index 4445b557..97ea2896 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -279,6 +279,10 @@ if(FIPS) endif() endif() +if(OPENSSL_SMALL) + add_definitions(-DOPENSSL_SMALL) +endif() + # CMake's iOS support uses Apple's multiple-architecture toolchain. It takes an # architecture list from CMAKE_OSX_ARCHITECTURES, leaves CMAKE_SYSTEM_PROCESSOR # alone, and expects all architecture-specific logic to be conditioned within