user_settings.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /* user_settings.h
  2. *
  3. * Copyright (C) 2006-2023 wolfSSL Inc.
  4. *
  5. * This file is part of wolfSSL.
  6. *
  7. * wolfSSL is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * wolfSSL is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
  20. */
  21. #ifndef USER_SETTINGS_H_
  22. #define USER_SETTINGS_H_
  23. #define FREERTOS
  24. #define NO_WOLFSSL_DIR
  25. #define WOLFSSL_NO_SOCK
  26. #define WOLFSSL_LWIP
  27. #define WOLFSSL_USER_IO
  28. #define DEBUG_WOLFSSL
  29. #define WOLFSSL_LOG_PRINTF
  30. /* macros for test suite and benchmark */
  31. //#define NO_CRYPT_TEST
  32. #ifndef NO_CRYPT_TEST
  33. #define NO_MAIN_DRIVER
  34. #include <stdio.h>
  35. #include <stdarg.h>
  36. static void myPrintf(const char* fmt, ...)
  37. {
  38. int ret;
  39. char line[150];
  40. va_list ap;
  41. va_start(ap, fmt);
  42. ret = vsnprintf(line, sizeof(line), fmt, ap);
  43. line[sizeof(line)-1] = '\0';
  44. DbgConsole_Printf("%s", line);
  45. /* add CR on newlines */
  46. if (ret > 0 && line[ret-1] == '\n') {
  47. DbgConsole_Printf("\r");
  48. }
  49. }
  50. #define XPRINTF myPrintf
  51. #define USE_CERT_BUFFERS_2048
  52. #define USE_CERT_BUFFERS_1024
  53. #define USE_CERT_BUFFERS_256
  54. #define NO_WRITE_TEMP_FILES
  55. #define BENCH_EMBEDDED
  56. /* set high for handling wolfcrypt tests */
  57. #define WOLFSSL_STATIC_MEMORY_TEST_SZ 350000
  58. #endif
  59. /* math implementation (fast math or sp math, choose one) */
  60. #define USE_FAST_MATH
  61. #ifdef USE_FAST_MATH
  62. /* big enough for even 4096 bit RSA key */
  63. #define FP_MAX_BITS 8192
  64. #define TFM_TIMING_RESISTANT
  65. #define ECC_TIMING_RESISTANT
  66. #define ALT_ECC_SIZE
  67. #endif
  68. //#define WOLFSSL_SP_MATH_ALL
  69. #ifdef WOLFSSL_SP_MATH_ALL
  70. #endif
  71. /* optimizations for common public key operations
  72. * adds a lot of code size in exchange for performance increase */
  73. #if 1
  74. #define WOLFSSL_HAVE_SP_RSA
  75. #define WOLFSSL_HAVE_SP_DH
  76. #define WOLFSSL_HAVE_SP_ECC
  77. #endif
  78. /* RT685 uses the same fsl_trng API, note that the application
  79. * needs to initialize and teardown the TRNG (TRNG_Init, TRNG_Deinit) */
  80. #define FREESCALE_KSDK_2_0_TRNG
  81. #define FREESCALE_RTC
  82. /* use loaded stack as a pool of memory for allocations rather than
  83. * using heap */
  84. #define WOLFSSL_STATIC_MEMORY
  85. #define WOLFSSL_SP_NO_MALLOC /* use no malloc version of SP if compiled in */
  86. #define WOLFSSL_NO_REALLOC
  87. /* this removes all system malloc calls, will fail on some compatibility
  88. * layer API's and others that have no heap hint */
  89. //#define WOLFSSL_NO_MALLOC
  90. #define WC_RSA_BLINDING
  91. #define HAVE_ECC
  92. #define OPENSSL_EXTRA
  93. #define OPENSSL_ALL
  94. #define NO_WOLFSSL_SERVER
  95. #define HAVE_TLS_EXTENSIONS
  96. #define WC_RSA_PSS
  97. #define WOLFSSL_KEY_GEN
  98. #define HAVE_SMIME
  99. #ifdef HAVE_SMIME
  100. #define HAVE_PKCS7
  101. #define HAVE_X963_KDF
  102. #define HAVE_AES_KEYWRAP
  103. #define WOLFSSL_AES_DIRECT
  104. #endif
  105. #endif /* USER_SETTINGS_H_ */