2 *----------------------------------------------------------------------
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
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
120 # define TCL_STORAGE_CLASS DLLEXPORT
122 # ifdef USE_TCL_STUBS
123 # define TCL_STORAGE_CLASS
125 # define TCL_STORAGE_CLASS DLLIMPORT
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
144 EXTERN
int TclBN_epoch(void);
146 #ifndef TclBN_revision_TCL_DECLARED
147 #define TclBN_revision_TCL_DECLARED
149 EXTERN
int TclBN_revision(void);
151 #ifndef TclBN_mp_add_TCL_DECLARED
152 #define TclBN_mp_add_TCL_DECLARED
154 EXTERN
int TclBN_mp_add(mp_int
*a
, mp_int
*b
, mp_int
*c
);
156 #ifndef TclBN_mp_add_d_TCL_DECLARED
157 #define TclBN_mp_add_d_TCL_DECLARED
159 EXTERN
int TclBN_mp_add_d(mp_int
*a
, mp_digit b
, mp_int
*c
);
161 #ifndef TclBN_mp_and_TCL_DECLARED
162 #define TclBN_mp_and_TCL_DECLARED
164 EXTERN
int TclBN_mp_and(mp_int
*a
, mp_int
*b
, mp_int
*c
);
166 #ifndef TclBN_mp_clamp_TCL_DECLARED
167 #define TclBN_mp_clamp_TCL_DECLARED
169 EXTERN
void TclBN_mp_clamp(mp_int
*a
);
171 #ifndef TclBN_mp_clear_TCL_DECLARED
172 #define TclBN_mp_clear_TCL_DECLARED
174 EXTERN
void TclBN_mp_clear(mp_int
*a
);
176 #ifndef TclBN_mp_clear_multi_TCL_DECLARED
177 #define TclBN_mp_clear_multi_TCL_DECLARED
179 EXTERN
void TclBN_mp_clear_multi(mp_int
*a
, ...);
181 #ifndef TclBN_mp_cmp_TCL_DECLARED
182 #define TclBN_mp_cmp_TCL_DECLARED
184 EXTERN
int TclBN_mp_cmp(mp_int
*a
, mp_int
*b
);
186 #ifndef TclBN_mp_cmp_d_TCL_DECLARED
187 #define TclBN_mp_cmp_d_TCL_DECLARED
189 EXTERN
int TclBN_mp_cmp_d(mp_int
*a
, mp_digit b
);
191 #ifndef TclBN_mp_cmp_mag_TCL_DECLARED
192 #define TclBN_mp_cmp_mag_TCL_DECLARED
194 EXTERN
int TclBN_mp_cmp_mag(mp_int
*a
, mp_int
*b
);
196 #ifndef TclBN_mp_copy_TCL_DECLARED
197 #define TclBN_mp_copy_TCL_DECLARED
199 EXTERN
int TclBN_mp_copy(mp_int
*a
, mp_int
*b
);
201 #ifndef TclBN_mp_count_bits_TCL_DECLARED
202 #define TclBN_mp_count_bits_TCL_DECLARED
204 EXTERN
int TclBN_mp_count_bits(mp_int
*a
);
206 #ifndef TclBN_mp_div_TCL_DECLARED
207 #define TclBN_mp_div_TCL_DECLARED
209 EXTERN
int TclBN_mp_div(mp_int
*a
, mp_int
*b
, mp_int
*q
,
212 #ifndef TclBN_mp_div_d_TCL_DECLARED
213 #define TclBN_mp_div_d_TCL_DECLARED
215 EXTERN
int TclBN_mp_div_d(mp_int
*a
, mp_digit b
, mp_int
*q
,
218 #ifndef TclBN_mp_div_2_TCL_DECLARED
219 #define TclBN_mp_div_2_TCL_DECLARED
221 EXTERN
int TclBN_mp_div_2(mp_int
*a
, mp_int
*q
);
223 #ifndef TclBN_mp_div_2d_TCL_DECLARED
224 #define TclBN_mp_div_2d_TCL_DECLARED
226 EXTERN
int TclBN_mp_div_2d(mp_int
*a
, int b
, mp_int
*q
,
229 #ifndef TclBN_mp_div_3_TCL_DECLARED
230 #define TclBN_mp_div_3_TCL_DECLARED
232 EXTERN
int TclBN_mp_div_3(mp_int
*a
, mp_int
*q
, mp_digit
*r
);
234 #ifndef TclBN_mp_exch_TCL_DECLARED
235 #define TclBN_mp_exch_TCL_DECLARED
237 EXTERN
void TclBN_mp_exch(mp_int
*a
, mp_int
*b
);
239 #ifndef TclBN_mp_expt_d_TCL_DECLARED
240 #define TclBN_mp_expt_d_TCL_DECLARED
242 EXTERN
int TclBN_mp_expt_d(mp_int
*a
, mp_digit b
, mp_int
*c
);
244 #ifndef TclBN_mp_grow_TCL_DECLARED
245 #define TclBN_mp_grow_TCL_DECLARED
247 EXTERN
int TclBN_mp_grow(mp_int
*a
, int size
);
249 #ifndef TclBN_mp_init_TCL_DECLARED
250 #define TclBN_mp_init_TCL_DECLARED
252 EXTERN
int TclBN_mp_init(mp_int
*a
);
254 #ifndef TclBN_mp_init_copy_TCL_DECLARED
255 #define TclBN_mp_init_copy_TCL_DECLARED
257 EXTERN
int TclBN_mp_init_copy(mp_int
*a
, mp_int
*b
);
259 #ifndef TclBN_mp_init_multi_TCL_DECLARED
260 #define TclBN_mp_init_multi_TCL_DECLARED
262 EXTERN
int TclBN_mp_init_multi(mp_int
*a
, ...);
264 #ifndef TclBN_mp_init_set_TCL_DECLARED
265 #define TclBN_mp_init_set_TCL_DECLARED
267 EXTERN
int TclBN_mp_init_set(mp_int
*a
, mp_digit b
);
269 #ifndef TclBN_mp_init_size_TCL_DECLARED
270 #define TclBN_mp_init_size_TCL_DECLARED
272 EXTERN
int TclBN_mp_init_size(mp_int
*a
, int size
);
274 #ifndef TclBN_mp_lshd_TCL_DECLARED
275 #define TclBN_mp_lshd_TCL_DECLARED
277 EXTERN
int TclBN_mp_lshd(mp_int
*a
, int shift
);
279 #ifndef TclBN_mp_mod_TCL_DECLARED
280 #define TclBN_mp_mod_TCL_DECLARED
282 EXTERN
int TclBN_mp_mod(mp_int
*a
, mp_int
*b
, mp_int
*r
);
284 #ifndef TclBN_mp_mod_2d_TCL_DECLARED
285 #define TclBN_mp_mod_2d_TCL_DECLARED
287 EXTERN
int TclBN_mp_mod_2d(mp_int
*a
, int b
, mp_int
*r
);
289 #ifndef TclBN_mp_mul_TCL_DECLARED
290 #define TclBN_mp_mul_TCL_DECLARED
292 EXTERN
int TclBN_mp_mul(mp_int
*a
, mp_int
*b
, mp_int
*p
);
294 #ifndef TclBN_mp_mul_d_TCL_DECLARED
295 #define TclBN_mp_mul_d_TCL_DECLARED
297 EXTERN
int TclBN_mp_mul_d(mp_int
*a
, mp_digit b
, mp_int
*p
);
299 #ifndef TclBN_mp_mul_2_TCL_DECLARED
300 #define TclBN_mp_mul_2_TCL_DECLARED
302 EXTERN
int TclBN_mp_mul_2(mp_int
*a
, mp_int
*p
);
304 #ifndef TclBN_mp_mul_2d_TCL_DECLARED
305 #define TclBN_mp_mul_2d_TCL_DECLARED
307 EXTERN
int TclBN_mp_mul_2d(mp_int
*a
, int d
, mp_int
*p
);
309 #ifndef TclBN_mp_neg_TCL_DECLARED
310 #define TclBN_mp_neg_TCL_DECLARED
312 EXTERN
int TclBN_mp_neg(mp_int
*a
, mp_int
*b
);
314 #ifndef TclBN_mp_or_TCL_DECLARED
315 #define TclBN_mp_or_TCL_DECLARED
317 EXTERN
int TclBN_mp_or(mp_int
*a
, mp_int
*b
, mp_int
*c
);
319 #ifndef TclBN_mp_radix_size_TCL_DECLARED
320 #define TclBN_mp_radix_size_TCL_DECLARED
322 EXTERN
int TclBN_mp_radix_size(mp_int
*a
, int radix
, int *size
);
324 #ifndef TclBN_mp_read_radix_TCL_DECLARED
325 #define TclBN_mp_read_radix_TCL_DECLARED
327 EXTERN
int TclBN_mp_read_radix(mp_int
*a
, CONST
char *str
,
330 #ifndef TclBN_mp_rshd_TCL_DECLARED
331 #define TclBN_mp_rshd_TCL_DECLARED
333 EXTERN
void TclBN_mp_rshd(mp_int
*a
, int shift
);
335 #ifndef TclBN_mp_shrink_TCL_DECLARED
336 #define TclBN_mp_shrink_TCL_DECLARED
338 EXTERN
int TclBN_mp_shrink(mp_int
*a
);
340 #ifndef TclBN_mp_set_TCL_DECLARED
341 #define TclBN_mp_set_TCL_DECLARED
343 EXTERN
void TclBN_mp_set(mp_int
*a
, mp_digit b
);
345 #ifndef TclBN_mp_sqr_TCL_DECLARED
346 #define TclBN_mp_sqr_TCL_DECLARED
348 EXTERN
int TclBN_mp_sqr(mp_int
*a
, mp_int
*b
);
350 #ifndef TclBN_mp_sqrt_TCL_DECLARED
351 #define TclBN_mp_sqrt_TCL_DECLARED
353 EXTERN
int TclBN_mp_sqrt(mp_int
*a
, mp_int
*b
);
355 #ifndef TclBN_mp_sub_TCL_DECLARED
356 #define TclBN_mp_sub_TCL_DECLARED
358 EXTERN
int TclBN_mp_sub(mp_int
*a
, mp_int
*b
, mp_int
*c
);
360 #ifndef TclBN_mp_sub_d_TCL_DECLARED
361 #define TclBN_mp_sub_d_TCL_DECLARED
363 EXTERN
int TclBN_mp_sub_d(mp_int
*a
, mp_digit b
, mp_int
*c
);
365 #ifndef TclBN_mp_to_unsigned_bin_TCL_DECLARED
366 #define TclBN_mp_to_unsigned_bin_TCL_DECLARED
368 EXTERN
int TclBN_mp_to_unsigned_bin(mp_int
*a
, unsigned char *b
);
370 #ifndef TclBN_mp_to_unsigned_bin_n_TCL_DECLARED
371 #define TclBN_mp_to_unsigned_bin_n_TCL_DECLARED
373 EXTERN
int TclBN_mp_to_unsigned_bin_n(mp_int
*a
,
374 unsigned char *b
, unsigned long *outlen
);
376 #ifndef TclBN_mp_toradix_n_TCL_DECLARED
377 #define TclBN_mp_toradix_n_TCL_DECLARED
379 EXTERN
int TclBN_mp_toradix_n(mp_int
*a
, char *str
, int radix
,
382 #ifndef TclBN_mp_unsigned_bin_size_TCL_DECLARED
383 #define TclBN_mp_unsigned_bin_size_TCL_DECLARED
385 EXTERN
int TclBN_mp_unsigned_bin_size(mp_int
*a
);
387 #ifndef TclBN_mp_xor_TCL_DECLARED
388 #define TclBN_mp_xor_TCL_DECLARED
390 EXTERN
int TclBN_mp_xor(mp_int
*a
, mp_int
*b
, mp_int
*c
);
392 #ifndef TclBN_mp_zero_TCL_DECLARED
393 #define TclBN_mp_zero_TCL_DECLARED
395 EXTERN
void TclBN_mp_zero(mp_int
*a
);
397 #ifndef TclBN_reverse_TCL_DECLARED
398 #define TclBN_reverse_TCL_DECLARED
400 EXTERN
void TclBN_reverse(unsigned char *s
, int len
);
402 #ifndef TclBN_fast_s_mp_mul_digs_TCL_DECLARED
403 #define TclBN_fast_s_mp_mul_digs_TCL_DECLARED
405 EXTERN
int TclBN_fast_s_mp_mul_digs(mp_int
*a
, mp_int
*b
,
406 mp_int
*c
, int digs
);
408 #ifndef TclBN_fast_s_mp_sqr_TCL_DECLARED
409 #define TclBN_fast_s_mp_sqr_TCL_DECLARED
411 EXTERN
int TclBN_fast_s_mp_sqr(mp_int
*a
, mp_int
*b
);
413 #ifndef TclBN_mp_karatsuba_mul_TCL_DECLARED
414 #define TclBN_mp_karatsuba_mul_TCL_DECLARED
416 EXTERN
int TclBN_mp_karatsuba_mul(mp_int
*a
, mp_int
*b
,
419 #ifndef TclBN_mp_karatsuba_sqr_TCL_DECLARED
420 #define TclBN_mp_karatsuba_sqr_TCL_DECLARED
422 EXTERN
int TclBN_mp_karatsuba_sqr(mp_int
*a
, mp_int
*b
);
424 #ifndef TclBN_mp_toom_mul_TCL_DECLARED
425 #define TclBN_mp_toom_mul_TCL_DECLARED
427 EXTERN
int TclBN_mp_toom_mul(mp_int
*a
, mp_int
*b
, mp_int
*c
);
429 #ifndef TclBN_mp_toom_sqr_TCL_DECLARED
430 #define TclBN_mp_toom_sqr_TCL_DECLARED
432 EXTERN
int TclBN_mp_toom_sqr(mp_int
*a
, mp_int
*b
);
434 #ifndef TclBN_s_mp_add_TCL_DECLARED
435 #define TclBN_s_mp_add_TCL_DECLARED
437 EXTERN
int TclBN_s_mp_add(mp_int
*a
, mp_int
*b
, mp_int
*c
);
439 #ifndef TclBN_s_mp_mul_digs_TCL_DECLARED
440 #define TclBN_s_mp_mul_digs_TCL_DECLARED
442 EXTERN
int TclBN_s_mp_mul_digs(mp_int
*a
, mp_int
*b
, mp_int
*c
,
445 #ifndef TclBN_s_mp_sqr_TCL_DECLARED
446 #define TclBN_s_mp_sqr_TCL_DECLARED
448 EXTERN
int TclBN_s_mp_sqr(mp_int
*a
, mp_int
*b
);
450 #ifndef TclBN_s_mp_sub_TCL_DECLARED
451 #define TclBN_s_mp_sub_TCL_DECLARED
453 EXTERN
int TclBN_s_mp_sub(mp_int
*a
, mp_int
*b
, mp_int
*c
);
455 #ifndef TclBN_mp_init_set_int_TCL_DECLARED
456 #define TclBN_mp_init_set_int_TCL_DECLARED
458 EXTERN
int TclBN_mp_init_set_int(mp_int
*a
, unsigned long i
);
460 #ifndef TclBN_mp_set_int_TCL_DECLARED
461 #define TclBN_mp_set_int_TCL_DECLARED
463 EXTERN
int TclBN_mp_set_int(mp_int
*a
, unsigned long i
);
465 #ifndef TclBN_mp_cnt_lsb_TCL_DECLARED
466 #define TclBN_mp_cnt_lsb_TCL_DECLARED
468 EXTERN
int TclBN_mp_cnt_lsb(mp_int
*a
);
471 typedef struct TclTomMathStubs
{
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 */
544 extern TclTomMathStubs
*tclTomMathStubsPtr
;
549 #if defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS)
552 * Inline function declarations:
556 #define TclBN_epoch \
557 (tclTomMathStubsPtr->tclBN_epoch) /* 0 */
559 #ifndef TclBN_revision
560 #define TclBN_revision \
561 (tclTomMathStubsPtr->tclBN_revision) /* 1 */
564 #define TclBN_mp_add \
565 (tclTomMathStubsPtr->tclBN_mp_add) /* 2 */
567 #ifndef TclBN_mp_add_d
568 #define TclBN_mp_add_d \
569 (tclTomMathStubsPtr->tclBN_mp_add_d) /* 3 */
572 #define TclBN_mp_and \
573 (tclTomMathStubsPtr->tclBN_mp_and) /* 4 */
575 #ifndef TclBN_mp_clamp
576 #define TclBN_mp_clamp \
577 (tclTomMathStubsPtr->tclBN_mp_clamp) /* 5 */
579 #ifndef TclBN_mp_clear
580 #define TclBN_mp_clear \
581 (tclTomMathStubsPtr->tclBN_mp_clear) /* 6 */
583 #ifndef TclBN_mp_clear_multi
584 #define TclBN_mp_clear_multi \
585 (tclTomMathStubsPtr->tclBN_mp_clear_multi) /* 7 */
588 #define TclBN_mp_cmp \
589 (tclTomMathStubsPtr->tclBN_mp_cmp) /* 8 */
591 #ifndef TclBN_mp_cmp_d
592 #define TclBN_mp_cmp_d \
593 (tclTomMathStubsPtr->tclBN_mp_cmp_d) /* 9 */
595 #ifndef TclBN_mp_cmp_mag
596 #define TclBN_mp_cmp_mag \
597 (tclTomMathStubsPtr->tclBN_mp_cmp_mag) /* 10 */
599 #ifndef TclBN_mp_copy
600 #define TclBN_mp_copy \
601 (tclTomMathStubsPtr->tclBN_mp_copy) /* 11 */
603 #ifndef TclBN_mp_count_bits
604 #define TclBN_mp_count_bits \
605 (tclTomMathStubsPtr->tclBN_mp_count_bits) /* 12 */
608 #define TclBN_mp_div \
609 (tclTomMathStubsPtr->tclBN_mp_div) /* 13 */
611 #ifndef TclBN_mp_div_d
612 #define TclBN_mp_div_d \
613 (tclTomMathStubsPtr->tclBN_mp_div_d) /* 14 */
615 #ifndef TclBN_mp_div_2
616 #define TclBN_mp_div_2 \
617 (tclTomMathStubsPtr->tclBN_mp_div_2) /* 15 */
619 #ifndef TclBN_mp_div_2d
620 #define TclBN_mp_div_2d \
621 (tclTomMathStubsPtr->tclBN_mp_div_2d) /* 16 */
623 #ifndef TclBN_mp_div_3
624 #define TclBN_mp_div_3 \
625 (tclTomMathStubsPtr->tclBN_mp_div_3) /* 17 */
627 #ifndef TclBN_mp_exch
628 #define TclBN_mp_exch \
629 (tclTomMathStubsPtr->tclBN_mp_exch) /* 18 */
631 #ifndef TclBN_mp_expt_d
632 #define TclBN_mp_expt_d \
633 (tclTomMathStubsPtr->tclBN_mp_expt_d) /* 19 */
635 #ifndef TclBN_mp_grow
636 #define TclBN_mp_grow \
637 (tclTomMathStubsPtr->tclBN_mp_grow) /* 20 */
639 #ifndef TclBN_mp_init
640 #define TclBN_mp_init \
641 (tclTomMathStubsPtr->tclBN_mp_init) /* 21 */
643 #ifndef TclBN_mp_init_copy
644 #define TclBN_mp_init_copy \
645 (tclTomMathStubsPtr->tclBN_mp_init_copy) /* 22 */
647 #ifndef TclBN_mp_init_multi
648 #define TclBN_mp_init_multi \
649 (tclTomMathStubsPtr->tclBN_mp_init_multi) /* 23 */
651 #ifndef TclBN_mp_init_set
652 #define TclBN_mp_init_set \
653 (tclTomMathStubsPtr->tclBN_mp_init_set) /* 24 */
655 #ifndef TclBN_mp_init_size
656 #define TclBN_mp_init_size \
657 (tclTomMathStubsPtr->tclBN_mp_init_size) /* 25 */
659 #ifndef TclBN_mp_lshd
660 #define TclBN_mp_lshd \
661 (tclTomMathStubsPtr->tclBN_mp_lshd) /* 26 */
664 #define TclBN_mp_mod \
665 (tclTomMathStubsPtr->tclBN_mp_mod) /* 27 */
667 #ifndef TclBN_mp_mod_2d
668 #define TclBN_mp_mod_2d \
669 (tclTomMathStubsPtr->tclBN_mp_mod_2d) /* 28 */
672 #define TclBN_mp_mul \
673 (tclTomMathStubsPtr->tclBN_mp_mul) /* 29 */
675 #ifndef TclBN_mp_mul_d
676 #define TclBN_mp_mul_d \
677 (tclTomMathStubsPtr->tclBN_mp_mul_d) /* 30 */
679 #ifndef TclBN_mp_mul_2
680 #define TclBN_mp_mul_2 \
681 (tclTomMathStubsPtr->tclBN_mp_mul_2) /* 31 */
683 #ifndef TclBN_mp_mul_2d
684 #define TclBN_mp_mul_2d \
685 (tclTomMathStubsPtr->tclBN_mp_mul_2d) /* 32 */
688 #define TclBN_mp_neg \
689 (tclTomMathStubsPtr->tclBN_mp_neg) /* 33 */
692 #define TclBN_mp_or \
693 (tclTomMathStubsPtr->tclBN_mp_or) /* 34 */
695 #ifndef TclBN_mp_radix_size
696 #define TclBN_mp_radix_size \
697 (tclTomMathStubsPtr->tclBN_mp_radix_size) /* 35 */
699 #ifndef TclBN_mp_read_radix
700 #define TclBN_mp_read_radix \
701 (tclTomMathStubsPtr->tclBN_mp_read_radix) /* 36 */
703 #ifndef TclBN_mp_rshd
704 #define TclBN_mp_rshd \
705 (tclTomMathStubsPtr->tclBN_mp_rshd) /* 37 */
707 #ifndef TclBN_mp_shrink
708 #define TclBN_mp_shrink \
709 (tclTomMathStubsPtr->tclBN_mp_shrink) /* 38 */
712 #define TclBN_mp_set \
713 (tclTomMathStubsPtr->tclBN_mp_set) /* 39 */
716 #define TclBN_mp_sqr \
717 (tclTomMathStubsPtr->tclBN_mp_sqr) /* 40 */
719 #ifndef TclBN_mp_sqrt
720 #define TclBN_mp_sqrt \
721 (tclTomMathStubsPtr->tclBN_mp_sqrt) /* 41 */
724 #define TclBN_mp_sub \
725 (tclTomMathStubsPtr->tclBN_mp_sub) /* 42 */
727 #ifndef TclBN_mp_sub_d
728 #define TclBN_mp_sub_d \
729 (tclTomMathStubsPtr->tclBN_mp_sub_d) /* 43 */
731 #ifndef TclBN_mp_to_unsigned_bin
732 #define TclBN_mp_to_unsigned_bin \
733 (tclTomMathStubsPtr->tclBN_mp_to_unsigned_bin) /* 44 */
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 */
739 #ifndef TclBN_mp_toradix_n
740 #define TclBN_mp_toradix_n \
741 (tclTomMathStubsPtr->tclBN_mp_toradix_n) /* 46 */
743 #ifndef TclBN_mp_unsigned_bin_size
744 #define TclBN_mp_unsigned_bin_size \
745 (tclTomMathStubsPtr->tclBN_mp_unsigned_bin_size) /* 47 */
748 #define TclBN_mp_xor \
749 (tclTomMathStubsPtr->tclBN_mp_xor) /* 48 */
751 #ifndef TclBN_mp_zero
752 #define TclBN_mp_zero \
753 (tclTomMathStubsPtr->tclBN_mp_zero) /* 49 */
755 #ifndef TclBN_reverse
756 #define TclBN_reverse \
757 (tclTomMathStubsPtr->tclBN_reverse) /* 50 */
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 */
763 #ifndef TclBN_fast_s_mp_sqr
764 #define TclBN_fast_s_mp_sqr \
765 (tclTomMathStubsPtr->tclBN_fast_s_mp_sqr) /* 52 */
767 #ifndef TclBN_mp_karatsuba_mul
768 #define TclBN_mp_karatsuba_mul \
769 (tclTomMathStubsPtr->tclBN_mp_karatsuba_mul) /* 53 */
771 #ifndef TclBN_mp_karatsuba_sqr
772 #define TclBN_mp_karatsuba_sqr \
773 (tclTomMathStubsPtr->tclBN_mp_karatsuba_sqr) /* 54 */
775 #ifndef TclBN_mp_toom_mul
776 #define TclBN_mp_toom_mul \
777 (tclTomMathStubsPtr->tclBN_mp_toom_mul) /* 55 */
779 #ifndef TclBN_mp_toom_sqr
780 #define TclBN_mp_toom_sqr \
781 (tclTomMathStubsPtr->tclBN_mp_toom_sqr) /* 56 */
783 #ifndef TclBN_s_mp_add
784 #define TclBN_s_mp_add \
785 (tclTomMathStubsPtr->tclBN_s_mp_add) /* 57 */
787 #ifndef TclBN_s_mp_mul_digs
788 #define TclBN_s_mp_mul_digs \
789 (tclTomMathStubsPtr->tclBN_s_mp_mul_digs) /* 58 */
791 #ifndef TclBN_s_mp_sqr
792 #define TclBN_s_mp_sqr \
793 (tclTomMathStubsPtr->tclBN_s_mp_sqr) /* 59 */
795 #ifndef TclBN_s_mp_sub
796 #define TclBN_s_mp_sub \
797 (tclTomMathStubsPtr->tclBN_s_mp_sub) /* 60 */
799 #ifndef TclBN_mp_init_set_int
800 #define TclBN_mp_init_set_int \
801 (tclTomMathStubsPtr->tclBN_mp_init_set_int) /* 61 */
803 #ifndef TclBN_mp_set_int
804 #define TclBN_mp_set_int \
805 (tclTomMathStubsPtr->tclBN_mp_set_int) /* 62 */
807 #ifndef TclBN_mp_cnt_lsb
808 #define TclBN_mp_cnt_lsb \
809 (tclTomMathStubsPtr->tclBN_mp_cnt_lsb) /* 63 */
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 */