Add OPENSSL_SMALL.

Intel's P-256 code has very large tables and things like Chromium just
don't need that extra size. However, servers generally do so this change
adds an OPENSSL_SMALL define that currently just drops the 64-bit P-224
but will gate Intel's P-256 in the future too.

Change-Id: I2e55c6e06327fafabef9b96d875069d95c0eea81
Reviewed-on: https://boringssl-review.googlesource.com/6362
Reviewed-by: Adam Langley <alangley@gmail.com>
This commit is contained in:
Adam Langley 2015-10-27 08:47:11 -07:00
parent 5dbdad9c33
commit 2e3c978d14
4 changed files with 9 additions and 3 deletions

View File

@ -71,6 +71,10 @@ Windows, where functions need to be tagged with `dllimport` when coming from a
shared library, define `BORINGSSL_SHARED_LIBRARY` in any code which `#include`s
the BoringSSL headers.
In order to serve environments where code-size is important as well as those
where performance is the overriding concern, `OPENSSL_SMALL` can be defined to
remove some code that is especially large.
### Building for Android
It's possible to build BoringSSL with the Android NDK using CMake. This has

View File

@ -81,6 +81,7 @@ if((CMAKE_COMPILER_IS_GNUCXX AND CMAKE_C_COMPILER_VERSION VERSION_GREATER "4.8.9
endif()
add_definitions(-DBORINGSSL_IMPLEMENTATION)
add_definitions(-DOPENSSL_SMALL)
if (BUILD_SHARED_LIBS)
add_definitions(-DBORINGSSL_SHARED_LIBRARY)

View File

@ -228,7 +228,7 @@ static const struct curve_data P521 = {
const struct built_in_curve OPENSSL_built_in_curves[] = {
{
NID_secp224r1, &P224,
#if defined(BORINGSSL_USE_INT128_CODE)
#if defined(BORINGSSL_USE_INT128_CODE) && !defined(OPENSSL_SMALL)
EC_GFp_nistp224_method,
#else
0,

View File

@ -19,7 +19,8 @@
#include <openssl/base.h>
#if defined(OPENSSL_64_BIT) && !defined(OPENSSL_WINDOWS)
#if defined(OPENSSL_64_BIT) && !defined(OPENSSL_WINDOWS) && \
!defined(OPENSSL_SMALL)
#include <openssl/bn.h>
#include <openssl/ec.h>
@ -1337,4 +1338,4 @@ const EC_METHOD *EC_GFp_nistp224_method(void) {
return &ret;
}
#endif
#endif /* 64_BIT && !WINDOWS && !SMALL */