Skip to content

Commit

Permalink
mbedtls: Disable MBEDTLS_SHA256_SMALLER implementation
Browse files Browse the repository at this point in the history
Disable MBEDTLS_SHA256_SMALLER implementation, not enabled by default in
upstream and reduces performance by quite a bit.

Source: include/mbedtls/config.h

Enable an implementation of SHA-256 that has lower ROM footprint but also
lower performance.

The default implementation is meant to be a reasonnable compromise between
performance and size. This version optimizes more aggressively for size at
the expense of performance. Eg on Cortex-M4 it reduces the size of
mbedtls_sha256_process() from ~2KB to ~0.5KB for a performance hit of
about 30%.

The size of mbedtls increased a little bit:
ipkg for mips_24kc before:
164.382 Bytes
ipkg for mips_24kc after:
166.240 Bytes

Signed-off-by: Daniel Engberg <[email protected]>
  • Loading branch information
diizzyy authored and hauke committed Jul 7, 2018
1 parent 10554cf commit 5a07818
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions package/libs/mbedtls/patches/200-config.patch
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,6 @@

/**
* \def MBEDTLS_SHA256_SMALLER
@@ -1134,7 +1134,7 @@
*
* Uncomment to enable the smaller implementation of SHA256.
*/
-//#define MBEDTLS_SHA256_SMALLER
+#define MBEDTLS_SHA256_SMALLER

/**
* \def MBEDTLS_SSL_ALL_ALERT_MESSAGES
@@ -1272,7 +1272,7 @@
* configuration of this extension).
*
Expand Down

0 comments on commit 5a07818

Please sign in to comment.