Tcl Source Code

Check-in [99c1ed4d8a]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Make internal libtommath stub entries deprecated: Those are not supposed to be called in extensions
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-branch
Files: files | file ages | folders
SHA3-256:99c1ed4d8af51a259359355c43e9131daa4a5718f7bd60b7fcf650d59f296b1a
User & Date: jan.nijtmans 2019-03-14 19:52:55
Context
2019-03-15
20:52
Eliminate usage of mp_isneg(), just check bignum->sign directly (as libtommath itself does) Make Tcl... check-in: 515a22d41d user: jan.nijtmans tags: core-8-branch
15:47
merge 8.7 check-in: 65a911f5d4 user: dgp tags: tip-445-api-fix
2019-03-14
20:59
Merge 8.7. Fix 2 test-cases which were failing for TCL_UTF_MAX=6 check-in: 4032e7fe99 user: jan.nijtmans tags: utf-max-6
20:03
merge-mark check-in: 80c345bf67 user: jan.nijtmans tags: trunk
20:01
merge-mark check-in: 4990c65285 user: jan.nijtmans tags: tommath-refactor
19:52
Make internal libtommath stub entries deprecated: Those are not supposed to be called in extensions check-in: 99c1ed4d8a user: jan.nijtmans tags: core-8-branch
2019-03-11
20:32
Change TCHAR -> WCHAR in many places, since that's what it is since Windows NT check-in: 876f74eabe user: jan.nijtmans tags: core-8-branch
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to generic/tclStubInit.c.

   408    408   #   define TclpLocaltime_unix 0
   409    409   #   define TclpGmtime_unix 0
   410    410   #   define Tcl_SetExitProc 0
   411    411   #   define Tcl_SetPanicProc 0
   412    412   #   define Tcl_FindExecutable 0
   413    413   #   define Tcl_GetUnicode 0
   414    414   #   define TclOldFreeObj 0
          415  +#   define TclBN_reverse 0
          416  +#   define TclBN_fast_s_mp_mul_digs 0
          417  +#   define TclBN_fast_s_mp_sqr 0
          418  +#   define TclBN_mp_karatsuba_mul 0
          419  +#   define TclBN_mp_karatsuba_sqr 0
          420  +#   define TclBN_mp_toom_mul 0
          421  +#   define TclBN_mp_toom_sqr 0
          422  +#   define TclBN_s_mp_add 0
          423  +#   define TclBN_s_mp_mul_digs 0
          424  +#   define TclBN_s_mp_sqr 0
          425  +#   define TclBN_s_mp_sub 0
   415    426   #else /* TCL_NO_DEPRECATED */
   416    427   #   define Tcl_SeekOld seekOld
   417    428   #   define Tcl_TellOld tellOld
   418    429   #   define TclBackgroundException Tcl_BackgroundException
   419    430   #   define TclSetStartupScript Tcl_SetStartupScript
   420    431   #   define TclGetStartupScript Tcl_GetStartupScript
   421    432   #   define TclCreateNamespace Tcl_CreateNamespace

Changes to generic/tclTomMath.decls.

   174    174   declare 49 {
   175    175       void TclBN_mp_zero(mp_int *a)
   176    176   }
   177    177   
   178    178   # internal routines to libtommath - should not be called but must be
   179    179   # exported to accommodate the "tommath" extension
   180    180   
   181         -declare 50 {
          181  +declare 50 {deprecated {is private function in libtommath}} {
   182    182       void TclBN_reverse(unsigned char *s, int len)
   183    183   }
   184         -declare 51 {
          184  +declare 51 {deprecated {is private function in libtommath}} {
   185    185       int TclBN_fast_s_mp_mul_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs)
   186    186   }
   187         -declare 52 {
          187  +declare 52 {deprecated {is private function in libtommath}} {
   188    188       int TclBN_fast_s_mp_sqr(const mp_int *a, mp_int *b)
   189    189   }
   190         -declare 53 {
          190  +declare 53 {deprecated {is private function in libtommath}} {
   191    191       int TclBN_mp_karatsuba_mul(const mp_int *a, const mp_int *b, mp_int *c)
   192    192   }
   193         -declare 54 {
          193  +declare 54 {deprecated {is private function in libtommath}} {
   194    194       int TclBN_mp_karatsuba_sqr(const mp_int *a, mp_int *b)
   195    195   }
   196         -declare 55 {
          196  +declare 55 {deprecated {is private function in libtommath}} {
   197    197       int TclBN_mp_toom_mul(const mp_int *a, const mp_int *b, mp_int *c)
   198    198   }
   199         -declare 56 {
          199  +declare 56 {deprecated {is private function in libtommath}} {
   200    200       int TclBN_mp_toom_sqr(const mp_int *a, mp_int *b)
   201    201   }
   202         -declare 57 {
          202  +declare 57 {deprecated {is private function in libtommath}} {
   203    203       int TclBN_s_mp_add(const mp_int *a, const mp_int *b, mp_int *c)
   204    204   }
   205         -declare 58 {
          205  +declare 58 {deprecated {is private function in libtommath}} {
   206    206       int TclBN_s_mp_mul_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs)
   207    207   }
   208         -declare 59 {
          208  +declare 59 {deprecated {is private function in libtommath}} {
   209    209       int TclBN_s_mp_sqr(const mp_int *a, mp_int *b)
   210    210   }
   211         -declare 60 {
          211  +declare 60 {deprecated {is private function in libtommath}} {
   212    212       int TclBN_s_mp_sub(const mp_int *a, const mp_int *b, mp_int *c)
   213    213   }
   214    214   declare 61 {
   215    215       int TclBN_mp_init_set_int(mp_int *a, unsigned long i)
   216    216   }
   217    217   declare 62 {
   218    218       int TclBN_mp_set_int(mp_int *a, unsigned long i)

Changes to generic/tclTomMathDecls.h.

   269    269   EXTERN int		TclBN_mp_unsigned_bin_size(const mp_int *a);
   270    270   /* 48 */
   271    271   EXTERN int		TclBN_mp_xor(const mp_int *a, const mp_int *b,
   272    272   				mp_int *c);
   273    273   /* 49 */
   274    274   EXTERN void		TclBN_mp_zero(mp_int *a);
   275    275   /* 50 */
   276         -EXTERN void		TclBN_reverse(unsigned char *s, int len);
          276  +TCL_DEPRECATED("is private function in libtommath")
          277  +void			TclBN_reverse(unsigned char *s, int len);
   277    278   /* 51 */
   278         -EXTERN int		TclBN_fast_s_mp_mul_digs(const mp_int *a,
          279  +TCL_DEPRECATED("is private function in libtommath")
          280  +int			TclBN_fast_s_mp_mul_digs(const mp_int *a,
   279    281   				const mp_int *b, mp_int *c, int digs);
   280    282   /* 52 */
   281         -EXTERN int		TclBN_fast_s_mp_sqr(const mp_int *a, mp_int *b);
          283  +TCL_DEPRECATED("is private function in libtommath")
          284  +int			TclBN_fast_s_mp_sqr(const mp_int *a, mp_int *b);
   282    285   /* 53 */
   283         -EXTERN int		TclBN_mp_karatsuba_mul(const mp_int *a,
          286  +TCL_DEPRECATED("is private function in libtommath")
          287  +int			TclBN_mp_karatsuba_mul(const mp_int *a,
   284    288   				const mp_int *b, mp_int *c);
   285    289   /* 54 */
   286         -EXTERN int		TclBN_mp_karatsuba_sqr(const mp_int *a, mp_int *b);
          290  +TCL_DEPRECATED("is private function in libtommath")
          291  +int			TclBN_mp_karatsuba_sqr(const mp_int *a, mp_int *b);
   287    292   /* 55 */
   288         -EXTERN int		TclBN_mp_toom_mul(const mp_int *a, const mp_int *b,
          293  +TCL_DEPRECATED("is private function in libtommath")
          294  +int			TclBN_mp_toom_mul(const mp_int *a, const mp_int *b,
   289    295   				mp_int *c);
   290    296   /* 56 */
   291         -EXTERN int		TclBN_mp_toom_sqr(const mp_int *a, mp_int *b);
          297  +TCL_DEPRECATED("is private function in libtommath")
          298  +int			TclBN_mp_toom_sqr(const mp_int *a, mp_int *b);
   292    299   /* 57 */
   293         -EXTERN int		TclBN_s_mp_add(const mp_int *a, const mp_int *b,
          300  +TCL_DEPRECATED("is private function in libtommath")
          301  +int			TclBN_s_mp_add(const mp_int *a, const mp_int *b,
   294    302   				mp_int *c);
   295    303   /* 58 */
   296         -EXTERN int		TclBN_s_mp_mul_digs(const mp_int *a, const mp_int *b,
          304  +TCL_DEPRECATED("is private function in libtommath")
          305  +int			TclBN_s_mp_mul_digs(const mp_int *a, const mp_int *b,
   297    306   				mp_int *c, int digs);
   298    307   /* 59 */
   299         -EXTERN int		TclBN_s_mp_sqr(const mp_int *a, mp_int *b);
          308  +TCL_DEPRECATED("is private function in libtommath")
          309  +int			TclBN_s_mp_sqr(const mp_int *a, mp_int *b);
   300    310   /* 60 */
   301         -EXTERN int		TclBN_s_mp_sub(const mp_int *a, const mp_int *b,
          311  +TCL_DEPRECATED("is private function in libtommath")
          312  +int			TclBN_s_mp_sub(const mp_int *a, const mp_int *b,
   302    313   				mp_int *c);
   303    314   /* 61 */
   304    315   EXTERN int		TclBN_mp_init_set_int(mp_int *a, unsigned long i);
   305    316   /* 62 */
   306    317   EXTERN int		TclBN_mp_set_int(mp_int *a, unsigned long i);
   307    318   /* 63 */
   308    319   EXTERN int		TclBN_mp_cnt_lsb(const mp_int *a);
................................................................................
   394    405       int (*tclBN_mp_sub_d) (const mp_int *a, mp_digit b, mp_int *c); /* 43 */
   395    406       int (*tclBN_mp_to_unsigned_bin) (const mp_int *a, unsigned char *b); /* 44 */
   396    407       int (*tclBN_mp_to_unsigned_bin_n) (const mp_int *a, unsigned char *b, unsigned long *outlen); /* 45 */
   397    408       int (*tclBN_mp_toradix_n) (const mp_int *a, char *str, int radix, int maxlen); /* 46 */
   398    409       int (*tclBN_mp_unsigned_bin_size) (const mp_int *a); /* 47 */
   399    410       int (*tclBN_mp_xor) (const mp_int *a, const mp_int *b, mp_int *c); /* 48 */
   400    411       void (*tclBN_mp_zero) (mp_int *a); /* 49 */
   401         -    void (*tclBN_reverse) (unsigned char *s, int len); /* 50 */
   402         -    int (*tclBN_fast_s_mp_mul_digs) (const mp_int *a, const mp_int *b, mp_int *c, int digs); /* 51 */
   403         -    int (*tclBN_fast_s_mp_sqr) (const mp_int *a, mp_int *b); /* 52 */
   404         -    int (*tclBN_mp_karatsuba_mul) (const mp_int *a, const mp_int *b, mp_int *c); /* 53 */
   405         -    int (*tclBN_mp_karatsuba_sqr) (const mp_int *a, mp_int *b); /* 54 */
   406         -    int (*tclBN_mp_toom_mul) (const mp_int *a, const mp_int *b, mp_int *c); /* 55 */
   407         -    int (*tclBN_mp_toom_sqr) (const mp_int *a, mp_int *b); /* 56 */
   408         -    int (*tclBN_s_mp_add) (const mp_int *a, const mp_int *b, mp_int *c); /* 57 */
   409         -    int (*tclBN_s_mp_mul_digs) (const mp_int *a, const mp_int *b, mp_int *c, int digs); /* 58 */
   410         -    int (*tclBN_s_mp_sqr) (const mp_int *a, mp_int *b); /* 59 */
   411         -    int (*tclBN_s_mp_sub) (const mp_int *a, const mp_int *b, mp_int *c); /* 60 */
          412  +    TCL_DEPRECATED_API("is private function in libtommath") void (*tclBN_reverse) (unsigned char *s, int len); /* 50 */
          413  +    TCL_DEPRECATED_API("is private function in libtommath") int (*tclBN_fast_s_mp_mul_digs) (const mp_int *a, const mp_int *b, mp_int *c, int digs); /* 51 */
          414  +    TCL_DEPRECATED_API("is private function in libtommath") int (*tclBN_fast_s_mp_sqr) (const mp_int *a, mp_int *b); /* 52 */
          415  +    TCL_DEPRECATED_API("is private function in libtommath") int (*tclBN_mp_karatsuba_mul) (const mp_int *a, const mp_int *b, mp_int *c); /* 53 */
          416  +    TCL_DEPRECATED_API("is private function in libtommath") int (*tclBN_mp_karatsuba_sqr) (const mp_int *a, mp_int *b); /* 54 */
          417  +    TCL_DEPRECATED_API("is private function in libtommath") int (*tclBN_mp_toom_mul) (const mp_int *a, const mp_int *b, mp_int *c); /* 55 */
          418  +    TCL_DEPRECATED_API("is private function in libtommath") int (*tclBN_mp_toom_sqr) (const mp_int *a, mp_int *b); /* 56 */
          419  +    TCL_DEPRECATED_API("is private function in libtommath") int (*tclBN_s_mp_add) (const mp_int *a, const mp_int *b, mp_int *c); /* 57 */
          420  +    TCL_DEPRECATED_API("is private function in libtommath") int (*tclBN_s_mp_mul_digs) (const mp_int *a, const mp_int *b, mp_int *c, int digs); /* 58 */
          421  +    TCL_DEPRECATED_API("is private function in libtommath") int (*tclBN_s_mp_sqr) (const mp_int *a, mp_int *b); /* 59 */
          422  +    TCL_DEPRECATED_API("is private function in libtommath") int (*tclBN_s_mp_sub) (const mp_int *a, const mp_int *b, mp_int *c); /* 60 */
   412    423       int (*tclBN_mp_init_set_int) (mp_int *a, unsigned long i); /* 61 */
   413    424       int (*tclBN_mp_set_int) (mp_int *a, unsigned long i); /* 62 */
   414    425       int (*tclBN_mp_cnt_lsb) (const mp_int *a); /* 63 */
   415    426       TCL_DEPRECATED_API("Use mp_init() + mp_set_long_long()") void (*tclBNInitBignumFromLong) (mp_int *bignum, long initVal); /* 64 */
   416    427       TCL_DEPRECATED_API("Use mp_init() + mp_set_long_long()") void (*tclBNInitBignumFromWideInt) (mp_int *bignum, Tcl_WideInt initVal); /* 65 */
   417    428       TCL_DEPRECATED_API("Use mp_init() + mp_set_long_long()") void (*tclBNInitBignumFromWideUInt) (mp_int *bignum, Tcl_WideUInt initVal); /* 66 */
   418    429       int (*tclBN_mp_expt_d_ex) (const mp_int *a, mp_digit b, mp_int *c, int fast); /* 67 */