user_settings.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /* user_settings.h
  2. *
  3. * Copyright (C) 2006-2020 wolfSSL Inc.
  4. *
  5. * This file is part of wolfSSL. (formerly known as CyaSSL)
  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-1301, USA
  20. */
  21. /* Example 'user_settings.h' for IoT-Safe demo */
  22. #ifndef IOTSAFE_EXAMPLE_USER_SETTINGS_H
  23. #define IOTSAFE_EXAMPLE_USER_SETTINGS_H
  24. #include <stdint.h>
  25. /* Platform */
  26. #define WOLFSSL_IOTSAFE
  27. #define WOLFSSL_SMALL_STACK
  28. #define WOLFSSL_GENERAL_ALIGNMENT 4
  29. #define SINGLE_THREADED
  30. #define WOLFSSL_USER_IO
  31. /* Debugging */
  32. #define WOLFSSL_LOG_PRINTF
  33. #if 0
  34. #define DEBUG_WOLFSSL
  35. #define WOLFSSL_DEBUG_TLS
  36. #define DEBUG_IOTSAFE
  37. #endif
  38. /* Features */
  39. #define HAVE_PK_CALLBACKS /* Connect IoT-safe with PK_CALLBACKS */
  40. #define SMALL_SESSION_CACHE
  41. #define USE_CERT_BUFFERS_256
  42. /* RNG */
  43. #define HAVE_IOTSAFE_HWRNG
  44. #define HAVE_HASHDRBG
  45. #define NO_OLD_RNGNAME
  46. /* Time porting */
  47. #define TIME_OVERRIDES
  48. extern volatile unsigned long jiffies;
  49. static inline long XTIME(long *x) { return jiffies;}
  50. #define WOLFSSL_USER_CURRTIME
  51. #define NO_ASN_TIME
  52. /* Math */
  53. #define TFM_TIMING_RESISTANT
  54. #define TFM_ARM
  55. #define WOLFSSL_SP_MATH
  56. #define WOLFSSL_SP_MATH_ALL
  57. #define WOLFSSL_SP_SMALL
  58. #define WOLFSSL_HAVE_SP_DH
  59. #define WOLFSSL_HAVE_SP_ECC
  60. #define SP_WORD_SIZE 32
  61. /* ECC */
  62. #define HAVE_ECC
  63. #define ECC_ALT_SIZE
  64. #define ECC_TIMING_RESISTANT
  65. /* RSA */
  66. #define RSA_LOW_MEM
  67. #define WC_RSA_BLINDING
  68. #define WC_RSA_PSS
  69. /* DH - on by default */
  70. #define WOLFSSL_DH_CONST
  71. #define HAVE_FFDHE_2048
  72. /* AES */
  73. #define HAVE_AES_DECRYPT
  74. #define HAVE_AESGCM
  75. #define GCM_SMALL
  76. #define HAVE_AESCCM
  77. #define WOLFSSL_AES_COUNTER
  78. #define WOLFSSL_AES_DIRECT
  79. /* Hashing */
  80. #define HAVE_SHA384
  81. #define HAVE_SHA512
  82. #define HAVE_HKDF
  83. /* TLS */
  84. #if 0
  85. /* TLS v1.3 only */
  86. #define WOLFSSL_TLS13
  87. #define WOLFSSL_NO_TLS12
  88. #else
  89. /* TLS v1.2 only */
  90. #endif
  91. #define NO_OLD_TLS
  92. #define HAVE_TLS_EXTENSIONS
  93. #define HAVE_SUPPORTED_CURVES
  94. /* Disable Features */
  95. #define NO_WRITEV
  96. #define NO_FILESYSTEM
  97. #define NO_MAIN_DRIVER
  98. //#define NO_ERROR_STRINGS
  99. /* Disable Algorithms */
  100. #define NO_DES3
  101. #define NO_DSA
  102. #define NO_RC4
  103. #define NO_MD4
  104. #define NO_MD5
  105. #define NO_SHA
  106. #define NO_HC128
  107. #define NO_RABBIT
  108. #define NO_PKCS12
  109. /* helpers */
  110. #define htons(x) __builtin_bswap16(x)
  111. #define ntohs(x) __builtin_bswap16(x)
  112. #define ntohl(x) __builtin_bswap32(x)
  113. #define htonl(x) __builtin_bswap32(x)
  114. #endif /* !IOTSAFE_EXAMPLE_USER_SETTINGS_H */