|
1 | | - |
2 | 1 | #define NO_MAIN_DRIVER |
3 | 2 | #define BENCH_EMBEDDED |
4 | 3 | #define NO_WRITEV |
|
17 | 16 |
|
18 | 17 | #define WOLFSSL_GENSEED_FORTEST /* Warning: define your own seed gen */ |
19 | 18 |
|
20 | | -#define TFM_TIMING_RESISTANT |
| 19 | +/* A few examples of different math options below. |
| 20 | + * |
| 21 | + * See examples/configs/user_settings_template.h for a more |
| 22 | + * detailed template. */ |
| 23 | +#if 1 |
| 24 | + /* Use only single precision (SP) math and algorithms. |
| 25 | + * SP math is written to accelerate specific/common key |
| 26 | + * sizes and curves. This adds code from sp_c32.c, or one of the specific |
| 27 | + * assembly implementations like sp_cortexm.c. This code is faster than the |
| 28 | + * multi-precision support because it's optimized for the key/curve. |
| 29 | + * The SP math can be used together with any multi-precision math library |
| 30 | + * if WOLFSSL_SP_MATH is removed. If only standard keys/curves are being |
| 31 | + * used the multi-precision math is not required. |
| 32 | + */ |
| 33 | + #define WOLFSSL_SP_MATH |
| 34 | + /* Enable SP ECC support */ |
| 35 | + #define WOLFSSL_HAVE_SP_ECC |
| 36 | + /* Enable SP RSA support */ |
| 37 | + #define WOLFSSL_HAVE_SP_RSA |
| 38 | + /* Enable SP DH support */ |
| 39 | + #define WOLFSSL_HAVE_SP_DH |
| 40 | + /* Reduce stack use specifically in SP implementation. */ |
| 41 | + #define WOLFSSL_SP_SMALL_STACK |
| 42 | + /* use smaller version of code */ |
| 43 | + #define WOLFSSL_SP_SMALL |
| 44 | + /* Assembly optimized version - sp_cortexm.c */ |
| 45 | + //#define WOLFSSL_SP_ARM_CORTEX_M_ASM |
| 46 | +#elif 1 |
| 47 | + /* Use SP math for all key sizes and curves. This will use |
| 48 | + * the multi-precision (MP) math implementation in sp_int.c */ |
| 49 | + #define WOLFSSL_SP_MATH_ALL |
| 50 | + /* Disable use of dynamic stack items */ |
| 51 | + #define WOLFSSL_SP_NO_DYN_STACK |
| 52 | + /* use smaller version of code */ |
| 53 | + #define WOLFSSL_SP_SMALL |
| 54 | +#elif 1 |
| 55 | + /* Fast Math (tfm.c) (stack based and timing resistant) */ |
| 56 | + #define USE_FAST_MATH |
| 57 | + /* Enable Fast Math Timing Resistance */ |
| 58 | + #define TFM_TIMING_RESISTANT |
| 59 | +#else |
| 60 | + /* Normal (integer.c) (heap based, not timing resistant) - not recommended*/ |
| 61 | + #define USE_INTEGER_HEAP_MATH |
| 62 | +#endif |
| 63 | + |
| 64 | +/* Enable ECC Timing Resistance */ |
21 | 65 | #define ECC_TIMING_RESISTANT |
| 66 | +/* Enables blinding mode, to prevent timing attacks */ |
22 | 67 | #define WC_RSA_BLINDING |
23 | 68 |
|
| 69 | +/* reduce stack use. For variables over 100 bytes allocate from heap */ |
| 70 | +#define WOLFSSL_SMALL_STACK |
| 71 | +/* disable mutex locking */ |
24 | 72 | #define SINGLE_THREADED /* or define RTOS option */ |
25 | 73 | /* #define WOLFSSL_CMSIS_RTOS */ |
26 | 74 | #define NO_FILESYSTEM |
|
0 commit comments