mycrypt_custom.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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. /* _TABLES tells it to use tables during setup, _SMALL means to use the smaller scheduled key format
  32. * (saves 4KB of ram), _ALL_TABLES enables all tables during setup */
  33. #define TWOFISH
  34. #define TWOFISH_TABLES
  35. // #define TWOFISH_ALL_TABLES
  36. // #define TWOFISH_SMALL
  37. /* DES includes EDE triple-DES */
  38. #define DES
  39. #define CAST5
  40. #define NOEKEON
  41. #define SKIPJACK
  42. /* SAFER code isn't public domain. It appears to be free to use
  43. * but has been disabled by default to avoid any such problems
  44. */
  45. //#define SAFER
  46. /* block cipher modes of operation */
  47. #define CFB
  48. #define OFB
  49. #define ECB
  50. #define CBC
  51. #define CTR
  52. /* hash functions */
  53. #define CHC_HASH
  54. #define WHIRLPOOL
  55. #define SHA512
  56. #define SHA384
  57. #define SHA256
  58. #define SHA224
  59. #define TIGER
  60. #define SHA1
  61. #define MD5
  62. #define MD4
  63. #define MD2
  64. #define RIPEMD128
  65. #define RIPEMD160
  66. /* MAC functions */
  67. #define HMAC
  68. #define OMAC
  69. #define PMAC
  70. /* Encrypt + Authenticate Modes */
  71. #define EAX_MODE
  72. #define OCB_MODE
  73. /* Various tidbits of modern neatoness */
  74. #define BASE64
  75. /* Yarrow */
  76. #define YARROW
  77. // which descriptor of AES to use?
  78. // 0 = rijndael_enc 1 = aes_enc, 2 = rijndael [full], 3 = aes [full]
  79. #define YARROW_AES 0
  80. #if defined(YARROW) && !defined(CTR)
  81. #error YARROW requires CTR chaining mode to be defined!
  82. #endif
  83. #define SPRNG
  84. #define RC4
  85. /* Fortuna PRNG */
  86. #define FORTUNA
  87. /* reseed every N calls to the read function */
  88. #define FORTUNA_WD 10
  89. /* number of pools (4..32) can save a bit of ram by lowering the count */
  90. #define FORTUNA_POOLS 32
  91. /* Greg's SOBER128 PRNG ;-0 */
  92. #define SOBER128
  93. #define DEVRANDOM
  94. #define TRY_URANDOM_FIRST
  95. /* Public Key Neatoness */
  96. #define MRSA
  97. /* enable RSA side channel timing prevention */
  98. #define RSA_TIMING
  99. /* Digital Signature Algorithm */
  100. #define MDSA
  101. /* Max diff between group and modulus size in bytes */
  102. #define MDSA_DELTA 512
  103. /* Max DSA group size in bytes (default allows 4k-bit groups) */
  104. #define MDSA_MAX_GROUP 512
  105. /* Diffie-Hellman */
  106. #define MDH
  107. /* Supported Key Sizes */
  108. #define DH768
  109. #define DH1024
  110. #define DH1280
  111. #define DH1536
  112. #define DH1792
  113. #define DH2048
  114. #define DH2560
  115. #define DH3072
  116. #define DH4096
  117. /* ECC */
  118. #define MECC
  119. /* Supported Key Sizes */
  120. #define ECC160
  121. #define ECC192
  122. #define ECC224
  123. #define ECC256
  124. #define ECC384
  125. #define ECC521
  126. /* Include the MPI functionality? (required by the PK algorithms) */
  127. #define MPI
  128. /* PKCS #1 (RSA) and #5 (Password Handling) stuff */
  129. #define PKCS_1
  130. #define PKCS_5
  131. #endif