mycrypt_custom.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. #ifdef CRYPT
  7. #error mycrypt_custom.h should be included before mycrypt.h
  8. #endif
  9. /* macros for various libc functions you can change for embedded targets */
  10. #define XMALLOC malloc
  11. #define XREALLOC realloc
  12. #define XCALLOC calloc
  13. #define XFREE free
  14. #define XMEMSET memset
  15. #define XMEMCPY memcpy
  16. #define XCLOCK clock
  17. #define XCLOCKS_PER_SEC CLOCKS_PER_SEC
  18. /* Use small code where possible */
  19. #define SMALL_CODE
  20. /* Enable self-test test vector checking */
  21. #define LTC_TEST
  22. /* clean the stack of functions which put private information on stack */
  23. //#define CLEAN_STACK
  24. /* disable all file related functions */
  25. //#define NO_FILE
  26. /* various ciphers */
  27. #define BLOWFISH
  28. #define RC2
  29. #define RC5
  30. #define RC6
  31. #define SAFERP
  32. #define RIJNDAEL
  33. #define XTEA
  34. #define TWOFISH
  35. #define TWOFISH_TABLES
  36. //#define TWOFISH_ALL_TABLES
  37. //#define TWOFISH_SMALL
  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. /* modes of operation */
  47. #define CFB
  48. #define OFB
  49. #define ECB
  50. #define CBC
  51. #define CTR
  52. /* hash functions */
  53. #define WHIRLPOOL
  54. #define SHA512
  55. #define SHA384
  56. #define SHA256
  57. #define SHA224
  58. #define TIGER
  59. #define SHA1
  60. #define MD5
  61. #define MD4
  62. #define MD2
  63. #define RIPEMD128
  64. #define RIPEMD160
  65. /* MAC functions */
  66. #define HMAC
  67. #define OMAC
  68. #define PMAC
  69. /* Encrypt + Authenticate Modes */
  70. #define EAX_MODE
  71. #define OCB_MODE
  72. /* Various tidbits of modern neatoness */
  73. #define BASE64
  74. #define YARROW
  75. // which descriptor of AES to use?
  76. // 0 = rijndael_enc 1 = aes_enc, 2 = rijndael [full], 3 = aes [full]
  77. #define YARROW_AES 0
  78. #define SPRNG
  79. #define RC4
  80. #define DEVRANDOM
  81. #define TRY_URANDOM_FIRST
  82. /* Public Key Neatoness */
  83. #define MRSA
  84. /* enable RSA side channel timing prevention */
  85. #define RSA_TIMING
  86. /* Digital Signature Algorithm */
  87. #define MDSA
  88. /* Max diff between group and modulus size in bytes */
  89. #define MDSA_DELTA 512
  90. /* Max DSA group size in bytes (default allows 4k-bit groups) */
  91. #define MDSA_MAX_GROUP 512
  92. /* Diffie-Hellman */
  93. #define MDH
  94. /* Supported Key Sizes */
  95. #define DH768
  96. #define DH1024
  97. #define DH1280
  98. #define DH1536
  99. #define DH1792
  100. #define DH2048
  101. #define DH2560
  102. #define DH3072
  103. #define DH4096
  104. /* ECC */
  105. #define MECC
  106. /* Supported Key Sizes */
  107. #define ECC160
  108. #define ECC192
  109. #define ECC224
  110. #define ECC256
  111. #define ECC384
  112. #define ECC521
  113. /* Include the MPI functionality? (required by the PK algorithms) */
  114. #define MPI
  115. /* PKCS #1 and #5 stuff */
  116. #define PKCS_1
  117. #define PKCS_5
  118. #include <mycrypt.h>
  119. #endif