change some parameters in the library to meet the needs of the website httpbin.org
Fork of MiniTLS-GPL by
math/misc/fp_ident.c@5:95f70ebfe61f, 2015-02-06 (annotated)
- Committer:
- shiyilei
- Date:
- Fri Feb 06 06:17:33 2015 +0000
- Revision:
- 5:95f70ebfe61f
- Parent:
- 0:35aa5be3b78d
change some parameters in the library to meet the needs of httpbin.org
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MiniTLS | 0:35aa5be3b78d | 1 | /* TomsFastMath, a fast ISO C bignum library. |
MiniTLS | 0:35aa5be3b78d | 2 | * |
MiniTLS | 0:35aa5be3b78d | 3 | * This project is meant to fill in where LibTomMath |
MiniTLS | 0:35aa5be3b78d | 4 | * falls short. That is speed ;-) |
MiniTLS | 0:35aa5be3b78d | 5 | * |
MiniTLS | 0:35aa5be3b78d | 6 | * This project is public domain and free for all purposes. |
MiniTLS | 0:35aa5be3b78d | 7 | * |
MiniTLS | 0:35aa5be3b78d | 8 | * Tom St Denis, tomstdenis@gmail.com |
MiniTLS | 0:35aa5be3b78d | 9 | */ |
MiniTLS | 0:35aa5be3b78d | 10 | #include "tfm.h" |
MiniTLS | 0:35aa5be3b78d | 11 | |
MiniTLS | 0:35aa5be3b78d | 12 | const char *fp_ident(void) |
MiniTLS | 0:35aa5be3b78d | 13 | { |
MiniTLS | 0:35aa5be3b78d | 14 | static char buf[1024]; |
MiniTLS | 0:35aa5be3b78d | 15 | |
MiniTLS | 0:35aa5be3b78d | 16 | memset(buf, 0, sizeof(buf)); |
MiniTLS | 0:35aa5be3b78d | 17 | snprintf(buf, sizeof(buf)-1, |
MiniTLS | 0:35aa5be3b78d | 18 | "TomsFastMath (%s)\n" |
MiniTLS | 0:35aa5be3b78d | 19 | "\n" |
MiniTLS | 0:35aa5be3b78d | 20 | "Sizeofs\n" |
MiniTLS | 0:35aa5be3b78d | 21 | "\tfp_digit = %u\n" |
MiniTLS | 0:35aa5be3b78d | 22 | "\tfp_word = %u\n" |
MiniTLS | 0:35aa5be3b78d | 23 | "\n" |
MiniTLS | 0:35aa5be3b78d | 24 | "FP_MAX_SIZE = %u\n" |
MiniTLS | 0:35aa5be3b78d | 25 | "\n" |
MiniTLS | 0:35aa5be3b78d | 26 | "Defines: \n" |
MiniTLS | 0:35aa5be3b78d | 27 | #ifdef __i386__ |
MiniTLS | 0:35aa5be3b78d | 28 | " __i386__ " |
MiniTLS | 0:35aa5be3b78d | 29 | #endif |
MiniTLS | 0:35aa5be3b78d | 30 | #ifdef __x86_64__ |
MiniTLS | 0:35aa5be3b78d | 31 | " __x86_64__ " |
MiniTLS | 0:35aa5be3b78d | 32 | #endif |
MiniTLS | 0:35aa5be3b78d | 33 | #ifdef TFM_X86 |
MiniTLS | 0:35aa5be3b78d | 34 | " TFM_X86 " |
MiniTLS | 0:35aa5be3b78d | 35 | #endif |
MiniTLS | 0:35aa5be3b78d | 36 | #ifdef TFM_X86_64 |
MiniTLS | 0:35aa5be3b78d | 37 | " TFM_X86_64 " |
MiniTLS | 0:35aa5be3b78d | 38 | #endif |
MiniTLS | 0:35aa5be3b78d | 39 | #ifdef TFM_SSE2 |
MiniTLS | 0:35aa5be3b78d | 40 | " TFM_SSE2 " |
MiniTLS | 0:35aa5be3b78d | 41 | #endif |
MiniTLS | 0:35aa5be3b78d | 42 | #ifdef TFM_ARM |
MiniTLS | 0:35aa5be3b78d | 43 | " TFM_ARM " |
MiniTLS | 0:35aa5be3b78d | 44 | #endif |
MiniTLS | 0:35aa5be3b78d | 45 | #ifdef TFM_PPC32 |
MiniTLS | 0:35aa5be3b78d | 46 | " TFM_PPC32 " |
MiniTLS | 0:35aa5be3b78d | 47 | #endif |
MiniTLS | 0:35aa5be3b78d | 48 | #ifdef TFM_AVR32 |
MiniTLS | 0:35aa5be3b78d | 49 | " TFM_AVR32 " |
MiniTLS | 0:35aa5be3b78d | 50 | #endif |
MiniTLS | 0:35aa5be3b78d | 51 | #ifdef TFM_ECC192 |
MiniTLS | 0:35aa5be3b78d | 52 | " TFM_ECC192 " |
MiniTLS | 0:35aa5be3b78d | 53 | #endif |
MiniTLS | 0:35aa5be3b78d | 54 | #ifdef TFM_ECC224 |
MiniTLS | 0:35aa5be3b78d | 55 | " TFM_ECC224 " |
MiniTLS | 0:35aa5be3b78d | 56 | #endif |
MiniTLS | 0:35aa5be3b78d | 57 | #ifdef TFM_ECC384 |
MiniTLS | 0:35aa5be3b78d | 58 | " TFM_ECC384 " |
MiniTLS | 0:35aa5be3b78d | 59 | #endif |
MiniTLS | 0:35aa5be3b78d | 60 | #ifdef TFM_ECC521 |
MiniTLS | 0:35aa5be3b78d | 61 | " TFM_ECC521 " |
MiniTLS | 0:35aa5be3b78d | 62 | #endif |
MiniTLS | 0:35aa5be3b78d | 63 | |
MiniTLS | 0:35aa5be3b78d | 64 | #ifdef TFM_NO_ASM |
MiniTLS | 0:35aa5be3b78d | 65 | " TFM_NO_ASM " |
MiniTLS | 0:35aa5be3b78d | 66 | #endif |
MiniTLS | 0:35aa5be3b78d | 67 | #ifdef FP_64BIT |
MiniTLS | 0:35aa5be3b78d | 68 | " FP_64BIT " |
MiniTLS | 0:35aa5be3b78d | 69 | #endif |
MiniTLS | 0:35aa5be3b78d | 70 | #ifdef TFM_HUGE |
MiniTLS | 0:35aa5be3b78d | 71 | " TFM_HUGE " |
MiniTLS | 0:35aa5be3b78d | 72 | #endif |
MiniTLS | 0:35aa5be3b78d | 73 | "\n", __DATE__, sizeof(fp_digit), sizeof(fp_word), FP_MAX_SIZE); |
MiniTLS | 0:35aa5be3b78d | 74 | |
MiniTLS | 0:35aa5be3b78d | 75 | if (sizeof(fp_digit) == sizeof(fp_word)) { |
MiniTLS | 0:35aa5be3b78d | 76 | strncat(buf, "WARNING: sizeof(fp_digit) == sizeof(fp_word), this build is likely to not work properly.\n", |
MiniTLS | 0:35aa5be3b78d | 77 | sizeof(buf)-1); |
MiniTLS | 0:35aa5be3b78d | 78 | } |
MiniTLS | 0:35aa5be3b78d | 79 | return buf; |
MiniTLS | 0:35aa5be3b78d | 80 | } |
MiniTLS | 0:35aa5be3b78d | 81 | |
MiniTLS | 0:35aa5be3b78d | 82 | #ifdef STANDALONE |
MiniTLS | 0:35aa5be3b78d | 83 | |
MiniTLS | 0:35aa5be3b78d | 84 | int main(void) |
MiniTLS | 0:35aa5be3b78d | 85 | { |
MiniTLS | 0:35aa5be3b78d | 86 | printf("%s\n", fp_ident()); |
MiniTLS | 0:35aa5be3b78d | 87 | return 0; |
MiniTLS | 0:35aa5be3b78d | 88 | } |
MiniTLS | 0:35aa5be3b78d | 89 | |
MiniTLS | 0:35aa5be3b78d | 90 | #endif |
MiniTLS | 0:35aa5be3b78d | 91 | |
MiniTLS | 0:35aa5be3b78d | 92 | |
MiniTLS | 0:35aa5be3b78d | 93 | /* $Source: /cvs/libtom/tomsfastmath/src/misc/fp_ident.c,v $ */ |
MiniTLS | 0:35aa5be3b78d | 94 | /* $Revision: 1.1 $ */ |
MiniTLS | 0:35aa5be3b78d | 95 | /* $Date: 2006/12/31 21:25:53 $ */ |