Install OpenSSL 0.9.8y header files
[msysgit.git] / mingw / include / tclTomMathDecls.h
blob04a23f37332ca01254ce6a2eacc3722077ad924d
1 /*
2 *----------------------------------------------------------------------
4 * tclTomMathDecls.h --
6 * This file contains the declarations for the 'libtommath'
7 * functions that are exported by the Tcl library.
9 * Copyright (c) 2005 by Kevin B. Kenny. All rights reserved.
11 * See the file "license.terms" for information on usage and redistribution
12 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
15 #ifndef _TCLTOMMATHDECLS
16 #define _TCLTOMMATHDECLS
18 #include "tcl.h"
21 * Define the version of the Stubs table that's exported for tommath
24 #define TCLTOMMATH_EPOCH 0
25 #define TCLTOMMATH_REVISION 0
27 #define Tcl_TomMath_InitStubs(interp,version) \
28 (TclTomMathInitializeStubs((interp),(version),\
29 TCLTOMMATH_EPOCH,TCLTOMMATH_REVISION))
31 /* Define custom memory allocation for libtommath */
33 /* MODULE_SCOPE void* TclBNAlloc( size_t ); */
34 #define TclBNAlloc(s) ((void*)ckalloc((size_t)(s)))
35 /* MODULE_SCOPE void* TclBNRealloc( void*, size_t ); */
36 #define TclBNRealloc(x,s) ((void*)ckrealloc((char*)(x),(size_t)(s)))
37 /* MODULE_SCOPE void TclBNFree( void* ); */
38 #define TclBNFree(x) (ckfree((char*)(x)))
39 /* MODULE_SCOPE void* TclBNCalloc( size_t, size_t ); */
40 /* unused - no macro */
42 #define XMALLOC(x) TclBNAlloc(x)
43 #define XFREE(x) TclBNFree(x)
44 #define XREALLOC(x,n) TclBNRealloc(x,n)
45 #define XCALLOC(n,x) TclBNCalloc(n,x)
47 /* Rename the global symbols in libtommath to avoid linkage conflicts */
49 #define KARATSUBA_MUL_CUTOFF TclBNKaratsubaMulCutoff
50 #define KARATSUBA_SQR_CUTOFF TclBNKaratsubaSqrCutoff
51 #define TOOM_MUL_CUTOFF TclBNToomMulCutoff
52 #define TOOM_SQR_CUTOFF TclBNToomSqrCutoff
54 #define bn_reverse TclBN_reverse
55 #define fast_s_mp_mul_digs TclBN_fast_s_mp_mul_digs
56 #define fast_s_mp_sqr TclBN_fast_s_mp_sqr
57 #define mp_add TclBN_mp_add
58 #define mp_add_d TclBN_mp_add_d
59 #define mp_and TclBN_mp_and
60 #define mp_clamp TclBN_mp_clamp
61 #define mp_clear TclBN_mp_clear
62 #define mp_clear_multi TclBN_mp_clear_multi
63 #define mp_cmp TclBN_mp_cmp
64 #define mp_cmp_d TclBN_mp_cmp_d
65 #define mp_cmp_mag TclBN_mp_cmp_mag
66 #define mp_cnt_lsb TclBN_mp_cnt_lsb
67 #define mp_copy TclBN_mp_copy
68 #define mp_count_bits TclBN_mp_count_bits
69 #define mp_div TclBN_mp_div
70 #define mp_div_2 TclBN_mp_div_2
71 #define mp_div_2d TclBN_mp_div_2d
72 #define mp_div_3 TclBN_mp_div_3
73 #define mp_div_d TclBN_mp_div_d
74 #define mp_exch TclBN_mp_exch
75 #define mp_expt_d TclBN_mp_expt_d
76 #define mp_grow TclBN_mp_grow
77 #define mp_init TclBN_mp_init
78 #define mp_init_copy TclBN_mp_init_copy
79 #define mp_init_multi TclBN_mp_init_multi
80 #define mp_init_set TclBN_mp_init_set
81 #define mp_init_set_int TclBN_mp_init_set_int
82 #define mp_init_size TclBN_mp_init_size
83 #define mp_karatsuba_mul TclBN_mp_karatsuba_mul
84 #define mp_karatsuba_sqr TclBN_mp_karatsuba_sqr
85 #define mp_lshd TclBN_mp_lshd
86 #define mp_mod TclBN_mp_mod
87 #define mp_mod_2d TclBN_mp_mod_2d
88 #define mp_mul TclBN_mp_mul
89 #define mp_mul_2 TclBN_mp_mul_2
90 #define mp_mul_2d TclBN_mp_mul_2d
91 #define mp_mul_d TclBN_mp_mul_d
92 #define mp_neg TclBN_mp_neg
93 #define mp_or TclBN_mp_or
94 #define mp_radix_size TclBN_mp_radix_size
95 #define mp_read_radix TclBN_mp_read_radix
96 #define mp_rshd TclBN_mp_rshd
97 #define mp_s_rmap TclBNMpSRmap
98 #define mp_set TclBN_mp_set
99 #define mp_set_int TclBN_mp_set_int
100 #define mp_shrink TclBN_mp_shrink
101 #define mp_sqr TclBN_mp_sqr
102 #define mp_sqrt TclBN_mp_sqrt
103 #define mp_sub TclBN_mp_sub
104 #define mp_sub_d TclBN_mp_sub_d
105 #define mp_to_unsigned_bin TclBN_mp_to_unsigned_bin
106 #define mp_to_unsigned_bin_n TclBN_mp_to_unsigned_bin_n
107 #define mp_toom_mul TclBN_mp_toom_mul
108 #define mp_toom_sqr TclBN_mp_toom_sqr
109 #define mp_toradix_n TclBN_mp_toradix_n
110 #define mp_unsigned_bin_size TclBN_mp_unsigned_bin_size
111 #define mp_xor TclBN_mp_xor
112 #define mp_zero TclBN_mp_zero
113 #define s_mp_add TclBN_s_mp_add
114 #define s_mp_mul_digs TclBN_s_mp_mul_digs
115 #define s_mp_sqr TclBN_s_mp_sqr
116 #define s_mp_sub TclBN_s_mp_sub
118 #undef TCL_STORAGE_CLASS
119 #ifdef BUILD_tcl
120 # define TCL_STORAGE_CLASS DLLEXPORT
121 #else
122 # ifdef USE_TCL_STUBS
123 # define TCL_STORAGE_CLASS
124 # else
125 # define TCL_STORAGE_CLASS DLLIMPORT
126 # endif
127 #endif
130 * WARNING: This file is automatically generated by the tools/genStubs.tcl
131 * script. Any modifications to the function declarations below should be made
132 * in the generic/tclInt.decls script.
135 /* !BEGIN!: Do not edit below this line. */
138 * Exported function declarations:
141 #ifndef TclBN_epoch_TCL_DECLARED
142 #define TclBN_epoch_TCL_DECLARED
143 /* 0 */
144 EXTERN int TclBN_epoch(void);
145 #endif
146 #ifndef TclBN_revision_TCL_DECLARED
147 #define TclBN_revision_TCL_DECLARED
148 /* 1 */
149 EXTERN int TclBN_revision(void);
150 #endif
151 #ifndef TclBN_mp_add_TCL_DECLARED
152 #define TclBN_mp_add_TCL_DECLARED
153 /* 2 */
154 EXTERN int TclBN_mp_add(mp_int *a, mp_int *b, mp_int *c);
155 #endif
156 #ifndef TclBN_mp_add_d_TCL_DECLARED
157 #define TclBN_mp_add_d_TCL_DECLARED
158 /* 3 */
159 EXTERN int TclBN_mp_add_d(mp_int *a, mp_digit b, mp_int *c);
160 #endif
161 #ifndef TclBN_mp_and_TCL_DECLARED
162 #define TclBN_mp_and_TCL_DECLARED
163 /* 4 */
164 EXTERN int TclBN_mp_and(mp_int *a, mp_int *b, mp_int *c);
165 #endif
166 #ifndef TclBN_mp_clamp_TCL_DECLARED
167 #define TclBN_mp_clamp_TCL_DECLARED
168 /* 5 */
169 EXTERN void TclBN_mp_clamp(mp_int *a);
170 #endif
171 #ifndef TclBN_mp_clear_TCL_DECLARED
172 #define TclBN_mp_clear_TCL_DECLARED
173 /* 6 */
174 EXTERN void TclBN_mp_clear(mp_int *a);
175 #endif
176 #ifndef TclBN_mp_clear_multi_TCL_DECLARED
177 #define TclBN_mp_clear_multi_TCL_DECLARED
178 /* 7 */
179 EXTERN void TclBN_mp_clear_multi(mp_int *a, ...);
180 #endif
181 #ifndef TclBN_mp_cmp_TCL_DECLARED
182 #define TclBN_mp_cmp_TCL_DECLARED
183 /* 8 */
184 EXTERN int TclBN_mp_cmp(mp_int *a, mp_int *b);
185 #endif
186 #ifndef TclBN_mp_cmp_d_TCL_DECLARED
187 #define TclBN_mp_cmp_d_TCL_DECLARED
188 /* 9 */
189 EXTERN int TclBN_mp_cmp_d(mp_int *a, mp_digit b);
190 #endif
191 #ifndef TclBN_mp_cmp_mag_TCL_DECLARED
192 #define TclBN_mp_cmp_mag_TCL_DECLARED
193 /* 10 */
194 EXTERN int TclBN_mp_cmp_mag(mp_int *a, mp_int *b);
195 #endif
196 #ifndef TclBN_mp_copy_TCL_DECLARED
197 #define TclBN_mp_copy_TCL_DECLARED
198 /* 11 */
199 EXTERN int TclBN_mp_copy(mp_int *a, mp_int *b);
200 #endif
201 #ifndef TclBN_mp_count_bits_TCL_DECLARED
202 #define TclBN_mp_count_bits_TCL_DECLARED
203 /* 12 */
204 EXTERN int TclBN_mp_count_bits(mp_int *a);
205 #endif
206 #ifndef TclBN_mp_div_TCL_DECLARED
207 #define TclBN_mp_div_TCL_DECLARED
208 /* 13 */
209 EXTERN int TclBN_mp_div(mp_int *a, mp_int *b, mp_int *q,
210 mp_int *r);
211 #endif
212 #ifndef TclBN_mp_div_d_TCL_DECLARED
213 #define TclBN_mp_div_d_TCL_DECLARED
214 /* 14 */
215 EXTERN int TclBN_mp_div_d(mp_int *a, mp_digit b, mp_int *q,
216 mp_digit *r);
217 #endif
218 #ifndef TclBN_mp_div_2_TCL_DECLARED
219 #define TclBN_mp_div_2_TCL_DECLARED
220 /* 15 */
221 EXTERN int TclBN_mp_div_2(mp_int *a, mp_int *q);
222 #endif
223 #ifndef TclBN_mp_div_2d_TCL_DECLARED
224 #define TclBN_mp_div_2d_TCL_DECLARED
225 /* 16 */
226 EXTERN int TclBN_mp_div_2d(mp_int *a, int b, mp_int *q,
227 mp_int *r);
228 #endif
229 #ifndef TclBN_mp_div_3_TCL_DECLARED
230 #define TclBN_mp_div_3_TCL_DECLARED
231 /* 17 */
232 EXTERN int TclBN_mp_div_3(mp_int *a, mp_int *q, mp_digit *r);
233 #endif
234 #ifndef TclBN_mp_exch_TCL_DECLARED
235 #define TclBN_mp_exch_TCL_DECLARED
236 /* 18 */
237 EXTERN void TclBN_mp_exch(mp_int *a, mp_int *b);
238 #endif
239 #ifndef TclBN_mp_expt_d_TCL_DECLARED
240 #define TclBN_mp_expt_d_TCL_DECLARED
241 /* 19 */
242 EXTERN int TclBN_mp_expt_d(mp_int *a, mp_digit b, mp_int *c);
243 #endif
244 #ifndef TclBN_mp_grow_TCL_DECLARED
245 #define TclBN_mp_grow_TCL_DECLARED
246 /* 20 */
247 EXTERN int TclBN_mp_grow(mp_int *a, int size);
248 #endif
249 #ifndef TclBN_mp_init_TCL_DECLARED
250 #define TclBN_mp_init_TCL_DECLARED
251 /* 21 */
252 EXTERN int TclBN_mp_init(mp_int *a);
253 #endif
254 #ifndef TclBN_mp_init_copy_TCL_DECLARED
255 #define TclBN_mp_init_copy_TCL_DECLARED
256 /* 22 */
257 EXTERN int TclBN_mp_init_copy(mp_int *a, mp_int *b);
258 #endif
259 #ifndef TclBN_mp_init_multi_TCL_DECLARED
260 #define TclBN_mp_init_multi_TCL_DECLARED
261 /* 23 */
262 EXTERN int TclBN_mp_init_multi(mp_int *a, ...);
263 #endif
264 #ifndef TclBN_mp_init_set_TCL_DECLARED
265 #define TclBN_mp_init_set_TCL_DECLARED
266 /* 24 */
267 EXTERN int TclBN_mp_init_set(mp_int *a, mp_digit b);
268 #endif
269 #ifndef TclBN_mp_init_size_TCL_DECLARED
270 #define TclBN_mp_init_size_TCL_DECLARED
271 /* 25 */
272 EXTERN int TclBN_mp_init_size(mp_int *a, int size);
273 #endif
274 #ifndef TclBN_mp_lshd_TCL_DECLARED
275 #define TclBN_mp_lshd_TCL_DECLARED
276 /* 26 */
277 EXTERN int TclBN_mp_lshd(mp_int *a, int shift);
278 #endif
279 #ifndef TclBN_mp_mod_TCL_DECLARED
280 #define TclBN_mp_mod_TCL_DECLARED
281 /* 27 */
282 EXTERN int TclBN_mp_mod(mp_int *a, mp_int *b, mp_int *r);
283 #endif
284 #ifndef TclBN_mp_mod_2d_TCL_DECLARED
285 #define TclBN_mp_mod_2d_TCL_DECLARED
286 /* 28 */
287 EXTERN int TclBN_mp_mod_2d(mp_int *a, int b, mp_int *r);
288 #endif
289 #ifndef TclBN_mp_mul_TCL_DECLARED
290 #define TclBN_mp_mul_TCL_DECLARED
291 /* 29 */
292 EXTERN int TclBN_mp_mul(mp_int *a, mp_int *b, mp_int *p);
293 #endif
294 #ifndef TclBN_mp_mul_d_TCL_DECLARED
295 #define TclBN_mp_mul_d_TCL_DECLARED
296 /* 30 */
297 EXTERN int TclBN_mp_mul_d(mp_int *a, mp_digit b, mp_int *p);
298 #endif
299 #ifndef TclBN_mp_mul_2_TCL_DECLARED
300 #define TclBN_mp_mul_2_TCL_DECLARED
301 /* 31 */
302 EXTERN int TclBN_mp_mul_2(mp_int *a, mp_int *p);
303 #endif
304 #ifndef TclBN_mp_mul_2d_TCL_DECLARED
305 #define TclBN_mp_mul_2d_TCL_DECLARED
306 /* 32 */
307 EXTERN int TclBN_mp_mul_2d(mp_int *a, int d, mp_int *p);
308 #endif
309 #ifndef TclBN_mp_neg_TCL_DECLARED
310 #define TclBN_mp_neg_TCL_DECLARED
311 /* 33 */
312 EXTERN int TclBN_mp_neg(mp_int *a, mp_int *b);
313 #endif
314 #ifndef TclBN_mp_or_TCL_DECLARED
315 #define TclBN_mp_or_TCL_DECLARED
316 /* 34 */
317 EXTERN int TclBN_mp_or(mp_int *a, mp_int *b, mp_int *c);
318 #endif
319 #ifndef TclBN_mp_radix_size_TCL_DECLARED
320 #define TclBN_mp_radix_size_TCL_DECLARED
321 /* 35 */
322 EXTERN int TclBN_mp_radix_size(mp_int *a, int radix, int *size);
323 #endif
324 #ifndef TclBN_mp_read_radix_TCL_DECLARED
325 #define TclBN_mp_read_radix_TCL_DECLARED
326 /* 36 */
327 EXTERN int TclBN_mp_read_radix(mp_int *a, CONST char *str,
328 int radix);
329 #endif
330 #ifndef TclBN_mp_rshd_TCL_DECLARED
331 #define TclBN_mp_rshd_TCL_DECLARED
332 /* 37 */
333 EXTERN void TclBN_mp_rshd(mp_int *a, int shift);
334 #endif
335 #ifndef TclBN_mp_shrink_TCL_DECLARED
336 #define TclBN_mp_shrink_TCL_DECLARED
337 /* 38 */
338 EXTERN int TclBN_mp_shrink(mp_int *a);
339 #endif
340 #ifndef TclBN_mp_set_TCL_DECLARED
341 #define TclBN_mp_set_TCL_DECLARED
342 /* 39 */
343 EXTERN void TclBN_mp_set(mp_int *a, mp_digit b);
344 #endif
345 #ifndef TclBN_mp_sqr_TCL_DECLARED
346 #define TclBN_mp_sqr_TCL_DECLARED
347 /* 40 */
348 EXTERN int TclBN_mp_sqr(mp_int *a, mp_int *b);
349 #endif
350 #ifndef TclBN_mp_sqrt_TCL_DECLARED
351 #define TclBN_mp_sqrt_TCL_DECLARED
352 /* 41 */
353 EXTERN int TclBN_mp_sqrt(mp_int *a, mp_int *b);
354 #endif
355 #ifndef TclBN_mp_sub_TCL_DECLARED
356 #define TclBN_mp_sub_TCL_DECLARED
357 /* 42 */
358 EXTERN int TclBN_mp_sub(mp_int *a, mp_int *b, mp_int *c);
359 #endif
360 #ifndef TclBN_mp_sub_d_TCL_DECLARED
361 #define TclBN_mp_sub_d_TCL_DECLARED
362 /* 43 */
363 EXTERN int TclBN_mp_sub_d(mp_int *a, mp_digit b, mp_int *c);
364 #endif
365 #ifndef TclBN_mp_to_unsigned_bin_TCL_DECLARED
366 #define TclBN_mp_to_unsigned_bin_TCL_DECLARED
367 /* 44 */
368 EXTERN int TclBN_mp_to_unsigned_bin(mp_int *a, unsigned char *b);
369 #endif
370 #ifndef TclBN_mp_to_unsigned_bin_n_TCL_DECLARED
371 #define TclBN_mp_to_unsigned_bin_n_TCL_DECLARED
372 /* 45 */
373 EXTERN int TclBN_mp_to_unsigned_bin_n(mp_int *a,
374 unsigned char *b, unsigned long *outlen);
375 #endif
376 #ifndef TclBN_mp_toradix_n_TCL_DECLARED
377 #define TclBN_mp_toradix_n_TCL_DECLARED
378 /* 46 */
379 EXTERN int TclBN_mp_toradix_n(mp_int *a, char *str, int radix,
380 int maxlen);
381 #endif
382 #ifndef TclBN_mp_unsigned_bin_size_TCL_DECLARED
383 #define TclBN_mp_unsigned_bin_size_TCL_DECLARED
384 /* 47 */
385 EXTERN int TclBN_mp_unsigned_bin_size(mp_int *a);
386 #endif
387 #ifndef TclBN_mp_xor_TCL_DECLARED
388 #define TclBN_mp_xor_TCL_DECLARED
389 /* 48 */
390 EXTERN int TclBN_mp_xor(mp_int *a, mp_int *b, mp_int *c);
391 #endif
392 #ifndef TclBN_mp_zero_TCL_DECLARED
393 #define TclBN_mp_zero_TCL_DECLARED
394 /* 49 */
395 EXTERN void TclBN_mp_zero(mp_int *a);
396 #endif
397 #ifndef TclBN_reverse_TCL_DECLARED
398 #define TclBN_reverse_TCL_DECLARED
399 /* 50 */
400 EXTERN void TclBN_reverse(unsigned char *s, int len);
401 #endif
402 #ifndef TclBN_fast_s_mp_mul_digs_TCL_DECLARED
403 #define TclBN_fast_s_mp_mul_digs_TCL_DECLARED
404 /* 51 */
405 EXTERN int TclBN_fast_s_mp_mul_digs(mp_int *a, mp_int *b,
406 mp_int *c, int digs);
407 #endif
408 #ifndef TclBN_fast_s_mp_sqr_TCL_DECLARED
409 #define TclBN_fast_s_mp_sqr_TCL_DECLARED
410 /* 52 */
411 EXTERN int TclBN_fast_s_mp_sqr(mp_int *a, mp_int *b);
412 #endif
413 #ifndef TclBN_mp_karatsuba_mul_TCL_DECLARED
414 #define TclBN_mp_karatsuba_mul_TCL_DECLARED
415 /* 53 */
416 EXTERN int TclBN_mp_karatsuba_mul(mp_int *a, mp_int *b,
417 mp_int *c);
418 #endif
419 #ifndef TclBN_mp_karatsuba_sqr_TCL_DECLARED
420 #define TclBN_mp_karatsuba_sqr_TCL_DECLARED
421 /* 54 */
422 EXTERN int TclBN_mp_karatsuba_sqr(mp_int *a, mp_int *b);
423 #endif
424 #ifndef TclBN_mp_toom_mul_TCL_DECLARED
425 #define TclBN_mp_toom_mul_TCL_DECLARED
426 /* 55 */
427 EXTERN int TclBN_mp_toom_mul(mp_int *a, mp_int *b, mp_int *c);
428 #endif
429 #ifndef TclBN_mp_toom_sqr_TCL_DECLARED
430 #define TclBN_mp_toom_sqr_TCL_DECLARED
431 /* 56 */
432 EXTERN int TclBN_mp_toom_sqr(mp_int *a, mp_int *b);
433 #endif
434 #ifndef TclBN_s_mp_add_TCL_DECLARED
435 #define TclBN_s_mp_add_TCL_DECLARED
436 /* 57 */
437 EXTERN int TclBN_s_mp_add(mp_int *a, mp_int *b, mp_int *c);
438 #endif
439 #ifndef TclBN_s_mp_mul_digs_TCL_DECLARED
440 #define TclBN_s_mp_mul_digs_TCL_DECLARED
441 /* 58 */
442 EXTERN int TclBN_s_mp_mul_digs(mp_int *a, mp_int *b, mp_int *c,
443 int digs);
444 #endif
445 #ifndef TclBN_s_mp_sqr_TCL_DECLARED
446 #define TclBN_s_mp_sqr_TCL_DECLARED
447 /* 59 */
448 EXTERN int TclBN_s_mp_sqr(mp_int *a, mp_int *b);
449 #endif
450 #ifndef TclBN_s_mp_sub_TCL_DECLARED
451 #define TclBN_s_mp_sub_TCL_DECLARED
452 /* 60 */
453 EXTERN int TclBN_s_mp_sub(mp_int *a, mp_int *b, mp_int *c);
454 #endif
455 #ifndef TclBN_mp_init_set_int_TCL_DECLARED
456 #define TclBN_mp_init_set_int_TCL_DECLARED
457 /* 61 */
458 EXTERN int TclBN_mp_init_set_int(mp_int *a, unsigned long i);
459 #endif
460 #ifndef TclBN_mp_set_int_TCL_DECLARED
461 #define TclBN_mp_set_int_TCL_DECLARED
462 /* 62 */
463 EXTERN int TclBN_mp_set_int(mp_int *a, unsigned long i);
464 #endif
465 #ifndef TclBN_mp_cnt_lsb_TCL_DECLARED
466 #define TclBN_mp_cnt_lsb_TCL_DECLARED
467 /* 63 */
468 EXTERN int TclBN_mp_cnt_lsb(mp_int *a);
469 #endif
471 typedef struct TclTomMathStubs {
472 int magic;
473 struct TclTomMathStubHooks *hooks;
475 int (*tclBN_epoch) (void); /* 0 */
476 int (*tclBN_revision) (void); /* 1 */
477 int (*tclBN_mp_add) (mp_int *a, mp_int *b, mp_int *c); /* 2 */
478 int (*tclBN_mp_add_d) (mp_int *a, mp_digit b, mp_int *c); /* 3 */
479 int (*tclBN_mp_and) (mp_int *a, mp_int *b, mp_int *c); /* 4 */
480 void (*tclBN_mp_clamp) (mp_int *a); /* 5 */
481 void (*tclBN_mp_clear) (mp_int *a); /* 6 */
482 void (*tclBN_mp_clear_multi) (mp_int *a, ...); /* 7 */
483 int (*tclBN_mp_cmp) (mp_int *a, mp_int *b); /* 8 */
484 int (*tclBN_mp_cmp_d) (mp_int *a, mp_digit b); /* 9 */
485 int (*tclBN_mp_cmp_mag) (mp_int *a, mp_int *b); /* 10 */
486 int (*tclBN_mp_copy) (mp_int *a, mp_int *b); /* 11 */
487 int (*tclBN_mp_count_bits) (mp_int *a); /* 12 */
488 int (*tclBN_mp_div) (mp_int *a, mp_int *b, mp_int *q, mp_int *r); /* 13 */
489 int (*tclBN_mp_div_d) (mp_int *a, mp_digit b, mp_int *q, mp_digit *r); /* 14 */
490 int (*tclBN_mp_div_2) (mp_int *a, mp_int *q); /* 15 */
491 int (*tclBN_mp_div_2d) (mp_int *a, int b, mp_int *q, mp_int *r); /* 16 */
492 int (*tclBN_mp_div_3) (mp_int *a, mp_int *q, mp_digit *r); /* 17 */
493 void (*tclBN_mp_exch) (mp_int *a, mp_int *b); /* 18 */
494 int (*tclBN_mp_expt_d) (mp_int *a, mp_digit b, mp_int *c); /* 19 */
495 int (*tclBN_mp_grow) (mp_int *a, int size); /* 20 */
496 int (*tclBN_mp_init) (mp_int *a); /* 21 */
497 int (*tclBN_mp_init_copy) (mp_int *a, mp_int *b); /* 22 */
498 int (*tclBN_mp_init_multi) (mp_int *a, ...); /* 23 */
499 int (*tclBN_mp_init_set) (mp_int *a, mp_digit b); /* 24 */
500 int (*tclBN_mp_init_size) (mp_int *a, int size); /* 25 */
501 int (*tclBN_mp_lshd) (mp_int *a, int shift); /* 26 */
502 int (*tclBN_mp_mod) (mp_int *a, mp_int *b, mp_int *r); /* 27 */
503 int (*tclBN_mp_mod_2d) (mp_int *a, int b, mp_int *r); /* 28 */
504 int (*tclBN_mp_mul) (mp_int *a, mp_int *b, mp_int *p); /* 29 */
505 int (*tclBN_mp_mul_d) (mp_int *a, mp_digit b, mp_int *p); /* 30 */
506 int (*tclBN_mp_mul_2) (mp_int *a, mp_int *p); /* 31 */
507 int (*tclBN_mp_mul_2d) (mp_int *a, int d, mp_int *p); /* 32 */
508 int (*tclBN_mp_neg) (mp_int *a, mp_int *b); /* 33 */
509 int (*tclBN_mp_or) (mp_int *a, mp_int *b, mp_int *c); /* 34 */
510 int (*tclBN_mp_radix_size) (mp_int *a, int radix, int *size); /* 35 */
511 int (*tclBN_mp_read_radix) (mp_int *a, CONST char *str, int radix); /* 36 */
512 void (*tclBN_mp_rshd) (mp_int *a, int shift); /* 37 */
513 int (*tclBN_mp_shrink) (mp_int *a); /* 38 */
514 void (*tclBN_mp_set) (mp_int *a, mp_digit b); /* 39 */
515 int (*tclBN_mp_sqr) (mp_int *a, mp_int *b); /* 40 */
516 int (*tclBN_mp_sqrt) (mp_int *a, mp_int *b); /* 41 */
517 int (*tclBN_mp_sub) (mp_int *a, mp_int *b, mp_int *c); /* 42 */
518 int (*tclBN_mp_sub_d) (mp_int *a, mp_digit b, mp_int *c); /* 43 */
519 int (*tclBN_mp_to_unsigned_bin) (mp_int *a, unsigned char *b); /* 44 */
520 int (*tclBN_mp_to_unsigned_bin_n) (mp_int *a, unsigned char *b, unsigned long *outlen); /* 45 */
521 int (*tclBN_mp_toradix_n) (mp_int *a, char *str, int radix, int maxlen); /* 46 */
522 int (*tclBN_mp_unsigned_bin_size) (mp_int *a); /* 47 */
523 int (*tclBN_mp_xor) (mp_int *a, mp_int *b, mp_int *c); /* 48 */
524 void (*tclBN_mp_zero) (mp_int *a); /* 49 */
525 void (*tclBN_reverse) (unsigned char *s, int len); /* 50 */
526 int (*tclBN_fast_s_mp_mul_digs) (mp_int *a, mp_int *b, mp_int *c, int digs); /* 51 */
527 int (*tclBN_fast_s_mp_sqr) (mp_int *a, mp_int *b); /* 52 */
528 int (*tclBN_mp_karatsuba_mul) (mp_int *a, mp_int *b, mp_int *c); /* 53 */
529 int (*tclBN_mp_karatsuba_sqr) (mp_int *a, mp_int *b); /* 54 */
530 int (*tclBN_mp_toom_mul) (mp_int *a, mp_int *b, mp_int *c); /* 55 */
531 int (*tclBN_mp_toom_sqr) (mp_int *a, mp_int *b); /* 56 */
532 int (*tclBN_s_mp_add) (mp_int *a, mp_int *b, mp_int *c); /* 57 */
533 int (*tclBN_s_mp_mul_digs) (mp_int *a, mp_int *b, mp_int *c, int digs); /* 58 */
534 int (*tclBN_s_mp_sqr) (mp_int *a, mp_int *b); /* 59 */
535 int (*tclBN_s_mp_sub) (mp_int *a, mp_int *b, mp_int *c); /* 60 */
536 int (*tclBN_mp_init_set_int) (mp_int *a, unsigned long i); /* 61 */
537 int (*tclBN_mp_set_int) (mp_int *a, unsigned long i); /* 62 */
538 int (*tclBN_mp_cnt_lsb) (mp_int *a); /* 63 */
539 } TclTomMathStubs;
541 #ifdef __cplusplus
542 extern "C" {
543 #endif
544 extern TclTomMathStubs *tclTomMathStubsPtr;
545 #ifdef __cplusplus
547 #endif
549 #if defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS)
552 * Inline function declarations:
555 #ifndef TclBN_epoch
556 #define TclBN_epoch \
557 (tclTomMathStubsPtr->tclBN_epoch) /* 0 */
558 #endif
559 #ifndef TclBN_revision
560 #define TclBN_revision \
561 (tclTomMathStubsPtr->tclBN_revision) /* 1 */
562 #endif
563 #ifndef TclBN_mp_add
564 #define TclBN_mp_add \
565 (tclTomMathStubsPtr->tclBN_mp_add) /* 2 */
566 #endif
567 #ifndef TclBN_mp_add_d
568 #define TclBN_mp_add_d \
569 (tclTomMathStubsPtr->tclBN_mp_add_d) /* 3 */
570 #endif
571 #ifndef TclBN_mp_and
572 #define TclBN_mp_and \
573 (tclTomMathStubsPtr->tclBN_mp_and) /* 4 */
574 #endif
575 #ifndef TclBN_mp_clamp
576 #define TclBN_mp_clamp \
577 (tclTomMathStubsPtr->tclBN_mp_clamp) /* 5 */
578 #endif
579 #ifndef TclBN_mp_clear
580 #define TclBN_mp_clear \
581 (tclTomMathStubsPtr->tclBN_mp_clear) /* 6 */
582 #endif
583 #ifndef TclBN_mp_clear_multi
584 #define TclBN_mp_clear_multi \
585 (tclTomMathStubsPtr->tclBN_mp_clear_multi) /* 7 */
586 #endif
587 #ifndef TclBN_mp_cmp
588 #define TclBN_mp_cmp \
589 (tclTomMathStubsPtr->tclBN_mp_cmp) /* 8 */
590 #endif
591 #ifndef TclBN_mp_cmp_d
592 #define TclBN_mp_cmp_d \
593 (tclTomMathStubsPtr->tclBN_mp_cmp_d) /* 9 */
594 #endif
595 #ifndef TclBN_mp_cmp_mag
596 #define TclBN_mp_cmp_mag \
597 (tclTomMathStubsPtr->tclBN_mp_cmp_mag) /* 10 */
598 #endif
599 #ifndef TclBN_mp_copy
600 #define TclBN_mp_copy \
601 (tclTomMathStubsPtr->tclBN_mp_copy) /* 11 */
602 #endif
603 #ifndef TclBN_mp_count_bits
604 #define TclBN_mp_count_bits \
605 (tclTomMathStubsPtr->tclBN_mp_count_bits) /* 12 */
606 #endif
607 #ifndef TclBN_mp_div
608 #define TclBN_mp_div \
609 (tclTomMathStubsPtr->tclBN_mp_div) /* 13 */
610 #endif
611 #ifndef TclBN_mp_div_d
612 #define TclBN_mp_div_d \
613 (tclTomMathStubsPtr->tclBN_mp_div_d) /* 14 */
614 #endif
615 #ifndef TclBN_mp_div_2
616 #define TclBN_mp_div_2 \
617 (tclTomMathStubsPtr->tclBN_mp_div_2) /* 15 */
618 #endif
619 #ifndef TclBN_mp_div_2d
620 #define TclBN_mp_div_2d \
621 (tclTomMathStubsPtr->tclBN_mp_div_2d) /* 16 */
622 #endif
623 #ifndef TclBN_mp_div_3
624 #define TclBN_mp_div_3 \
625 (tclTomMathStubsPtr->tclBN_mp_div_3) /* 17 */
626 #endif
627 #ifndef TclBN_mp_exch
628 #define TclBN_mp_exch \
629 (tclTomMathStubsPtr->tclBN_mp_exch) /* 18 */
630 #endif
631 #ifndef TclBN_mp_expt_d
632 #define TclBN_mp_expt_d \
633 (tclTomMathStubsPtr->tclBN_mp_expt_d) /* 19 */
634 #endif
635 #ifndef TclBN_mp_grow
636 #define TclBN_mp_grow \
637 (tclTomMathStubsPtr->tclBN_mp_grow) /* 20 */
638 #endif
639 #ifndef TclBN_mp_init
640 #define TclBN_mp_init \
641 (tclTomMathStubsPtr->tclBN_mp_init) /* 21 */
642 #endif
643 #ifndef TclBN_mp_init_copy
644 #define TclBN_mp_init_copy \
645 (tclTomMathStubsPtr->tclBN_mp_init_copy) /* 22 */
646 #endif
647 #ifndef TclBN_mp_init_multi
648 #define TclBN_mp_init_multi \
649 (tclTomMathStubsPtr->tclBN_mp_init_multi) /* 23 */
650 #endif
651 #ifndef TclBN_mp_init_set
652 #define TclBN_mp_init_set \
653 (tclTomMathStubsPtr->tclBN_mp_init_set) /* 24 */
654 #endif
655 #ifndef TclBN_mp_init_size
656 #define TclBN_mp_init_size \
657 (tclTomMathStubsPtr->tclBN_mp_init_size) /* 25 */
658 #endif
659 #ifndef TclBN_mp_lshd
660 #define TclBN_mp_lshd \
661 (tclTomMathStubsPtr->tclBN_mp_lshd) /* 26 */
662 #endif
663 #ifndef TclBN_mp_mod
664 #define TclBN_mp_mod \
665 (tclTomMathStubsPtr->tclBN_mp_mod) /* 27 */
666 #endif
667 #ifndef TclBN_mp_mod_2d
668 #define TclBN_mp_mod_2d \
669 (tclTomMathStubsPtr->tclBN_mp_mod_2d) /* 28 */
670 #endif
671 #ifndef TclBN_mp_mul
672 #define TclBN_mp_mul \
673 (tclTomMathStubsPtr->tclBN_mp_mul) /* 29 */
674 #endif
675 #ifndef TclBN_mp_mul_d
676 #define TclBN_mp_mul_d \
677 (tclTomMathStubsPtr->tclBN_mp_mul_d) /* 30 */
678 #endif
679 #ifndef TclBN_mp_mul_2
680 #define TclBN_mp_mul_2 \
681 (tclTomMathStubsPtr->tclBN_mp_mul_2) /* 31 */
682 #endif
683 #ifndef TclBN_mp_mul_2d
684 #define TclBN_mp_mul_2d \
685 (tclTomMathStubsPtr->tclBN_mp_mul_2d) /* 32 */
686 #endif
687 #ifndef TclBN_mp_neg
688 #define TclBN_mp_neg \
689 (tclTomMathStubsPtr->tclBN_mp_neg) /* 33 */
690 #endif
691 #ifndef TclBN_mp_or
692 #define TclBN_mp_or \
693 (tclTomMathStubsPtr->tclBN_mp_or) /* 34 */
694 #endif
695 #ifndef TclBN_mp_radix_size
696 #define TclBN_mp_radix_size \
697 (tclTomMathStubsPtr->tclBN_mp_radix_size) /* 35 */
698 #endif
699 #ifndef TclBN_mp_read_radix
700 #define TclBN_mp_read_radix \
701 (tclTomMathStubsPtr->tclBN_mp_read_radix) /* 36 */
702 #endif
703 #ifndef TclBN_mp_rshd
704 #define TclBN_mp_rshd \
705 (tclTomMathStubsPtr->tclBN_mp_rshd) /* 37 */
706 #endif
707 #ifndef TclBN_mp_shrink
708 #define TclBN_mp_shrink \
709 (tclTomMathStubsPtr->tclBN_mp_shrink) /* 38 */
710 #endif
711 #ifndef TclBN_mp_set
712 #define TclBN_mp_set \
713 (tclTomMathStubsPtr->tclBN_mp_set) /* 39 */
714 #endif
715 #ifndef TclBN_mp_sqr
716 #define TclBN_mp_sqr \
717 (tclTomMathStubsPtr->tclBN_mp_sqr) /* 40 */
718 #endif
719 #ifndef TclBN_mp_sqrt
720 #define TclBN_mp_sqrt \
721 (tclTomMathStubsPtr->tclBN_mp_sqrt) /* 41 */
722 #endif
723 #ifndef TclBN_mp_sub
724 #define TclBN_mp_sub \
725 (tclTomMathStubsPtr->tclBN_mp_sub) /* 42 */
726 #endif
727 #ifndef TclBN_mp_sub_d
728 #define TclBN_mp_sub_d \
729 (tclTomMathStubsPtr->tclBN_mp_sub_d) /* 43 */
730 #endif
731 #ifndef TclBN_mp_to_unsigned_bin
732 #define TclBN_mp_to_unsigned_bin \
733 (tclTomMathStubsPtr->tclBN_mp_to_unsigned_bin) /* 44 */
734 #endif
735 #ifndef TclBN_mp_to_unsigned_bin_n
736 #define TclBN_mp_to_unsigned_bin_n \
737 (tclTomMathStubsPtr->tclBN_mp_to_unsigned_bin_n) /* 45 */
738 #endif
739 #ifndef TclBN_mp_toradix_n
740 #define TclBN_mp_toradix_n \
741 (tclTomMathStubsPtr->tclBN_mp_toradix_n) /* 46 */
742 #endif
743 #ifndef TclBN_mp_unsigned_bin_size
744 #define TclBN_mp_unsigned_bin_size \
745 (tclTomMathStubsPtr->tclBN_mp_unsigned_bin_size) /* 47 */
746 #endif
747 #ifndef TclBN_mp_xor
748 #define TclBN_mp_xor \
749 (tclTomMathStubsPtr->tclBN_mp_xor) /* 48 */
750 #endif
751 #ifndef TclBN_mp_zero
752 #define TclBN_mp_zero \
753 (tclTomMathStubsPtr->tclBN_mp_zero) /* 49 */
754 #endif
755 #ifndef TclBN_reverse
756 #define TclBN_reverse \
757 (tclTomMathStubsPtr->tclBN_reverse) /* 50 */
758 #endif
759 #ifndef TclBN_fast_s_mp_mul_digs
760 #define TclBN_fast_s_mp_mul_digs \
761 (tclTomMathStubsPtr->tclBN_fast_s_mp_mul_digs) /* 51 */
762 #endif
763 #ifndef TclBN_fast_s_mp_sqr
764 #define TclBN_fast_s_mp_sqr \
765 (tclTomMathStubsPtr->tclBN_fast_s_mp_sqr) /* 52 */
766 #endif
767 #ifndef TclBN_mp_karatsuba_mul
768 #define TclBN_mp_karatsuba_mul \
769 (tclTomMathStubsPtr->tclBN_mp_karatsuba_mul) /* 53 */
770 #endif
771 #ifndef TclBN_mp_karatsuba_sqr
772 #define TclBN_mp_karatsuba_sqr \
773 (tclTomMathStubsPtr->tclBN_mp_karatsuba_sqr) /* 54 */
774 #endif
775 #ifndef TclBN_mp_toom_mul
776 #define TclBN_mp_toom_mul \
777 (tclTomMathStubsPtr->tclBN_mp_toom_mul) /* 55 */
778 #endif
779 #ifndef TclBN_mp_toom_sqr
780 #define TclBN_mp_toom_sqr \
781 (tclTomMathStubsPtr->tclBN_mp_toom_sqr) /* 56 */
782 #endif
783 #ifndef TclBN_s_mp_add
784 #define TclBN_s_mp_add \
785 (tclTomMathStubsPtr->tclBN_s_mp_add) /* 57 */
786 #endif
787 #ifndef TclBN_s_mp_mul_digs
788 #define TclBN_s_mp_mul_digs \
789 (tclTomMathStubsPtr->tclBN_s_mp_mul_digs) /* 58 */
790 #endif
791 #ifndef TclBN_s_mp_sqr
792 #define TclBN_s_mp_sqr \
793 (tclTomMathStubsPtr->tclBN_s_mp_sqr) /* 59 */
794 #endif
795 #ifndef TclBN_s_mp_sub
796 #define TclBN_s_mp_sub \
797 (tclTomMathStubsPtr->tclBN_s_mp_sub) /* 60 */
798 #endif
799 #ifndef TclBN_mp_init_set_int
800 #define TclBN_mp_init_set_int \
801 (tclTomMathStubsPtr->tclBN_mp_init_set_int) /* 61 */
802 #endif
803 #ifndef TclBN_mp_set_int
804 #define TclBN_mp_set_int \
805 (tclTomMathStubsPtr->tclBN_mp_set_int) /* 62 */
806 #endif
807 #ifndef TclBN_mp_cnt_lsb
808 #define TclBN_mp_cnt_lsb \
809 (tclTomMathStubsPtr->tclBN_mp_cnt_lsb) /* 63 */
810 #endif
812 #endif /* defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) */
814 /* !END!: Do not edit above this line. */
816 #undef TCL_STORAGE_CLASS
817 #define TCL_STORAGE_CLASS DLLIMPORT
819 #endif /* _TCLINTDECLS */