| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
#ifndef TOMCRYPT_CFG_H |
| 8 |
#define TOMCRYPT_CFG_H |
| 9 |
|
| 10 |
#if defined(_WIN32) || defined(_MSC_VER) |
| 11 |
#define LTC_CALL __cdecl |
| 12 |
#else |
| 13 |
#ifndef LTC_CALL |
| 14 |
#define LTC_CALL |
| 15 |
#endif |
| 16 |
#endif |
| 17 |
|
| 18 |
#ifndef LTC_EXPORT |
| 19 |
#define LTC_EXPORT |
| 20 |
#endif |
| 21 |
|
| 22 |
|
| 23 |
#ifndef LTC_NO_PROTOTYPES |
| 24 |
|
| 25 |
|
| 26 |
LTC_EXPORT void * LTC_CALL XMALLOC(size_t n); |
| 27 |
LTC_EXPORT void * LTC_CALL XREALLOC(void *p, size_t n); |
| 28 |
LTC_EXPORT void * LTC_CALL XCALLOC(size_t n, size_t s); |
| 29 |
LTC_EXPORT void LTC_CALL XFREE(void *p); |
| 30 |
|
| 31 |
LTC_EXPORT void LTC_CALL XQSORT(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *)); |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
LTC_EXPORT void * LTC_CALL XMEMCPY(void *dest, const void *src, size_t n); |
| 39 |
LTC_EXPORT int LTC_CALL XMEMCMP(const void *s1, const void *s2, size_t n); |
| 40 |
LTC_EXPORT void * LTC_CALL XMEMSET(void *s, int c, size_t n); |
| 41 |
|
| 42 |
LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2); |
| 43 |
|
| 44 |
#endif |
| 45 |
|
| 46 |
|
| 47 |
#ifndef ARGTYPE |
| 48 |
#define ARGTYPE 0 |
| 49 |
#endif |
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
#if !defined(__STRICT_ANSI__) && (defined(INTEL_CC) || (defined(_MSC_VER) && defined(WIN32)) || (defined(__GNUC__) && (defined(__DJGPP__) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__i386__)))) |
| 60 |
#define ENDIAN_LITTLE |
| 61 |
#define ENDIAN_32BITWORD |
| 62 |
#define LTC_FAST |
| 63 |
#define LTC_FAST_TYPE unsigned long |
| 64 |
#endif |
| 65 |
|
| 66 |
|
| 67 |
#if (defined(__R5900) || defined(R5900) || defined(__R5900__)) && (defined(_mips) || defined(__mips__) || defined(mips)) |
| 68 |
#define ENDIAN_LITTLE |
| 69 |
#define ENDIAN_64BITWORD |
| 70 |
#endif |
| 71 |
|
| 72 |
|
| 73 |
#if !defined(__STRICT_ANSI__) && defined(__x86_64__) |
| 74 |
#define ENDIAN_LITTLE |
| 75 |
#define ENDIAN_64BITWORD |
| 76 |
#define LTC_FAST |
| 77 |
#define LTC_FAST_TYPE unsigned long |
| 78 |
#endif |
| 79 |
|
| 80 |
|
| 81 |
#if !defined(__STRICT_ANSI__) && defined(LTC_PPC32) |
| 82 |
#define ENDIAN_BIG |
| 83 |
#define ENDIAN_32BITWORD |
| 84 |
#define LTC_FAST |
| 85 |
#define LTC_FAST_TYPE unsigned long |
| 86 |
#endif |
| 87 |
|
| 88 |
|
| 89 |
#if defined(__sparc__) |
| 90 |
#define ENDIAN_BIG |
| 91 |
#if defined(__arch64__) |
| 92 |
#define ENDIAN_64BITWORD |
| 93 |
#else |
| 94 |
#define ENDIAN_32BITWORD |
| 95 |
#endif |
| 96 |
#endif |
| 97 |
|
| 98 |
|
| 99 |
#ifdef LTC_NO_FAST |
| 100 |
#ifdef LTC_FAST |
| 101 |
#undef LTC_FAST |
| 102 |
#endif |
| 103 |
#endif |
| 104 |
|
| 105 |
|
| 106 |
#ifdef LTC_NO_ASM |
| 107 |
#undef ENDIAN_LITTLE |
| 108 |
#undef ENDIAN_BIG |
| 109 |
#undef ENDIAN_32BITWORD |
| 110 |
#undef ENDIAN_64BITWORD |
| 111 |
#undef LTC_FAST |
| 112 |
#undef LTC_FAST_TYPE |
| 113 |
#define LTC_NO_ROLC |
| 114 |
#define LTC_NO_BSWAP |
| 115 |
#endif |
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
#if (defined(ENDIAN_BIG) || defined(ENDIAN_LITTLE)) && !(defined(ENDIAN_32BITWORD) || defined(ENDIAN_64BITWORD)) |
| 124 |
#error You must specify a word size as well as endianess in tomcrypt_cfg.h |
| 125 |
#endif |
| 126 |
|
| 127 |
#if !(defined(ENDIAN_BIG) || defined(ENDIAN_LITTLE)) |
| 128 |
#define ENDIAN_NEUTRAL |
| 129 |
#endif |
| 130 |
|
| 131 |
#endif |
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
|
| 136 |
|