Merge pull request #7169 from AndrzejKurek/mpi-window-size
Reduce the default MBEDTLS_ECP_WINDOW_SIZE value from 6 to 2
This commit is contained in:
commit
dd4427cc5b
3 changed files with 10 additions and 3 deletions
7
ChangeLog.d/mpi-window-perf
Normal file
7
ChangeLog.d/mpi-window-perf
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
Changes
|
||||||
|
* Changed the default MBEDTLS_ECP_WINDOW_SIZE from 6 to 2.
|
||||||
|
As tested in issue 6790, the correlation between this define and
|
||||||
|
RSA decryption performance has changed lately due to security fixes.
|
||||||
|
To fix the performance degradation when using default values the
|
||||||
|
window was reduced from 6 to 2, a value that gives the best or close
|
||||||
|
to best results when tested on Cortex-M4 and Intel i7.
|
|
@ -63,7 +63,7 @@
|
||||||
|
|
||||||
#if !defined(MBEDTLS_MPI_WINDOW_SIZE)
|
#if !defined(MBEDTLS_MPI_WINDOW_SIZE)
|
||||||
/*
|
/*
|
||||||
* Maximum window size used for modular exponentiation. Default: 6
|
* Maximum window size used for modular exponentiation. Default: 2
|
||||||
* Minimum value: 1. Maximum value: 6.
|
* Minimum value: 1. Maximum value: 6.
|
||||||
*
|
*
|
||||||
* Result is an array of ( 2 ** MBEDTLS_MPI_WINDOW_SIZE ) MPIs used
|
* Result is an array of ( 2 ** MBEDTLS_MPI_WINDOW_SIZE ) MPIs used
|
||||||
|
@ -71,7 +71,7 @@
|
||||||
*
|
*
|
||||||
* Reduction in size, reduces speed.
|
* Reduction in size, reduces speed.
|
||||||
*/
|
*/
|
||||||
#define MBEDTLS_MPI_WINDOW_SIZE 6 /**< Maximum window size used. */
|
#define MBEDTLS_MPI_WINDOW_SIZE 2 /**< Maximum window size used. */
|
||||||
#endif /* !MBEDTLS_MPI_WINDOW_SIZE */
|
#endif /* !MBEDTLS_MPI_WINDOW_SIZE */
|
||||||
|
|
||||||
#if !defined(MBEDTLS_MPI_MAX_SIZE)
|
#if !defined(MBEDTLS_MPI_MAX_SIZE)
|
||||||
|
|
|
@ -3559,7 +3559,7 @@
|
||||||
* comment in the specific module. */
|
* comment in the specific module. */
|
||||||
|
|
||||||
/* MPI / BIGNUM options */
|
/* MPI / BIGNUM options */
|
||||||
//#define MBEDTLS_MPI_WINDOW_SIZE 6 /**< Maximum window size used. */
|
//#define MBEDTLS_MPI_WINDOW_SIZE 2 /**< Maximum window size used. */
|
||||||
//#define MBEDTLS_MPI_MAX_SIZE 1024 /**< Maximum number of bytes for usable MPIs. */
|
//#define MBEDTLS_MPI_MAX_SIZE 1024 /**< Maximum number of bytes for usable MPIs. */
|
||||||
|
|
||||||
/* CTR_DRBG options */
|
/* CTR_DRBG options */
|
||||||
|
|
Loading…
Reference in a new issue