tclTomMathDecls.h

Go to the documentation of this file.
00001 /*
00002  *----------------------------------------------------------------------
00003  *
00004  * tclTomMathDecls.h --
00005  *
00006  *      This file contains the declarations for the 'libtommath'
00007  *      functions that are exported by the Tcl library.
00008  *
00009  * Copyright (c) 2005 by Kevin B. Kenny.  All rights reserved.
00010  *
00011  * See the file "license.terms" for information on usage and redistribution
00012  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
00013  *
00014  * RCS: @(#) $Id: tclTomMathDecls.h,v 1.2 2006/11/15 14:58:27 dgp Exp $
00015  */
00016 
00017 #ifndef _TCLTOMMATHDECLS
00018 #define _TCLTOMMATHDECLS
00019 
00020 #include "tcl.h"
00021 
00022 /*
00023  * Define the version of the Stubs table that's exported for tommath
00024  */
00025 
00026 #define TCLTOMMATH_EPOCH 0
00027 #define TCLTOMMATH_REVISION 0
00028 
00029 #define Tcl_TomMath_InitStubs(interp,version) \
00030     (TclTomMathInitializeStubs((interp),(version),\
00031                                TCLTOMMATH_EPOCH,TCLTOMMATH_REVISION))
00032 
00033 /* Define custom memory allocation for libtommath */
00034 
00035 /* MODULE_SCOPE void* TclBNAlloc( size_t ); */
00036 #define TclBNAlloc(s) ((void*)ckalloc((size_t)(s)))
00037 /* MODULE_SCOPE void* TclBNRealloc( void*, size_t ); */
00038 #define TclBNRealloc(x,s) ((void*)ckrealloc((char*)(x),(size_t)(s)))
00039 /* MODULE_SCOPE void  TclBNFree( void* ); */
00040 #define TclBNFree(x) (ckfree((char*)(x)))
00041 /* MODULE_SCOPE void* TclBNCalloc( size_t, size_t ); */
00042 /* unused - no macro */
00043 
00044 #define XMALLOC(x) TclBNAlloc(x)
00045 #define XFREE(x) TclBNFree(x)
00046 #define XREALLOC(x,n) TclBNRealloc(x,n)
00047 #define XCALLOC(n,x) TclBNCalloc(n,x)
00048 
00049 /* Rename the global symbols in libtommath to avoid linkage conflicts */
00050 
00051 #define KARATSUBA_MUL_CUTOFF TclBNKaratsubaMulCutoff
00052 #define KARATSUBA_SQR_CUTOFF TclBNKaratsubaSqrCutoff
00053 #define TOOM_MUL_CUTOFF TclBNToomMulCutoff
00054 #define TOOM_SQR_CUTOFF TclBNToomSqrCutoff
00055 
00056 #define bn_reverse TclBN_reverse
00057 #define fast_s_mp_mul_digs TclBN_fast_s_mp_mul_digs
00058 #define fast_s_mp_sqr TclBN_fast_s_mp_sqr
00059 #define mp_add TclBN_mp_add
00060 #define mp_add_d TclBN_mp_add_d
00061 #define mp_and TclBN_mp_and
00062 #define mp_clamp TclBN_mp_clamp
00063 #define mp_clear TclBN_mp_clear
00064 #define mp_clear_multi TclBN_mp_clear_multi
00065 #define mp_cmp TclBN_mp_cmp
00066 #define mp_cmp_d TclBN_mp_cmp_d
00067 #define mp_cmp_mag TclBN_mp_cmp_mag
00068 #define mp_copy TclBN_mp_copy
00069 #define mp_count_bits TclBN_mp_count_bits
00070 #define mp_div TclBN_mp_div
00071 #define mp_div_2 TclBN_mp_div_2
00072 #define mp_div_2d TclBN_mp_div_2d
00073 #define mp_div_3 TclBN_mp_div_3
00074 #define mp_div_d TclBN_mp_div_d
00075 #define mp_exch TclBN_mp_exch
00076 #define mp_expt_d TclBN_mp_expt_d
00077 #define mp_grow TclBN_mp_grow
00078 #define mp_init TclBN_mp_init
00079 #define mp_init_copy TclBN_mp_init_copy
00080 #define mp_init_multi TclBN_mp_init_multi
00081 #define mp_init_set TclBN_mp_init_set
00082 #define mp_init_size TclBN_mp_init_size
00083 #define mp_karatsuba_mul TclBN_mp_karatsuba_mul
00084 #define mp_karatsuba_sqr TclBN_mp_karatsuba_sqr
00085 #define mp_lshd TclBN_mp_lshd
00086 #define mp_mod TclBN_mp_mod
00087 #define mp_mod_2d TclBN_mp_mod_2d
00088 #define mp_mul TclBN_mp_mul
00089 #define mp_mul_2 TclBN_mp_mul_2
00090 #define mp_mul_2d TclBN_mp_mul_2d
00091 #define mp_mul_d TclBN_mp_mul_d
00092 #define mp_neg TclBN_mp_neg
00093 #define mp_or TclBN_mp_or
00094 #define mp_radix_size TclBN_mp_radix_size
00095 #define mp_read_radix TclBN_mp_read_radix
00096 #define mp_rshd TclBN_mp_rshd
00097 #define mp_s_rmap TclBNMpSRmap
00098 #define mp_set TclBN_mp_set
00099 #define mp_shrink TclBN_mp_shrink
00100 #define mp_sqr TclBN_mp_sqr
00101 #define mp_sqrt TclBN_mp_sqrt
00102 #define mp_sub TclBN_mp_sub
00103 #define mp_sub_d TclBN_mp_sub_d
00104 #define mp_to_unsigned_bin TclBN_mp_to_unsigned_bin
00105 #define mp_to_unsigned_bin_n TclBN_mp_to_unsigned_bin_n
00106 #define mp_toom_mul TclBN_mp_toom_mul
00107 #define mp_toom_sqr TclBN_mp_toom_sqr
00108 #define mp_toradix_n TclBN_mp_toradix_n
00109 #define mp_unsigned_bin_size TclBN_mp_unsigned_bin_size
00110 #define mp_xor TclBN_mp_xor
00111 #define mp_zero TclBN_mp_zero
00112 #define s_mp_add TclBN_s_mp_add
00113 #define s_mp_mul_digs TclBN_s_mp_mul_digs
00114 #define s_mp_sqr TclBN_s_mp_sqr
00115 #define s_mp_sub TclBN_s_mp_sub
00116 
00117 #undef TCL_STORAGE_CLASS
00118 #ifdef BUILD_tcl
00119 #   define TCL_STORAGE_CLASS DLLEXPORT
00120 #else
00121 #   ifdef USE_TCL_STUBS
00122 #      define TCL_STORAGE_CLASS
00123 #   else
00124 #      define TCL_STORAGE_CLASS DLLIMPORT
00125 #   endif
00126 #endif
00127 
00128 /*
00129  * WARNING: This file is automatically generated by the tools/genStubs.tcl
00130  * script.  Any modifications to the function declarations below should be made
00131  * in the generic/tclInt.decls script.
00132  */
00133 
00134 /* !BEGIN!: Do not edit below this line. */
00135 
00136 /*
00137  * Exported function declarations:
00138  */
00139 
00140 #ifndef TclBN_epoch_TCL_DECLARED
00141 #define TclBN_epoch_TCL_DECLARED
00142 /* 0 */
00143 EXTERN int              TclBN_epoch (void);
00144 #endif
00145 #ifndef TclBN_revision_TCL_DECLARED
00146 #define TclBN_revision_TCL_DECLARED
00147 /* 1 */
00148 EXTERN int              TclBN_revision (void);
00149 #endif
00150 #ifndef TclBN_mp_add_TCL_DECLARED
00151 #define TclBN_mp_add_TCL_DECLARED
00152 /* 2 */
00153 EXTERN int              TclBN_mp_add (mp_int* a, mp_int* b, mp_int* c);
00154 #endif
00155 #ifndef TclBN_mp_add_d_TCL_DECLARED
00156 #define TclBN_mp_add_d_TCL_DECLARED
00157 /* 3 */
00158 EXTERN int              TclBN_mp_add_d (mp_int* a, mp_digit b, mp_int* c);
00159 #endif
00160 #ifndef TclBN_mp_and_TCL_DECLARED
00161 #define TclBN_mp_and_TCL_DECLARED
00162 /* 4 */
00163 EXTERN int              TclBN_mp_and (mp_int* a, mp_int* b, mp_int* c);
00164 #endif
00165 #ifndef TclBN_mp_clamp_TCL_DECLARED
00166 #define TclBN_mp_clamp_TCL_DECLARED
00167 /* 5 */
00168 EXTERN void             TclBN_mp_clamp (mp_int* a);
00169 #endif
00170 #ifndef TclBN_mp_clear_TCL_DECLARED
00171 #define TclBN_mp_clear_TCL_DECLARED
00172 /* 6 */
00173 EXTERN void             TclBN_mp_clear (mp_int* a);
00174 #endif
00175 #ifndef TclBN_mp_clear_multi_TCL_DECLARED
00176 #define TclBN_mp_clear_multi_TCL_DECLARED
00177 /* 7 */
00178 EXTERN void             TclBN_mp_clear_multi (mp_int* a, ...);
00179 #endif
00180 #ifndef TclBN_mp_cmp_TCL_DECLARED
00181 #define TclBN_mp_cmp_TCL_DECLARED
00182 /* 8 */
00183 EXTERN int              TclBN_mp_cmp (mp_int* a, mp_int* b);
00184 #endif
00185 #ifndef TclBN_mp_cmp_d_TCL_DECLARED
00186 #define TclBN_mp_cmp_d_TCL_DECLARED
00187 /* 9 */
00188 EXTERN int              TclBN_mp_cmp_d (mp_int* a, mp_digit b);
00189 #endif
00190 #ifndef TclBN_mp_cmp_mag_TCL_DECLARED
00191 #define TclBN_mp_cmp_mag_TCL_DECLARED
00192 /* 10 */
00193 EXTERN int              TclBN_mp_cmp_mag (mp_int* a, mp_int* b);
00194 #endif
00195 #ifndef TclBN_mp_copy_TCL_DECLARED
00196 #define TclBN_mp_copy_TCL_DECLARED
00197 /* 11 */
00198 EXTERN int              TclBN_mp_copy (mp_int* a, mp_int* b);
00199 #endif
00200 #ifndef TclBN_mp_count_bits_TCL_DECLARED
00201 #define TclBN_mp_count_bits_TCL_DECLARED
00202 /* 12 */
00203 EXTERN int              TclBN_mp_count_bits (mp_int* a);
00204 #endif
00205 #ifndef TclBN_mp_div_TCL_DECLARED
00206 #define TclBN_mp_div_TCL_DECLARED
00207 /* 13 */
00208 EXTERN int              TclBN_mp_div (mp_int* a, mp_int* b, mp_int* q, 
00209                                 mp_int* r);
00210 #endif
00211 #ifndef TclBN_mp_div_d_TCL_DECLARED
00212 #define TclBN_mp_div_d_TCL_DECLARED
00213 /* 14 */
00214 EXTERN int              TclBN_mp_div_d (mp_int* a, mp_digit b, mp_int* q, 
00215                                 mp_digit* r);
00216 #endif
00217 #ifndef TclBN_mp_div_2_TCL_DECLARED
00218 #define TclBN_mp_div_2_TCL_DECLARED
00219 /* 15 */
00220 EXTERN int              TclBN_mp_div_2 (mp_int* a, mp_int* q);
00221 #endif
00222 #ifndef TclBN_mp_div_2d_TCL_DECLARED
00223 #define TclBN_mp_div_2d_TCL_DECLARED
00224 /* 16 */
00225 EXTERN int              TclBN_mp_div_2d (mp_int* a, int b, mp_int* q, 
00226                                 mp_int* r);
00227 #endif
00228 #ifndef TclBN_mp_div_3_TCL_DECLARED
00229 #define TclBN_mp_div_3_TCL_DECLARED
00230 /* 17 */
00231 EXTERN int              TclBN_mp_div_3 (mp_int* a, mp_int* q, mp_digit* r);
00232 #endif
00233 #ifndef TclBN_mp_exch_TCL_DECLARED
00234 #define TclBN_mp_exch_TCL_DECLARED
00235 /* 18 */
00236 EXTERN void             TclBN_mp_exch (mp_int* a, mp_int* b);
00237 #endif
00238 #ifndef TclBN_mp_expt_d_TCL_DECLARED
00239 #define TclBN_mp_expt_d_TCL_DECLARED
00240 /* 19 */
00241 EXTERN int              TclBN_mp_expt_d (mp_int* a, mp_digit b, mp_int* c);
00242 #endif
00243 #ifndef TclBN_mp_grow_TCL_DECLARED
00244 #define TclBN_mp_grow_TCL_DECLARED
00245 /* 20 */
00246 EXTERN int              TclBN_mp_grow (mp_int* a, int size);
00247 #endif
00248 #ifndef TclBN_mp_init_TCL_DECLARED
00249 #define TclBN_mp_init_TCL_DECLARED
00250 /* 21 */
00251 EXTERN int              TclBN_mp_init (mp_int* a);
00252 #endif
00253 #ifndef TclBN_mp_init_copy_TCL_DECLARED
00254 #define TclBN_mp_init_copy_TCL_DECLARED
00255 /* 22 */
00256 EXTERN int              TclBN_mp_init_copy (mp_int * a, mp_int* b);
00257 #endif
00258 #ifndef TclBN_mp_init_multi_TCL_DECLARED
00259 #define TclBN_mp_init_multi_TCL_DECLARED
00260 /* 23 */
00261 EXTERN int              TclBN_mp_init_multi (mp_int* a, ...);
00262 #endif
00263 #ifndef TclBN_mp_init_set_TCL_DECLARED
00264 #define TclBN_mp_init_set_TCL_DECLARED
00265 /* 24 */
00266 EXTERN int              TclBN_mp_init_set (mp_int* a, mp_digit b);
00267 #endif
00268 #ifndef TclBN_mp_init_size_TCL_DECLARED
00269 #define TclBN_mp_init_size_TCL_DECLARED
00270 /* 25 */
00271 EXTERN int              TclBN_mp_init_size (mp_int* a, int size);
00272 #endif
00273 #ifndef TclBN_mp_lshd_TCL_DECLARED
00274 #define TclBN_mp_lshd_TCL_DECLARED
00275 /* 26 */
00276 EXTERN int              TclBN_mp_lshd (mp_int* a, int shift);
00277 #endif
00278 #ifndef TclBN_mp_mod_TCL_DECLARED
00279 #define TclBN_mp_mod_TCL_DECLARED
00280 /* 27 */
00281 EXTERN int              TclBN_mp_mod (mp_int* a, mp_int* b, mp_int* r);
00282 #endif
00283 #ifndef TclBN_mp_mod_2d_TCL_DECLARED
00284 #define TclBN_mp_mod_2d_TCL_DECLARED
00285 /* 28 */
00286 EXTERN int              TclBN_mp_mod_2d (mp_int* a, int b, mp_int* r);
00287 #endif
00288 #ifndef TclBN_mp_mul_TCL_DECLARED
00289 #define TclBN_mp_mul_TCL_DECLARED
00290 /* 29 */
00291 EXTERN int              TclBN_mp_mul (mp_int* a, mp_int* b, mp_int* p);
00292 #endif
00293 #ifndef TclBN_mp_mul_d_TCL_DECLARED
00294 #define TclBN_mp_mul_d_TCL_DECLARED
00295 /* 30 */
00296 EXTERN int              TclBN_mp_mul_d (mp_int* a, mp_digit b, mp_int* p);
00297 #endif
00298 #ifndef TclBN_mp_mul_2_TCL_DECLARED
00299 #define TclBN_mp_mul_2_TCL_DECLARED
00300 /* 31 */
00301 EXTERN int              TclBN_mp_mul_2 (mp_int* a, mp_int* p);
00302 #endif
00303 #ifndef TclBN_mp_mul_2d_TCL_DECLARED
00304 #define TclBN_mp_mul_2d_TCL_DECLARED
00305 /* 32 */
00306 EXTERN int              TclBN_mp_mul_2d (mp_int* a, int d, mp_int* p);
00307 #endif
00308 #ifndef TclBN_mp_neg_TCL_DECLARED
00309 #define TclBN_mp_neg_TCL_DECLARED
00310 /* 33 */
00311 EXTERN int              TclBN_mp_neg (mp_int* a, mp_int* b);
00312 #endif
00313 #ifndef TclBN_mp_or_TCL_DECLARED
00314 #define TclBN_mp_or_TCL_DECLARED
00315 /* 34 */
00316 EXTERN int              TclBN_mp_or (mp_int* a, mp_int* b, mp_int* c);
00317 #endif
00318 #ifndef TclBN_mp_radix_size_TCL_DECLARED
00319 #define TclBN_mp_radix_size_TCL_DECLARED
00320 /* 35 */
00321 EXTERN int              TclBN_mp_radix_size (mp_int* a, int radix, int* size);
00322 #endif
00323 #ifndef TclBN_mp_read_radix_TCL_DECLARED
00324 #define TclBN_mp_read_radix_TCL_DECLARED
00325 /* 36 */
00326 EXTERN int              TclBN_mp_read_radix (mp_int* a, const char* str, 
00327                                 int radix);
00328 #endif
00329 #ifndef TclBN_mp_rshd_TCL_DECLARED
00330 #define TclBN_mp_rshd_TCL_DECLARED
00331 /* 37 */
00332 EXTERN void             TclBN_mp_rshd (mp_int * a, int shift);
00333 #endif
00334 #ifndef TclBN_mp_shrink_TCL_DECLARED
00335 #define TclBN_mp_shrink_TCL_DECLARED
00336 /* 38 */
00337 EXTERN int              TclBN_mp_shrink (mp_int* a);
00338 #endif
00339 #ifndef TclBN_mp_set_TCL_DECLARED
00340 #define TclBN_mp_set_TCL_DECLARED
00341 /* 39 */
00342 EXTERN void             TclBN_mp_set (mp_int* a, mp_digit b);
00343 #endif
00344 #ifndef TclBN_mp_sqr_TCL_DECLARED
00345 #define TclBN_mp_sqr_TCL_DECLARED
00346 /* 40 */
00347 EXTERN int              TclBN_mp_sqr (mp_int* a, mp_int* b);
00348 #endif
00349 #ifndef TclBN_mp_sqrt_TCL_DECLARED
00350 #define TclBN_mp_sqrt_TCL_DECLARED
00351 /* 41 */
00352 EXTERN int              TclBN_mp_sqrt (mp_int* a, mp_int* b);
00353 #endif
00354 #ifndef TclBN_mp_sub_TCL_DECLARED
00355 #define TclBN_mp_sub_TCL_DECLARED
00356 /* 42 */
00357 EXTERN int              TclBN_mp_sub (mp_int* a, mp_int* b, mp_int* c);
00358 #endif
00359 #ifndef TclBN_mp_sub_d_TCL_DECLARED
00360 #define TclBN_mp_sub_d_TCL_DECLARED
00361 /* 43 */
00362 EXTERN int              TclBN_mp_sub_d (mp_int* a, mp_digit b, mp_int* c);
00363 #endif
00364 #ifndef TclBN_mp_to_unsigned_bin_TCL_DECLARED
00365 #define TclBN_mp_to_unsigned_bin_TCL_DECLARED
00366 /* 44 */
00367 EXTERN int              TclBN_mp_to_unsigned_bin (mp_int* a, 
00368                                 unsigned char* b);
00369 #endif
00370 #ifndef TclBN_mp_to_unsigned_bin_n_TCL_DECLARED
00371 #define TclBN_mp_to_unsigned_bin_n_TCL_DECLARED
00372 /* 45 */
00373 EXTERN int              TclBN_mp_to_unsigned_bin_n (mp_int* a, 
00374                                 unsigned char* b, unsigned long* outlen);
00375 #endif
00376 #ifndef TclBN_mp_toradix_n_TCL_DECLARED
00377 #define TclBN_mp_toradix_n_TCL_DECLARED
00378 /* 46 */
00379 EXTERN int              TclBN_mp_toradix_n (mp_int* a, char* str, int radix, 
00380                                 int maxlen);
00381 #endif
00382 #ifndef TclBN_mp_unsigned_bin_size_TCL_DECLARED
00383 #define TclBN_mp_unsigned_bin_size_TCL_DECLARED
00384 /* 47 */
00385 EXTERN int              TclBN_mp_unsigned_bin_size (mp_int* a);
00386 #endif
00387 #ifndef TclBN_mp_xor_TCL_DECLARED
00388 #define TclBN_mp_xor_TCL_DECLARED
00389 /* 48 */
00390 EXTERN int              TclBN_mp_xor (mp_int* a, mp_int* b, mp_int* c);
00391 #endif
00392 #ifndef TclBN_mp_zero_TCL_DECLARED
00393 #define TclBN_mp_zero_TCL_DECLARED
00394 /* 49 */
00395 EXTERN void             TclBN_mp_zero (mp_int* a);
00396 #endif
00397 #ifndef TclBN_reverse_TCL_DECLARED
00398 #define TclBN_reverse_TCL_DECLARED
00399 /* 50 */
00400 EXTERN void             TclBN_reverse (unsigned char* s, int len);
00401 #endif
00402 #ifndef TclBN_fast_s_mp_mul_digs_TCL_DECLARED
00403 #define TclBN_fast_s_mp_mul_digs_TCL_DECLARED
00404 /* 51 */
00405 EXTERN int              TclBN_fast_s_mp_mul_digs (mp_int * a, mp_int * b, 
00406                                 mp_int * c, int digs);
00407 #endif
00408 #ifndef TclBN_fast_s_mp_sqr_TCL_DECLARED
00409 #define TclBN_fast_s_mp_sqr_TCL_DECLARED
00410 /* 52 */
00411 EXTERN int              TclBN_fast_s_mp_sqr (mp_int* a, mp_int* b);
00412 #endif
00413 #ifndef TclBN_mp_karatsuba_mul_TCL_DECLARED
00414 #define TclBN_mp_karatsuba_mul_TCL_DECLARED
00415 /* 53 */
00416 EXTERN int              TclBN_mp_karatsuba_mul (mp_int* a, mp_int* b, 
00417                                 mp_int* c);
00418 #endif
00419 #ifndef TclBN_mp_karatsuba_sqr_TCL_DECLARED
00420 #define TclBN_mp_karatsuba_sqr_TCL_DECLARED
00421 /* 54 */
00422 EXTERN int              TclBN_mp_karatsuba_sqr (mp_int* a, mp_int* b);
00423 #endif
00424 #ifndef TclBN_mp_toom_mul_TCL_DECLARED
00425 #define TclBN_mp_toom_mul_TCL_DECLARED
00426 /* 55 */
00427 EXTERN int              TclBN_mp_toom_mul (mp_int* a, mp_int* b, mp_int* c);
00428 #endif
00429 #ifndef TclBN_mp_toom_sqr_TCL_DECLARED
00430 #define TclBN_mp_toom_sqr_TCL_DECLARED
00431 /* 56 */
00432 EXTERN int              TclBN_mp_toom_sqr (mp_int* a, mp_int* b);
00433 #endif
00434 #ifndef TclBN_s_mp_add_TCL_DECLARED
00435 #define TclBN_s_mp_add_TCL_DECLARED
00436 /* 57 */
00437 EXTERN int              TclBN_s_mp_add (mp_int* a, mp_int* b, mp_int* c);
00438 #endif
00439 #ifndef TclBN_s_mp_mul_digs_TCL_DECLARED
00440 #define TclBN_s_mp_mul_digs_TCL_DECLARED
00441 /* 58 */
00442 EXTERN int              TclBN_s_mp_mul_digs (mp_int* a, mp_int* b, mp_int* c, 
00443                                 int digs);
00444 #endif
00445 #ifndef TclBN_s_mp_sqr_TCL_DECLARED
00446 #define TclBN_s_mp_sqr_TCL_DECLARED
00447 /* 59 */
00448 EXTERN int              TclBN_s_mp_sqr (mp_int* a, mp_int* b);
00449 #endif
00450 #ifndef TclBN_s_mp_sub_TCL_DECLARED
00451 #define TclBN_s_mp_sub_TCL_DECLARED
00452 /* 60 */
00453 EXTERN int              TclBN_s_mp_sub (mp_int* a, mp_int* b, mp_int* c);
00454 #endif
00455 
00456 typedef struct TclTomMathStubs {
00457     int magic;
00458     struct TclTomMathStubHooks *hooks;
00459 
00460     int (*tclBN_epoch) (void); /* 0 */
00461     int (*tclBN_revision) (void); /* 1 */
00462     int (*tclBN_mp_add) (mp_int* a, mp_int* b, mp_int* c); /* 2 */
00463     int (*tclBN_mp_add_d) (mp_int* a, mp_digit b, mp_int* c); /* 3 */
00464     int (*tclBN_mp_and) (mp_int* a, mp_int* b, mp_int* c); /* 4 */
00465     void (*tclBN_mp_clamp) (mp_int* a); /* 5 */
00466     void (*tclBN_mp_clear) (mp_int* a); /* 6 */
00467     void (*tclBN_mp_clear_multi) (mp_int* a, ...); /* 7 */
00468     int (*tclBN_mp_cmp) (mp_int* a, mp_int* b); /* 8 */
00469     int (*tclBN_mp_cmp_d) (mp_int* a, mp_digit b); /* 9 */
00470     int (*tclBN_mp_cmp_mag) (mp_int* a, mp_int* b); /* 10 */
00471     int (*tclBN_mp_copy) (mp_int* a, mp_int* b); /* 11 */
00472     int (*tclBN_mp_count_bits) (mp_int* a); /* 12 */
00473     int (*tclBN_mp_div) (mp_int* a, mp_int* b, mp_int* q, mp_int* r); /* 13 */
00474     int (*tclBN_mp_div_d) (mp_int* a, mp_digit b, mp_int* q, mp_digit* r); /* 14 */
00475     int (*tclBN_mp_div_2) (mp_int* a, mp_int* q); /* 15 */
00476     int (*tclBN_mp_div_2d) (mp_int* a, int b, mp_int* q, mp_int* r); /* 16 */
00477     int (*tclBN_mp_div_3) (mp_int* a, mp_int* q, mp_digit* r); /* 17 */
00478     void (*tclBN_mp_exch) (mp_int* a, mp_int* b); /* 18 */
00479     int (*tclBN_mp_expt_d) (mp_int* a, mp_digit b, mp_int* c); /* 19 */
00480     int (*tclBN_mp_grow) (mp_int* a, int size); /* 20 */
00481     int (*tclBN_mp_init) (mp_int* a); /* 21 */
00482     int (*tclBN_mp_init_copy) (mp_int * a, mp_int* b); /* 22 */
00483     int (*tclBN_mp_init_multi) (mp_int* a, ...); /* 23 */
00484     int (*tclBN_mp_init_set) (mp_int* a, mp_digit b); /* 24 */
00485     int (*tclBN_mp_init_size) (mp_int* a, int size); /* 25 */
00486     int (*tclBN_mp_lshd) (mp_int* a, int shift); /* 26 */
00487     int (*tclBN_mp_mod) (mp_int* a, mp_int* b, mp_int* r); /* 27 */
00488     int (*tclBN_mp_mod_2d) (mp_int* a, int b, mp_int* r); /* 28 */
00489     int (*tclBN_mp_mul) (mp_int* a, mp_int* b, mp_int* p); /* 29 */
00490     int (*tclBN_mp_mul_d) (mp_int* a, mp_digit b, mp_int* p); /* 30 */
00491     int (*tclBN_mp_mul_2) (mp_int* a, mp_int* p); /* 31 */
00492     int (*tclBN_mp_mul_2d) (mp_int* a, int d, mp_int* p); /* 32 */
00493     int (*tclBN_mp_neg) (mp_int* a, mp_int* b); /* 33 */
00494     int (*tclBN_mp_or) (mp_int* a, mp_int* b, mp_int* c); /* 34 */
00495     int (*tclBN_mp_radix_size) (mp_int* a, int radix, int* size); /* 35 */
00496     int (*tclBN_mp_read_radix) (mp_int* a, const char* str, int radix); /* 36 */
00497     void (*tclBN_mp_rshd) (mp_int * a, int shift); /* 37 */
00498     int (*tclBN_mp_shrink) (mp_int* a); /* 38 */
00499     void (*tclBN_mp_set) (mp_int* a, mp_digit b); /* 39 */
00500     int (*tclBN_mp_sqr) (mp_int* a, mp_int* b); /* 40 */
00501     int (*tclBN_mp_sqrt) (mp_int* a, mp_int* b); /* 41 */
00502     int (*tclBN_mp_sub) (mp_int* a, mp_int* b, mp_int* c); /* 42 */
00503     int (*tclBN_mp_sub_d) (mp_int* a, mp_digit b, mp_int* c); /* 43 */
00504     int (*tclBN_mp_to_unsigned_bin) (mp_int* a, unsigned char* b); /* 44 */
00505     int (*tclBN_mp_to_unsigned_bin_n) (mp_int* a, unsigned char* b, unsigned long* outlen); /* 45 */
00506     int (*tclBN_mp_toradix_n) (mp_int* a, char* str, int radix, int maxlen); /* 46 */
00507     int (*tclBN_mp_unsigned_bin_size) (mp_int* a); /* 47 */
00508     int (*tclBN_mp_xor) (mp_int* a, mp_int* b, mp_int* c); /* 48 */
00509     void (*tclBN_mp_zero) (mp_int* a); /* 49 */
00510     void (*tclBN_reverse) (unsigned char* s, int len); /* 50 */
00511     int (*tclBN_fast_s_mp_mul_digs) (mp_int * a, mp_int * b, mp_int * c, int digs); /* 51 */
00512     int (*tclBN_fast_s_mp_sqr) (mp_int* a, mp_int* b); /* 52 */
00513     int (*tclBN_mp_karatsuba_mul) (mp_int* a, mp_int* b, mp_int* c); /* 53 */
00514     int (*tclBN_mp_karatsuba_sqr) (mp_int* a, mp_int* b); /* 54 */
00515     int (*tclBN_mp_toom_mul) (mp_int* a, mp_int* b, mp_int* c); /* 55 */
00516     int (*tclBN_mp_toom_sqr) (mp_int* a, mp_int* b); /* 56 */
00517     int (*tclBN_s_mp_add) (mp_int* a, mp_int* b, mp_int* c); /* 57 */
00518     int (*tclBN_s_mp_mul_digs) (mp_int* a, mp_int* b, mp_int* c, int digs); /* 58 */
00519     int (*tclBN_s_mp_sqr) (mp_int* a, mp_int* b); /* 59 */
00520     int (*tclBN_s_mp_sub) (mp_int* a, mp_int* b, mp_int* c); /* 60 */
00521 } TclTomMathStubs;
00522 
00523 #ifdef __cplusplus
00524 extern "C" {
00525 #endif
00526 extern TclTomMathStubs *tclTomMathStubsPtr;
00527 #ifdef __cplusplus
00528 }
00529 #endif
00530 
00531 #if defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS)
00532 
00533 /*
00534  * Inline function declarations:
00535  */
00536 
00537 #ifndef TclBN_epoch
00538 #define TclBN_epoch \
00539         (tclTomMathStubsPtr->tclBN_epoch) /* 0 */
00540 #endif
00541 #ifndef TclBN_revision
00542 #define TclBN_revision \
00543         (tclTomMathStubsPtr->tclBN_revision) /* 1 */
00544 #endif
00545 #ifndef TclBN_mp_add
00546 #define TclBN_mp_add \
00547         (tclTomMathStubsPtr->tclBN_mp_add) /* 2 */
00548 #endif
00549 #ifndef TclBN_mp_add_d
00550 #define TclBN_mp_add_d \
00551         (tclTomMathStubsPtr->tclBN_mp_add_d) /* 3 */
00552 #endif
00553 #ifndef TclBN_mp_and
00554 #define TclBN_mp_and \
00555         (tclTomMathStubsPtr->tclBN_mp_and) /* 4 */
00556 #endif
00557 #ifndef TclBN_mp_clamp
00558 #define TclBN_mp_clamp \
00559         (tclTomMathStubsPtr->tclBN_mp_clamp) /* 5 */
00560 #endif
00561 #ifndef TclBN_mp_clear
00562 #define TclBN_mp_clear \
00563         (tclTomMathStubsPtr->tclBN_mp_clear) /* 6 */
00564 #endif
00565 #ifndef TclBN_mp_clear_multi
00566 #define TclBN_mp_clear_multi \
00567         (tclTomMathStubsPtr->tclBN_mp_clear_multi) /* 7 */
00568 #endif
00569 #ifndef TclBN_mp_cmp
00570 #define TclBN_mp_cmp \
00571         (tclTomMathStubsPtr->tclBN_mp_cmp) /* 8 */
00572 #endif
00573 #ifndef TclBN_mp_cmp_d
00574 #define TclBN_mp_cmp_d \
00575         (tclTomMathStubsPtr->tclBN_mp_cmp_d) /* 9 */
00576 #endif
00577 #ifndef TclBN_mp_cmp_mag
00578 #define TclBN_mp_cmp_mag \
00579         (tclTomMathStubsPtr->tclBN_mp_cmp_mag) /* 10 */
00580 #endif
00581 #ifndef TclBN_mp_copy
00582 #define TclBN_mp_copy \
00583         (tclTomMathStubsPtr->tclBN_mp_copy) /* 11 */
00584 #endif
00585 #ifndef TclBN_mp_count_bits
00586 #define TclBN_mp_count_bits \
00587         (tclTomMathStubsPtr->tclBN_mp_count_bits) /* 12 */
00588 #endif
00589 #ifndef TclBN_mp_div
00590 #define TclBN_mp_div \
00591         (tclTomMathStubsPtr->tclBN_mp_div) /* 13 */
00592 #endif
00593 #ifndef TclBN_mp_div_d
00594 #define TclBN_mp_div_d \
00595         (tclTomMathStubsPtr->tclBN_mp_div_d) /* 14 */
00596 #endif
00597 #ifndef TclBN_mp_div_2
00598 #define TclBN_mp_div_2 \
00599         (tclTomMathStubsPtr->tclBN_mp_div_2) /* 15 */
00600 #endif
00601 #ifndef TclBN_mp_div_2d
00602 #define TclBN_mp_div_2d \
00603         (tclTomMathStubsPtr->tclBN_mp_div_2d) /* 16 */
00604 #endif
00605 #ifndef TclBN_mp_div_3
00606 #define TclBN_mp_div_3 \
00607         (tclTomMathStubsPtr->tclBN_mp_div_3) /* 17 */
00608 #endif
00609 #ifndef TclBN_mp_exch
00610 #define TclBN_mp_exch \
00611         (tclTomMathStubsPtr->tclBN_mp_exch) /* 18 */
00612 #endif
00613 #ifndef TclBN_mp_expt_d
00614 #define TclBN_mp_expt_d \
00615         (tclTomMathStubsPtr->tclBN_mp_expt_d) /* 19 */
00616 #endif
00617 #ifndef TclBN_mp_grow
00618 #define TclBN_mp_grow \
00619         (tclTomMathStubsPtr->tclBN_mp_grow) /* 20 */
00620 #endif
00621 #ifndef TclBN_mp_init
00622 #define TclBN_mp_init \
00623         (tclTomMathStubsPtr->tclBN_mp_init) /* 21 */
00624 #endif
00625 #ifndef TclBN_mp_init_copy
00626 #define TclBN_mp_init_copy \
00627         (tclTomMathStubsPtr->tclBN_mp_init_copy) /* 22 */
00628 #endif
00629 #ifndef TclBN_mp_init_multi
00630 #define TclBN_mp_init_multi \
00631         (tclTomMathStubsPtr->tclBN_mp_init_multi) /* 23 */
00632 #endif
00633 #ifndef TclBN_mp_init_set
00634 #define TclBN_mp_init_set \
00635         (tclTomMathStubsPtr->tclBN_mp_init_set) /* 24 */
00636 #endif
00637 #ifndef TclBN_mp_init_size
00638 #define TclBN_mp_init_size \
00639         (tclTomMathStubsPtr->tclBN_mp_init_size) /* 25 */
00640 #endif
00641 #ifndef TclBN_mp_lshd
00642 #define TclBN_mp_lshd \
00643         (tclTomMathStubsPtr->tclBN_mp_lshd) /* 26 */
00644 #endif
00645 #ifndef TclBN_mp_mod
00646 #define TclBN_mp_mod \
00647         (tclTomMathStubsPtr->tclBN_mp_mod) /* 27 */
00648 #endif
00649 #ifndef TclBN_mp_mod_2d
00650 #define TclBN_mp_mod_2d \
00651         (tclTomMathStubsPtr->tclBN_mp_mod_2d) /* 28 */
00652 #endif
00653 #ifndef TclBN_mp_mul
00654 #define TclBN_mp_mul \
00655         (tclTomMathStubsPtr->tclBN_mp_mul) /* 29 */
00656 #endif
00657 #ifndef TclBN_mp_mul_d
00658 #define TclBN_mp_mul_d \
00659         (tclTomMathStubsPtr->tclBN_mp_mul_d) /* 30 */
00660 #endif
00661 #ifndef TclBN_mp_mul_2
00662 #define TclBN_mp_mul_2 \
00663         (tclTomMathStubsPtr->tclBN_mp_mul_2) /* 31 */
00664 #endif
00665 #ifndef TclBN_mp_mul_2d
00666 #define TclBN_mp_mul_2d \
00667         (tclTomMathStubsPtr->tclBN_mp_mul_2d) /* 32 */
00668 #endif
00669 #ifndef TclBN_mp_neg
00670 #define TclBN_mp_neg \
00671         (tclTomMathStubsPtr->tclBN_mp_neg) /* 33 */
00672 #endif
00673 #ifndef TclBN_mp_or
00674 #define TclBN_mp_or \
00675         (tclTomMathStubsPtr->tclBN_mp_or) /* 34 */
00676 #endif
00677 #ifndef TclBN_mp_radix_size
00678 #define TclBN_mp_radix_size \
00679         (tclTomMathStubsPtr->tclBN_mp_radix_size) /* 35 */
00680 #endif
00681 #ifndef TclBN_mp_read_radix
00682 #define TclBN_mp_read_radix \
00683         (tclTomMathStubsPtr->tclBN_mp_read_radix) /* 36 */
00684 #endif
00685 #ifndef TclBN_mp_rshd
00686 #define TclBN_mp_rshd \
00687         (tclTomMathStubsPtr->tclBN_mp_rshd) /* 37 */
00688 #endif
00689 #ifndef TclBN_mp_shrink
00690 #define TclBN_mp_shrink \
00691         (tclTomMathStubsPtr->tclBN_mp_shrink) /* 38 */
00692 #endif
00693 #ifndef TclBN_mp_set
00694 #define TclBN_mp_set \
00695         (tclTomMathStubsPtr->tclBN_mp_set) /* 39 */
00696 #endif
00697 #ifndef TclBN_mp_sqr
00698 #define TclBN_mp_sqr \
00699         (tclTomMathStubsPtr->tclBN_mp_sqr) /* 40 */
00700 #endif
00701 #ifndef TclBN_mp_sqrt
00702 #define TclBN_mp_sqrt \
00703         (tclTomMathStubsPtr->tclBN_mp_sqrt) /* 41 */
00704 #endif
00705 #ifndef TclBN_mp_sub
00706 #define TclBN_mp_sub \
00707         (tclTomMathStubsPtr->tclBN_mp_sub) /* 42 */
00708 #endif
00709 #ifndef TclBN_mp_sub_d
00710 #define TclBN_mp_sub_d \
00711         (tclTomMathStubsPtr->tclBN_mp_sub_d) /* 43 */
00712 #endif
00713 #ifndef TclBN_mp_to_unsigned_bin
00714 #define TclBN_mp_to_unsigned_bin \
00715         (tclTomMathStubsPtr->tclBN_mp_to_unsigned_bin) /* 44 */
00716 #endif
00717 #ifndef TclBN_mp_to_unsigned_bin_n
00718 #define TclBN_mp_to_unsigned_bin_n \
00719         (tclTomMathStubsPtr->tclBN_mp_to_unsigned_bin_n) /* 45 */
00720 #endif
00721 #ifndef TclBN_mp_toradix_n
00722 #define TclBN_mp_toradix_n \
00723         (tclTomMathStubsPtr->tclBN_mp_toradix_n) /* 46 */
00724 #endif
00725 #ifndef TclBN_mp_unsigned_bin_size
00726 #define TclBN_mp_unsigned_bin_size \
00727         (tclTomMathStubsPtr->tclBN_mp_unsigned_bin_size) /* 47 */
00728 #endif
00729 #ifndef TclBN_mp_xor
00730 #define TclBN_mp_xor \
00731         (tclTomMathStubsPtr->tclBN_mp_xor) /* 48 */
00732 #endif
00733 #ifndef TclBN_mp_zero
00734 #define TclBN_mp_zero \
00735         (tclTomMathStubsPtr->tclBN_mp_zero) /* 49 */
00736 #endif
00737 #ifndef TclBN_reverse
00738 #define TclBN_reverse \
00739         (tclTomMathStubsPtr->tclBN_reverse) /* 50 */
00740 #endif
00741 #ifndef TclBN_fast_s_mp_mul_digs
00742 #define TclBN_fast_s_mp_mul_digs \
00743         (tclTomMathStubsPtr->tclBN_fast_s_mp_mul_digs) /* 51 */
00744 #endif
00745 #ifndef TclBN_fast_s_mp_sqr
00746 #define TclBN_fast_s_mp_sqr \
00747         (tclTomMathStubsPtr->tclBN_fast_s_mp_sqr) /* 52 */
00748 #endif
00749 #ifndef TclBN_mp_karatsuba_mul
00750 #define TclBN_mp_karatsuba_mul \
00751         (tclTomMathStubsPtr->tclBN_mp_karatsuba_mul) /* 53 */
00752 #endif
00753 #ifndef TclBN_mp_karatsuba_sqr
00754 #define TclBN_mp_karatsuba_sqr \
00755         (tclTomMathStubsPtr->tclBN_mp_karatsuba_sqr) /* 54 */
00756 #endif
00757 #ifndef TclBN_mp_toom_mul
00758 #define TclBN_mp_toom_mul \
00759         (tclTomMathStubsPtr->tclBN_mp_toom_mul) /* 55 */
00760 #endif
00761 #ifndef TclBN_mp_toom_sqr
00762 #define TclBN_mp_toom_sqr \
00763         (tclTomMathStubsPtr->tclBN_mp_toom_sqr) /* 56 */
00764 #endif
00765 #ifndef TclBN_s_mp_add
00766 #define TclBN_s_mp_add \
00767         (tclTomMathStubsPtr->tclBN_s_mp_add) /* 57 */
00768 #endif
00769 #ifndef TclBN_s_mp_mul_digs
00770 #define TclBN_s_mp_mul_digs \
00771         (tclTomMathStubsPtr->tclBN_s_mp_mul_digs) /* 58 */
00772 #endif
00773 #ifndef TclBN_s_mp_sqr
00774 #define TclBN_s_mp_sqr \
00775         (tclTomMathStubsPtr->tclBN_s_mp_sqr) /* 59 */
00776 #endif
00777 #ifndef TclBN_s_mp_sub
00778 #define TclBN_s_mp_sub \
00779         (tclTomMathStubsPtr->tclBN_s_mp_sub) /* 60 */
00780 #endif
00781 
00782 #endif /* defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) */
00783 
00784 /* !END!: Do not edit above this line. */
00785 
00786 #undef TCL_STORAGE_CLASS
00787 #define TCL_STORAGE_CLASS DLLIMPORT
00788 
00789 #endif /* _TCLINTDECLS */



Generated on Wed Mar 12 12:18:23 2008 by  doxygen 1.5.1