mycrypt_custom.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. /* This header is meant to be included before mycrypt.h in projects where
  2. * you don't want to throw all the defines in a makefile.
  3. */
  4. #ifndef MYCRYPT_CUSTOM_H_
  5. #define MYCRYPT_CUSTOM_H_
  6. /* macros for various libc functions you can change for embedded targets */
  7. #define XMALLOC malloc
  8. #define XREALLOC realloc
  9. #define XCALLOC calloc
  10. #define XFREE free
  11. #define XMEMSET memset
  12. #define XMEMCPY memcpy
  13. #define XCLOCK clock
  14. #define XCLOCKS_PER_SEC CLOCKS_PER_SEC
  15. /* Use small code where possible */
  16. #define SMALL_CODE
  17. /* Enable self-test test vector checking */
  18. #define LTC_TEST
  19. /* clean the stack of functions which put private information on stack */
  20. // #define CLEAN_STACK
  21. /* disable all file related functions */
  22. //#define NO_FILE
  23. /* various ciphers */
  24. #define BLOWFISH
  25. #define RC2
  26. #define RC5
  27. #define RC6
  28. #define SAFERP
  29. #define RIJNDAEL
  30. #define XTEA
  31. #define TWOFISH
  32. #define TWOFISH_TABLES
  33. // #define TWOFISH_ALL_TABLES
  34. // #define TWOFISH_SMALL
  35. #define DES
  36. #define CAST5
  37. #define NOEKEON
  38. #define SKIPJACK
  39. /* SAFER code isn't public domain. It appears to be free to use
  40. * but has been disabled by default to avoid any such problems
  41. */
  42. //#define SAFER
  43. /* modes of operation */
  44. #define CFB
  45. #define OFB
  46. #define ECB
  47. #define CBC
  48. #define CTR
  49. /* hash functions */
  50. #define WHIRLPOOL
  51. #define SHA512
  52. #define SHA384
  53. #define SHA256
  54. #define SHA224
  55. #define TIGER
  56. #define SHA1
  57. #define MD5
  58. #define MD4
  59. #define MD2
  60. #define RIPEMD128
  61. #define RIPEMD160
  62. /* MAC functions */
  63. #define HMAC
  64. #define OMAC
  65. #define PMAC
  66. /* Encrypt + Authenticate Modes */
  67. #define EAX_MODE
  68. #define OCB_MODE
  69. /* Various tidbits of modern neatoness */
  70. #define BASE64
  71. /* Yarrow */
  72. #define YARROW
  73. // which descriptor of AES to use?
  74. // 0 = rijndael_enc 1 = aes_enc, 2 = rijndael [full], 3 = aes [full]
  75. #define YARROW_AES 0
  76. #if defined(YARROW) && !defined(CTR)
  77. #error YARROW requires CTR chaining mode to be defined!
  78. #endif
  79. #define SPRNG
  80. #define RC4
  81. /* Fortuna PRNG */
  82. #define FORTUNA
  83. /* reseed every N calls to the read function */
  84. #define FORTUNA_WD 10
  85. /* number of pools (4..32) can save a bit of ram by lowering the count */
  86. #define FORTUNA_POOLS 32
  87. /* Greg's SOBER128 PRNG ;-0 */
  88. #define SOBER128
  89. #define DEVRANDOM
  90. #define TRY_URANDOM_FIRST
  91. /* Public Key Neatoness */
  92. #define MRSA
  93. /* enable RSA side channel timing prevention */
  94. #define RSA_TIMING
  95. /* Digital Signature Algorithm */
  96. #define MDSA
  97. /* Max diff between group and modulus size in bytes */
  98. #define MDSA_DELTA 512
  99. /* Max DSA group size in bytes (default allows 4k-bit groups) */
  100. #define MDSA_MAX_GROUP 512
  101. /* Diffie-Hellman */
  102. #define MDH
  103. /* Supported Key Sizes */
  104. #define DH768
  105. #define DH1024
  106. #define DH1280
  107. #define DH1536
  108. #define DH1792
  109. #define DH2048
  110. #define DH2560
  111. #define DH3072
  112. #define DH4096
  113. /* ECC */
  114. #define MECC
  115. /* Supported Key Sizes */
  116. #define ECC160
  117. #define ECC192
  118. #define ECC224
  119. #define ECC256
  120. #define ECC384
  121. #define ECC521
  122. /* Include the MPI functionality? (required by the PK algorithms) */
  123. #define MPI
  124. /* Use SSE2 optimizations in LTM? Requires GCC or ICC and a P4 or K8 processor */
  125. // #define LTMSSE
  126. /* prevents the code from being "unportable" at least to non i386 platforms */
  127. #if defined(LTMSSE) && !( (defined(__GNUC__) && defined(__i386__)) || defined(INTEL_CC))
  128. #warning LTMSSE is only available for GNU CC (i386) or Intel CC
  129. #undef LTMSSE
  130. #endif
  131. /* PKCS #1 and #5 stuff */
  132. #define PKCS_1
  133. #define PKCS_5
  134. #endif