Codebase list libcryptx-perl / a7b6c80
ltc sync Karel Miko 7 years ago
6 changed file(s) with 27 addition(s) and 25 deletion(s). Raw diff Collapse all Expand all
3232
3333 #ifndef XCLOCK
3434 #define XCLOCK clock
35 #endif
36 #ifndef XCLOCKS_PER_SEC
37 #define XCLOCKS_PER_SEC CLOCKS_PER_SEC
3835 #endif
3936
4037 #ifndef XQSORT
105102
106103 /* The minimal set of functionality to run the tests */
107104 #ifdef LTC_MINIMAL
105 #define LTC_RIJNDAEL
108106 #define LTC_SHA256
107 #define LTC_YARROW
109108 #define LTC_CTR_MODE
109
110110 #define LTC_RNG_MAKE_PRNG
111111 #define LTC_RNG_GET_BYTES
112 #define LTC_YARROW
113112 #define LTC_DEVRANDOM
114113 #define LTC_TRY_URANDOM_FIRST
115114
150149 /* TomsFastMath */
151150 /* #define TFM_DESC */
152151
153 #endif /* LTC_NO_MATH */
154
155152 /* GNU Multiple Precision Arithmetic Library */
156153 /* #define GMP_DESC */
154
155 #endif /* LTC_NO_MATH */
157156
158157 /* ---> Symmetric Block Ciphers <--- */
159158 #ifndef LTC_NO_CIPHERS
281280
282281 /* Yarrow */
283282 #define LTC_YARROW
284 /* which descriptor of AES to use? */
285 /* 0 = rijndael_enc 1 = aes_enc, 2 = rijndael [full], 3 = aes [full] */
286 #ifdef ENCRYPT_ONLY
287 #define LTC_YARROW_AES 0
288 #else
289 #define LTC_YARROW_AES 2
290 #endif
291283
292284 /* a PRNG that simply reads from an available system source */
293285 #define LTC_SPRNG
312304 #define LTC_RNG_MAKE_PRNG
313305
314306 #endif /* LTC_NO_PRNGS */
307
308 #ifdef LTC_YARROW
309
310 /* which descriptor of AES to use? */
311 /* 0 = rijndael_enc 1 = aes_enc, 2 = rijndael [full], 3 = aes [full] */
312 #ifdef ENCRYPT_ONLY
313 #define LTC_YARROW_AES 0
314 #else
315 #define LTC_YARROW_AES 2
316 #endif
317
318 #endif
315319
316320 #ifdef LTC_FORTUNA
317321
110110 int rsa_export(unsigned char *out, unsigned long *outlen, int type, rsa_key *key);
111111 int rsa_import(const unsigned char *in, unsigned long inlen, rsa_key *key);
112112 int rsa_import_pkcs8(unsigned char *in, unsigned long inlen, rsa_key *key);
113
113114 int rsa_import_radix(int radix, char *N, char *e, char *d, char *p, char *q, char *dP, char *dQ, char *qP, rsa_key *key);
114
115115 #endif
116116
117117 /* ---- Katja ---- */
125125 case MP_LT: return LTC_MP_LT;
126126 case MP_EQ: return LTC_MP_EQ;
127127 case MP_GT: return LTC_MP_GT;
128 }
129 return 0;
128 default: return 0;
129 }
130130 }
131131
132132 static int compare_d(void *a, unsigned long b)
138138 case MP_LT: return LTC_MP_LT;
139139 case MP_EQ: return LTC_MP_EQ;
140140 case MP_GT: return LTC_MP_GT;
141 }
142 return 0;
141 default: return 0;
142 }
143143 }
144144
145145 static int count_bits(void *a)
9292 switch (size) {
9393 default:
9494 h[3] = ctx->s[0] & 0x0ff;
95 /* no break */
95 /* FALLTHROUGH */
9696 case 3:
9797 h[2] = (ctx->s[0] >> 8) & 0x0ff;
98 /* no break */
98 /* FALLTHROUGH */
9999 case 2:
100100 h[1] = ctx->s[1] & 0x0ff;
101 /* no break */
101 /* FALLTHROUGH */
102102 case 1:
103103 h[0] = (ctx->s[1] >> 8) & 0x0ff;
104 /* no break */
104 /* FALLTHROUGH */
105105 case 0:
106106 ;
107107 }
118118 adler32_state ctx;
119119 adler32_init(&ctx);
120120 adler32_update(&ctx, in, strlen(in));
121 adler32_finish(&ctx, &out, 4);
121 adler32_finish(&ctx, out, 4);
122122 if (XMEMCMP(adler32, out, 4)) {
123123 #ifdef LTC_TEST_DBG
124124 ulong32 _out, _adler32;
88 * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
99 */
1010 #include "tomcrypt.h"
11 #include <stdarg.h>
1211
1312
1413 /**
88 * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
99 */
1010 #include "tomcrypt.h"
11 #include <stdarg.h>
1211
1312
1413 /**