Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | add tcl upstream changes |
---|---|
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
890981881cc3a56d3f34f2760ac1c231 |
User & Date: | chw 2019-05-31 17:14:57.509 |
Context
2019-06-01
| ||
05:43 | add tcl upstream changes check-in: 30ffbc2bb1 user: chw tags: trunk | |
2019-05-31
| ||
17:24 | merge with trunk check-in: 9e57d32c2f user: chw tags: wtf-8-experiment | |
17:14 | add tcl upstream changes check-in: 890981881c user: chw tags: trunk | |
16:37 | fix for ticket [ac3eeb2f9a] check-in: 3fa36c2ea8 user: chw tags: trunk | |
Changes
Changes to jni/tcl/Android.mk.
︙ | ︙ | |||
42 43 44 45 46 47 48 | libtommath/bn_mp_div_d.c \ libtommath/bn_mp_div_2.c \ libtommath/bn_mp_div_2d.c \ libtommath/bn_mp_div_3.c \ libtommath/bn_mp_exch.c \ libtommath/bn_mp_expt_d.c \ libtommath/bn_mp_expt_d_ex.c \ | < | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | libtommath/bn_mp_div_d.c \ libtommath/bn_mp_div_2.c \ libtommath/bn_mp_div_2d.c \ libtommath/bn_mp_div_3.c \ libtommath/bn_mp_exch.c \ libtommath/bn_mp_expt_d.c \ libtommath/bn_mp_expt_d_ex.c \ libtommath/bn_mp_grow.c \ libtommath/bn_mp_init.c \ libtommath/bn_mp_init_copy.c \ libtommath/bn_mp_init_multi.c \ libtommath/bn_mp_init_set.c \ libtommath/bn_mp_init_set_int.c \ libtommath/bn_mp_init_size.c \ |
︙ | ︙ | |||
69 70 71 72 73 74 75 76 77 78 79 | libtommath/bn_mp_radix_smap.c \ libtommath/bn_mp_read_radix.c \ libtommath/bn_mp_rshd.c \ libtommath/bn_mp_set.c \ libtommath/bn_mp_set_int.c \ libtommath/bn_mp_set_long.c \ libtommath/bn_mp_shrink.c \ libtommath/bn_mp_sqr.c \ libtommath/bn_mp_sqrt.c \ libtommath/bn_mp_sub.c \ libtommath/bn_mp_sub_d.c \ | > < < < < > | 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | libtommath/bn_mp_radix_smap.c \ libtommath/bn_mp_read_radix.c \ libtommath/bn_mp_rshd.c \ libtommath/bn_mp_set.c \ libtommath/bn_mp_set_int.c \ libtommath/bn_mp_set_long.c \ libtommath/bn_mp_shrink.c \ libtommath/bn_mp_signed_rsh.c \ libtommath/bn_mp_sqr.c \ libtommath/bn_mp_sqrt.c \ libtommath/bn_mp_sub.c \ libtommath/bn_mp_sub_d.c \ libtommath/bn_mp_to_unsigned_bin.c \ libtommath/bn_mp_to_unsigned_bin_n.c \ libtommath/bn_mp_toom_mul.c \ libtommath/bn_mp_toom_sqr.c \ libtommath/bn_mp_toradix_n.c \ libtommath/bn_mp_unsigned_bin_size.c \ libtommath/bn_mp_xor.c \ libtommath/bn_mp_zero.c \ libtommath/bn_s_mp_add.c \ libtommath/bn_s_mp_get_bit.c \ libtommath/bn_s_mp_mul_digs.c \ libtommath/bn_s_mp_sqr.c \ libtommath/bn_s_mp_sub.c \ generic/regcomp.c \ generic/regexec.c \ generic/regfree.c \ generic/regerror.c \ |
︙ | ︙ |
Changes to jni/tcl/generic/tclExecute.c.
︙ | ︙ | |||
8638 8639 8640 8641 8642 8643 8644 | Tcl_TakeBignumFromObj(NULL, valuePtr, &big1); mp_init(&bigResult); if (opcode == INST_LSHIFT) { mp_mul_2d(&big1, shift, &bigResult); } else { | | | 8638 8639 8640 8641 8642 8643 8644 8645 8646 8647 8648 8649 8650 8651 8652 | Tcl_TakeBignumFromObj(NULL, valuePtr, &big1); mp_init(&bigResult); if (opcode == INST_LSHIFT) { mp_mul_2d(&big1, shift, &bigResult); } else { mp_signed_rsh(&big1, shift, &bigResult); } mp_clear(&big1); BIG_RESULT(&bigResult); } case INST_BITOR: case INST_BITXOR: |
︙ | ︙ |
Changes to jni/tcl/generic/tclStrToD.c.
︙ | ︙ | |||
4627 4628 4629 4630 4631 4632 4633 | if (lsb == -1-shift) { /* * Round to even */ mp_div_2d(a, -shift, &b, NULL); | | | 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 | if (lsb == -1-shift) { /* * Round to even */ mp_div_2d(a, -shift, &b, NULL); if (mp_isodd(&b)) { if (b.sign == MP_ZPOS) { mp_add_d(&b, 1, &b); } else { mp_sub_d(&b, 1, &b); } } } else { |
︙ | ︙ |
Changes to jni/tcl/generic/tclStubInit.c.
︙ | ︙ | |||
47 48 49 50 51 52 53 54 55 56 57 58 59 60 | #undef TclSockMinimumBuffers #define TclBackgroundException Tcl_BackgroundException #undef Tcl_SetIntObj #undef TclpInetNtoa #undef TclWinGetServByName #undef TclWinGetSockOpt #undef TclWinSetSockOpt /* See bug 510001: TclSockMinimumBuffers needs plat imp */ #ifdef _WIN64 # define TclSockMinimumBuffersOld 0 #else #define TclSockMinimumBuffersOld sockMinimumBuffersOld static int TclSockMinimumBuffersOld(int sock, int size) | > > > > > > | 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | #undef TclSockMinimumBuffers #define TclBackgroundException Tcl_BackgroundException #undef Tcl_SetIntObj #undef TclpInetNtoa #undef TclWinGetServByName #undef TclWinGetSockOpt #undef TclWinSetSockOpt #undef TclBN_mp_tc_and #undef TclBN_mp_tc_or #undef TclBN_mp_tc_xor #define TclBN_mp_tc_and TclBN_mp_and #define TclBN_mp_tc_or TclBN_mp_or #define TclBN_mp_tc_xor TclBN_mp_xor /* See bug 510001: TclSockMinimumBuffers needs plat imp */ #ifdef _WIN64 # define TclSockMinimumBuffersOld 0 #else #define TclSockMinimumBuffersOld sockMinimumBuffersOld static int TclSockMinimumBuffersOld(int sock, int size) |
︙ | ︙ | |||
762 763 764 765 766 767 768 | 0, /* 69 */ TclBN_mp_set_long, /* 70 */ 0, /* 71 */ 0, /* 72 */ TclBN_mp_tc_and, /* 73 */ TclBN_mp_tc_or, /* 74 */ TclBN_mp_tc_xor, /* 75 */ | | | 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 | 0, /* 69 */ TclBN_mp_set_long, /* 70 */ 0, /* 71 */ 0, /* 72 */ TclBN_mp_tc_and, /* 73 */ TclBN_mp_tc_or, /* 74 */ TclBN_mp_tc_xor, /* 75 */ TclBN_mp_signed_rsh, /* 76 */ TclBN_mp_get_bit, /* 77 */ }; static const TclStubHooks tclStubHooks = { &tclPlatStubs, &tclIntStubs, &tclIntPlatStubs |
︙ | ︙ |
Changes to jni/tcl/generic/tclTestObj.c.
︙ | ︙ | |||
286 287 288 289 290 291 292 | return TCL_ERROR; } if (Tcl_GetBignumFromObj(interp, varPtr[varIndex], &bignumValue) != TCL_OK) { return TCL_ERROR; } if (!Tcl_IsShared(varPtr[varIndex])) { | | | | 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 | return TCL_ERROR; } if (Tcl_GetBignumFromObj(interp, varPtr[varIndex], &bignumValue) != TCL_OK) { return TCL_ERROR; } if (!Tcl_IsShared(varPtr[varIndex])) { Tcl_SetIntObj(varPtr[varIndex], !mp_isodd(&bignumValue)); } else { SetVarToObj(varPtr, varIndex, Tcl_NewIntObj(!mp_isodd(&bignumValue))); } mp_clear(&bignumValue); break; case BIGNUM_RADIXSIZE: if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "varIndex"); |
︙ | ︙ |
Changes to jni/tcl/generic/tclTomMath.decls.
︙ | ︙ | |||
248 249 250 251 252 253 254 | declare 74 { int TclBN_mp_tc_or(const mp_int *a, const mp_int *b, mp_int *c) } declare 75 { int TclBN_mp_tc_xor(const mp_int *a, const mp_int *b, mp_int *c) } declare 76 { | | | 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 | declare 74 { int TclBN_mp_tc_or(const mp_int *a, const mp_int *b, mp_int *c) } declare 75 { int TclBN_mp_tc_xor(const mp_int *a, const mp_int *b, mp_int *c) } declare 76 { int TclBN_mp_signed_rsh(const mp_int *a, int b, mp_int *c) } declare 77 { int TclBN_mp_get_bit(const mp_int *a, int b) } |
︙ | ︙ |
Changes to jni/tcl/generic/tclTomMath.h.
︙ | ︙ | |||
199 200 201 202 203 204 205 | }; /* callback for mp_prime_random, should fill dst with random bytes and return how many read [upto len] */ typedef int ltm_prime_callback(unsigned char *dst, int len, void *dat); /* error code to char* string */ | > | > | | | | | | | | 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 | }; /* callback for mp_prime_random, should fill dst with random bytes and return how many read [upto len] */ typedef int ltm_prime_callback(unsigned char *dst, int len, void *dat); /* error code to char* string */ /* const char *mp_error_to_string(mp_err code); */ /* ---> init and deinit bignum functions <--- */ /* init a bignum */ /* mp_err mp_init(mp_int *a); */ /* free a bignum */ /* void mp_clear(mp_int *a); */ /* init a null terminated series of arguments */ /* mp_err mp_init_multi(mp_int *mp, ...); */ /* clear a null terminated series of arguments */ /* void mp_clear_multi(mp_int *mp, ...); */ /* exchange two ints */ /* void mp_exch(mp_int *a, mp_int *b); */ /* shrink ram required for a bignum */ /* mp_err mp_shrink(mp_int *a); */ /* grow an int to a given size */ /* mp_err mp_grow(mp_int *a, int size); */ /* init to a given number of digits */ /* mp_err mp_init_size(mp_int *a, int size); */ /* ---> Basic Manipulations <--- */ #define mp_iszero(a) (((a)->used == 0) ? MP_YES : MP_NO) #define mp_iseven(a) (((a)->used == 0 || (((a)->dp[0] & 1) == 0)) ? MP_YES : MP_NO) #define mp_isodd(a) (((a)->used > 0 && (((a)->dp[0] & 1) == 1)) ? MP_YES : MP_NO) #define mp_isneg(a) (((a)->sign != MP_ZPOS) ? MP_YES : MP_NO) /* set to zero */ /* void mp_zero(mp_int *a); */ |
︙ | ︙ | |||
406 407 408 409 410 411 412 | */ /* c = a AND b */ /* int mp_and(const mp_int *a, const mp_int *b, mp_int *c); */ | < < < < < < < < < < < < < < < | | 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 | */ /* c = a AND b */ /* int mp_and(const mp_int *a, const mp_int *b, mp_int *c); */ /* right shift (two complement) */ /* int mp_signed_rsh(const mp_int *a, int b, mp_int *c); */ /* ---> Basic arithmetic <--- */ /* b = ~a */ /* int mp_complement(const mp_int *a, mp_int *b); |
︙ | ︙ |
Changes to jni/tcl/generic/tclTomMathDecls.h.
︙ | ︙ | |||
67 68 69 70 71 72 73 74 75 76 77 78 79 80 | #define mp_div_2d TclBN_mp_div_2d #define mp_div_3 TclBN_mp_div_3 #define mp_div_d TclBN_mp_div_d #define mp_exch TclBN_mp_exch #define mp_expt_d TclBN_mp_expt_d #define mp_expt_d_ex TclBN_mp_expt_d_ex #define mp_get_bit TclBN_mp_get_bit #define mp_grow TclBN_mp_grow #define mp_init TclBN_mp_init #define mp_init_copy TclBN_mp_init_copy #define mp_init_multi TclBN_mp_init_multi #define mp_init_set TclBN_mp_init_set #define mp_init_set_int TclBN_mp_init_set_int #define mp_init_size TclBN_mp_init_size | > | 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | #define mp_div_2d TclBN_mp_div_2d #define mp_div_3 TclBN_mp_div_3 #define mp_div_d TclBN_mp_div_d #define mp_exch TclBN_mp_exch #define mp_expt_d TclBN_mp_expt_d #define mp_expt_d_ex TclBN_mp_expt_d_ex #define mp_get_bit TclBN_mp_get_bit #define s_mp_get_bit TclBN_mp_get_bit #define mp_grow TclBN_mp_grow #define mp_init TclBN_mp_init #define mp_init_copy TclBN_mp_init_copy #define mp_init_multi TclBN_mp_init_multi #define mp_init_set TclBN_mp_init_set #define mp_init_set_int TclBN_mp_init_set_int #define mp_init_size TclBN_mp_init_size |
︙ | ︙ | |||
98 99 100 101 102 103 104 | #define mp_set_int TclBN_mp_set_int #define mp_set_long TclBN_mp_set_long #define mp_shrink TclBN_mp_shrink #define mp_sqr TclBN_mp_sqr #define mp_sqrt TclBN_mp_sqrt #define mp_sub TclBN_mp_sub #define mp_sub_d TclBN_mp_sub_d | > | | | | | 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | #define mp_set_int TclBN_mp_set_int #define mp_set_long TclBN_mp_set_long #define mp_shrink TclBN_mp_shrink #define mp_sqr TclBN_mp_sqr #define mp_sqrt TclBN_mp_sqrt #define mp_sub TclBN_mp_sub #define mp_sub_d TclBN_mp_sub_d #define mp_signed_rsh TclBN_mp_signed_rsh #define mp_tc_and TclBN_mp_and #define mp_tc_div_2d TclBN_mp_signed_rsh #define mp_tc_or TclBN_mp_or #define mp_tc_xor TclBN_mp_xor #define mp_to_unsigned_bin TclBN_mp_to_unsigned_bin #define mp_to_unsigned_bin_n TclBN_mp_to_unsigned_bin_n #define mp_toom_mul TclBN_mp_toom_mul #define s_mp_toom_mul TclBN_mp_toom_mul #define mp_toom_sqr TclBN_mp_toom_sqr #define s_mp_toom_sqr TclBN_mp_toom_sqr #define mp_toradix_n TclBN_mp_toradix_n |
︙ | ︙ | |||
325 326 327 328 329 330 331 | /* 74 */ EXTERN int TclBN_mp_tc_or(const mp_int *a, const mp_int *b, mp_int *c); /* 75 */ EXTERN int TclBN_mp_tc_xor(const mp_int *a, const mp_int *b, mp_int *c); /* 76 */ | | > | 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 | /* 74 */ EXTERN int TclBN_mp_tc_or(const mp_int *a, const mp_int *b, mp_int *c); /* 75 */ EXTERN int TclBN_mp_tc_xor(const mp_int *a, const mp_int *b, mp_int *c); /* 76 */ EXTERN int TclBN_mp_signed_rsh(const mp_int *a, int b, mp_int *c); /* 77 */ EXTERN int TclBN_mp_get_bit(const mp_int *a, int b); typedef struct TclTomMathStubs { int magic; void *hooks; |
︙ | ︙ | |||
409 410 411 412 413 414 415 | void (*reserved69)(void); int (*tclBN_mp_set_long) (mp_int *a, unsigned long i); /* 70 */ void (*reserved71)(void); void (*reserved72)(void); int (*tclBN_mp_tc_and) (const mp_int *a, const mp_int *b, mp_int *c); /* 73 */ int (*tclBN_mp_tc_or) (const mp_int *a, const mp_int *b, mp_int *c); /* 74 */ int (*tclBN_mp_tc_xor) (const mp_int *a, const mp_int *b, mp_int *c); /* 75 */ | | | 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 | void (*reserved69)(void); int (*tclBN_mp_set_long) (mp_int *a, unsigned long i); /* 70 */ void (*reserved71)(void); void (*reserved72)(void); int (*tclBN_mp_tc_and) (const mp_int *a, const mp_int *b, mp_int *c); /* 73 */ int (*tclBN_mp_tc_or) (const mp_int *a, const mp_int *b, mp_int *c); /* 74 */ int (*tclBN_mp_tc_xor) (const mp_int *a, const mp_int *b, mp_int *c); /* 75 */ int (*tclBN_mp_signed_rsh) (const mp_int *a, int b, mp_int *c); /* 76 */ int (*tclBN_mp_get_bit) (const mp_int *a, int b); /* 77 */ } TclTomMathStubs; extern const TclTomMathStubs *tclTomMathStubsPtr; #ifdef __cplusplus } |
︙ | ︙ | |||
573 574 575 576 577 578 579 | /* Slot 72 is reserved */ #define TclBN_mp_tc_and \ (tclTomMathStubsPtr->tclBN_mp_tc_and) /* 73 */ #define TclBN_mp_tc_or \ (tclTomMathStubsPtr->tclBN_mp_tc_or) /* 74 */ #define TclBN_mp_tc_xor \ (tclTomMathStubsPtr->tclBN_mp_tc_xor) /* 75 */ | | | | 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 | /* Slot 72 is reserved */ #define TclBN_mp_tc_and \ (tclTomMathStubsPtr->tclBN_mp_tc_and) /* 73 */ #define TclBN_mp_tc_or \ (tclTomMathStubsPtr->tclBN_mp_tc_or) /* 74 */ #define TclBN_mp_tc_xor \ (tclTomMathStubsPtr->tclBN_mp_tc_xor) /* 75 */ #define TclBN_mp_signed_rsh \ (tclTomMathStubsPtr->tclBN_mp_signed_rsh) /* 76 */ #define TclBN_mp_get_bit \ (tclTomMathStubsPtr->tclBN_mp_get_bit) /* 77 */ #endif /* defined(USE_TCL_STUBS) */ /* !END!: Do not edit above this line. */ #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT #endif /* _TCLINTDECLS */ |
jni/tcl/library/msgs/ja.msg became a regular file.
︙ | ︙ |
Deleted jni/tcl/libtommath/bn_mp_get_bit.c.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Added jni/tcl/libtommath/bn_mp_signed_rsh.c.
> > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | #include "tommath_private.h" #ifdef BN_MP_SIGNED_RSH_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* shift right by a certain bit count with sign extension */ mp_err mp_signed_rsh(const mp_int *a, int b, mp_int *c) { mp_err res; if (a->sign == MP_ZPOS) { return mp_div_2d(a, b, c, NULL); } res = mp_add_d(a, 1uL, c); if (res != MP_OKAY) { return res; } res = mp_div_2d(c, b, c, NULL); return (res == MP_OKAY) ? mp_sub_d(c, 1uL, c) : res; } #endif |
Deleted jni/tcl/libtommath/bn_mp_tc_and.c.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted jni/tcl/libtommath/bn_mp_tc_div_2d.c.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted jni/tcl/libtommath/bn_mp_tc_or.c.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted jni/tcl/libtommath/bn_mp_tc_xor.c.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Added jni/tcl/libtommath/bn_s_mp_get_bit.c.
> > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #include "tommath_private.h" #ifdef BN_S_MP_GET_BIT_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ /* Get bit at position b and return MP_YES if the bit is 1, MP_NO if it is 0 */ mp_bool s_mp_get_bit(const mp_int *a, int b) { mp_digit bit; int limb = (int)((unsigned)b / MP_DIGIT_BIT); if (limb >= a->used) { return MP_NO; } bit = (mp_digit)1 << ((unsigned)b % MP_DIGIT_BIT); return ((a->dp[limb] & bit) != 0u) ? MP_YES : MP_NO; } #endif |
Changes to jni/tcl/libtommath/tommath.h.
|
| | < < < < < < < < | | | 1 2 3 4 5 6 7 8 9 10 | /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ #ifndef BN_H_ #define BN_H_ #include <stdio.h> #include <stdlib.h> #include <limits.h> |
︙ | ︙ | |||
153 154 155 156 157 158 159 | /* clear a null terminated series of arguments */ void mp_clear_multi(mp_int *mp, ...); /* exchange two ints */ void mp_exch(mp_int *a, mp_int *b); /* shrink ram required for a bignum */ | | | | | | | 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | /* clear a null terminated series of arguments */ void mp_clear_multi(mp_int *mp, ...); /* exchange two ints */ void mp_exch(mp_int *a, mp_int *b); /* shrink ram required for a bignum */ mp_err mp_shrink(mp_int *a); /* grow an int to a given size */ mp_err mp_grow(mp_int *a, int size); /* init to a given number of digits */ mp_err mp_init_size(mp_int *a, int size); /* ---> Basic Manipulations <--- */ #define mp_iszero(a) (((a)->used == 0) ? MP_YES : MP_NO) #define mp_iseven(a) (((a)->used == 0 || (((a)->dp[0] & 1) == 0)) ? MP_YES : MP_NO) #define mp_isodd(a) (((a)->used > 0 && (((a)->dp[0] & 1) == 1)) ? MP_YES : MP_NO) #define mp_isneg(a) (((a)->sign != MP_ZPOS) ? MP_YES : MP_NO) /* set to zero */ void mp_zero(mp_int *a); /* set to a digit */ void mp_set(mp_int *a, mp_digit b); |
︙ | ︙ | |||
288 289 290 291 292 293 294 | /* c = a OR b (two complement) */ int mp_tc_or(const mp_int *a, const mp_int *b, mp_int *c); /* c = a AND b (two complement) */ int mp_tc_and(const mp_int *a, const mp_int *b, mp_int *c); /* right shift (two complement) */ | | | 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 | /* c = a OR b (two complement) */ int mp_tc_or(const mp_int *a, const mp_int *b, mp_int *c); /* c = a AND b (two complement) */ int mp_tc_and(const mp_int *a, const mp_int *b, mp_int *c); /* right shift (two complement) */ int mp_signed_rsh(const mp_int *a, int b, mp_int *c); /* ---> Basic arithmetic <--- */ /* b = ~a */ int mp_complement(const mp_int *a, mp_int *b); /* b = -a */ |
︙ | ︙ |
Changes to jni/tcl/libtommath/tommath_class.h.
︙ | ︙ | |||
55 56 57 58 59 60 61 | # define BN_MP_EXPT_D_EX_C # define BN_MP_EXPTMOD_C # define BN_MP_EXPTMOD_FAST_C # define BN_MP_EXTEUCLID_C # define BN_MP_FREAD_C # define BN_MP_FWRITE_C # define BN_MP_GCD_C | | | 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | # define BN_MP_EXPT_D_EX_C # define BN_MP_EXPTMOD_C # define BN_MP_EXPTMOD_FAST_C # define BN_MP_EXTEUCLID_C # define BN_MP_FREAD_C # define BN_MP_FWRITE_C # define BN_MP_GCD_C # define BN_S_MP_GET_BIT_C # define BN_MP_GET_DOUBLE_C # define BN_MP_GET_INT_C # define BN_MP_GET_LONG_C # define BN_MP_GET_LONG_LONG_C # define BN_MP_GROW_C # define BN_MP_IMPORT_C # define BN_MP_INIT_C |
︙ | ︙ | |||
131 132 133 134 135 136 137 | # define BN_MP_SQRMOD_C # define BN_MP_SQRT_C # define BN_MP_SQRTMOD_PRIME_C # define BN_MP_SUB_C # define BN_MP_SUB_D_C # define BN_MP_SUBMOD_C # define BN_MP_TC_AND_C | | | 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | # define BN_MP_SQRMOD_C # define BN_MP_SQRT_C # define BN_MP_SQRTMOD_PRIME_C # define BN_MP_SUB_C # define BN_MP_SUB_D_C # define BN_MP_SUBMOD_C # define BN_MP_TC_AND_C # define BN_MP_SIGNED_RSH_C # define BN_MP_TC_OR_C # define BN_MP_TC_XOR_C # define BN_MP_TO_SIGNED_BIN_C # define BN_MP_TO_SIGNED_BIN_N_C # define BN_MP_TO_UNSIGNED_BIN_C # define BN_MP_TO_UNSIGNED_BIN_N_C # define BN_MP_TOOM_MUL_C |
︙ | ︙ | |||
438 439 440 441 442 443 444 | # define BN_MP_CMP_MAG_C # define BN_MP_EXCH_C # define BN_S_MP_SUB_C # define BN_MP_MUL_2D_C # define BN_MP_CLEAR_C #endif | | | 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 | # define BN_MP_CMP_MAG_C # define BN_MP_EXCH_C # define BN_S_MP_SUB_C # define BN_MP_MUL_2D_C # define BN_MP_CLEAR_C #endif #if defined(BN_S_MP_GET_BIT_C) # define BN_MP_ISZERO_C #endif #if defined(BN_MP_GET_DOUBLE_C) # define BN_MP_ISNEG_C #endif |
︙ | ︙ | |||
711 712 713 714 715 716 717 | # define BN_MP_COUNT_BITS_C # define BN_MP_MUL_2_C # define BN_MP_MUL_D_C # define BN_MP_ADD_C # define BN_MP_MUL_C # define BN_MP_SUB_C # define BN_MP_MOD_C | | | 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 | # define BN_MP_COUNT_BITS_C # define BN_MP_MUL_2_C # define BN_MP_MUL_D_C # define BN_MP_ADD_C # define BN_MP_MUL_C # define BN_MP_SUB_C # define BN_MP_MOD_C # define BN_S_MP_GET_BIT_C # define BN_MP_EXCH_C # define BN_MP_ISZERO_C # define BN_MP_CMP_C # define BN_MP_CLEAR_MULTI_C #endif #if defined(BN_MP_PRIME_IS_DIVISIBLE_C) |
︙ | ︙ | |||
798 799 800 801 802 803 804 | # define BN_MP_DIV_2D_C # define BN_MP_SET_C # define BN_MP_MUL_2_C # define BN_MP_COUNT_BITS_C # define BN_MP_MOD_C # define BN_MP_SQR_C # define BN_MP_SUB_C | | | 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 | # define BN_MP_DIV_2D_C # define BN_MP_SET_C # define BN_MP_MUL_2_C # define BN_MP_COUNT_BITS_C # define BN_MP_MOD_C # define BN_MP_SQR_C # define BN_MP_SUB_C # define BN_S_MP_GET_BIT_C # define BN_MP_ADD_C # define BN_MP_ISODD_C # define BN_MP_DIV_2_C # define BN_MP_SUB_D_C # define BN_MP_ISZERO_C # define BN_MP_CLEAR_MULTI_C #endif |
︙ | ︙ | |||
1030 1031 1032 1033 1034 1035 1036 | # define BN_MP_INIT_C # define BN_MP_ADD_C # define BN_MP_CLEAR_C # define BN_MP_AND_C # define BN_MP_SUB_C #endif | | | 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 | # define BN_MP_INIT_C # define BN_MP_ADD_C # define BN_MP_CLEAR_C # define BN_MP_AND_C # define BN_MP_SUB_C #endif #if defined(BN_MP_SIGNED_RSH_C) # define BN_MP_ISNEG_C # define BN_MP_DIV_2D_C # define BN_MP_ADD_D_C # define BN_MP_SUB_D_C #endif #if defined(BN_MP_TC_OR_C) |
︙ | ︙ |
Changes to jni/tcl/unix/Makefile.in.
︙ | ︙ | |||
318 319 320 321 322 323 324 | TOMMATH_OBJS = bn_reverse.o bn_fast_s_mp_mul_digs.o \ bn_fast_s_mp_sqr.o bn_mp_add.o bn_mp_and.o \ bn_mp_add_d.o bn_mp_clamp.o bn_mp_clear.o bn_mp_clear_multi.o \ bn_mp_cmp.o bn_mp_cmp_d.o bn_mp_cmp_mag.o \ bn_mp_cnt_lsb.o bn_mp_copy.o \ bn_mp_count_bits.o bn_mp_div.o bn_mp_div_d.o bn_mp_div_2.o \ bn_mp_div_2d.o bn_mp_div_3.o bn_mp_exch.o bn_mp_expt_d.o \ | | | | 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 | TOMMATH_OBJS = bn_reverse.o bn_fast_s_mp_mul_digs.o \ bn_fast_s_mp_sqr.o bn_mp_add.o bn_mp_and.o \ bn_mp_add_d.o bn_mp_clamp.o bn_mp_clear.o bn_mp_clear_multi.o \ bn_mp_cmp.o bn_mp_cmp_d.o bn_mp_cmp_mag.o \ bn_mp_cnt_lsb.o bn_mp_copy.o \ bn_mp_count_bits.o bn_mp_div.o bn_mp_div_d.o bn_mp_div_2.o \ bn_mp_div_2d.o bn_mp_div_3.o bn_mp_exch.o bn_mp_expt_d.o \ bn_mp_expt_d_ex.o bn_s_mp_get_bit.o bn_mp_grow.o bn_mp_init.o \ bn_mp_init_copy.o bn_mp_init_multi.o bn_mp_init_set.o \ bn_mp_init_set_int.o bn_mp_init_size.o bn_mp_karatsuba_mul.o \ bn_mp_karatsuba_sqr.o \ bn_mp_lshd.o bn_mp_mod.o bn_mp_mod_2d.o bn_mp_mul.o bn_mp_mul_2.o \ bn_mp_mul_2d.o bn_mp_mul_d.o bn_mp_neg.o bn_mp_or.o \ bn_mp_radix_size.o bn_mp_radix_smap.o \ bn_mp_read_radix.o bn_mp_rshd.o bn_mp_set.o bn_mp_set_int.o \ bn_mp_set_long.o bn_mp_shrink.o \ bn_mp_sqr.o bn_mp_sqrt.o bn_mp_sub.o bn_mp_sub_d.o \ bn_mp_signed_rsh.o \ bn_mp_to_unsigned_bin.o bn_mp_to_unsigned_bin_n.o \ bn_mp_toom_mul.o bn_mp_toom_sqr.o bn_mp_toradix_n.o \ bn_mp_unsigned_bin_size.o bn_mp_xor.o bn_mp_zero.o bn_s_mp_add.o \ bn_s_mp_mul_digs.o bn_s_mp_sqr.o bn_s_mp_sub.o STUB_LIB_OBJS = tclStubLib.o \ tclTomMathStubLib.o \ |
︙ | ︙ | |||
504 505 506 507 508 509 510 | $(TOMMATH_DIR)/bn_mp_div_d.c \ $(TOMMATH_DIR)/bn_mp_div_2.c \ $(TOMMATH_DIR)/bn_mp_div_2d.c \ $(TOMMATH_DIR)/bn_mp_div_3.c \ $(TOMMATH_DIR)/bn_mp_exch.c \ $(TOMMATH_DIR)/bn_mp_expt_d.c \ $(TOMMATH_DIR)/bn_mp_expt_d_ex.c \ | | | 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 | $(TOMMATH_DIR)/bn_mp_div_d.c \ $(TOMMATH_DIR)/bn_mp_div_2.c \ $(TOMMATH_DIR)/bn_mp_div_2d.c \ $(TOMMATH_DIR)/bn_mp_div_3.c \ $(TOMMATH_DIR)/bn_mp_exch.c \ $(TOMMATH_DIR)/bn_mp_expt_d.c \ $(TOMMATH_DIR)/bn_mp_expt_d_ex.c \ $(TOMMATH_DIR)/bn_s_mp_get_bit.c \ $(TOMMATH_DIR)/bn_mp_grow.c \ $(TOMMATH_DIR)/bn_mp_init.c \ $(TOMMATH_DIR)/bn_mp_init_copy.c \ $(TOMMATH_DIR)/bn_mp_init_multi.c \ $(TOMMATH_DIR)/bn_mp_init_set.c \ $(TOMMATH_DIR)/bn_mp_init_set_int.c \ $(TOMMATH_DIR)/bn_mp_init_size.c \ |
︙ | ︙ | |||
535 536 537 538 539 540 541 | $(TOMMATH_DIR)/bn_mp_set_int.c \ $(TOMMATH_DIR)/bn_mp_set_long.c \ $(TOMMATH_DIR)/bn_mp_shrink.c \ $(TOMMATH_DIR)/bn_mp_sqr.c \ $(TOMMATH_DIR)/bn_mp_sqrt.c \ $(TOMMATH_DIR)/bn_mp_sub.c \ $(TOMMATH_DIR)/bn_mp_sub_d.c \ | | < < < | 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 | $(TOMMATH_DIR)/bn_mp_set_int.c \ $(TOMMATH_DIR)/bn_mp_set_long.c \ $(TOMMATH_DIR)/bn_mp_shrink.c \ $(TOMMATH_DIR)/bn_mp_sqr.c \ $(TOMMATH_DIR)/bn_mp_sqrt.c \ $(TOMMATH_DIR)/bn_mp_sub.c \ $(TOMMATH_DIR)/bn_mp_sub_d.c \ $(TOMMATH_DIR)/bn_mp_signed_rsh.c \ $(TOMMATH_DIR)/bn_mp_to_unsigned_bin.c \ $(TOMMATH_DIR)/bn_mp_to_unsigned_bin_n.c \ $(TOMMATH_DIR)/bn_mp_toom_mul.c \ $(TOMMATH_DIR)/bn_mp_toom_sqr.c \ $(TOMMATH_DIR)/bn_mp_toradix_n.c \ $(TOMMATH_DIR)/bn_mp_unsigned_bin_size.c \ $(TOMMATH_DIR)/bn_mp_xor.c \ |
︙ | ︙ | |||
1430 1431 1432 1433 1434 1435 1436 | bn_mp_expt_d.o: $(TOMMATH_DIR)/bn_mp_expt_d.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_expt_d.c bn_mp_expt_d_ex.o: $(TOMMATH_DIR)/bn_mp_expt_d_ex.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_expt_d_ex.c | | | | 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 | bn_mp_expt_d.o: $(TOMMATH_DIR)/bn_mp_expt_d.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_expt_d.c bn_mp_expt_d_ex.o: $(TOMMATH_DIR)/bn_mp_expt_d_ex.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_expt_d_ex.c bn_s_mp_get_bit.o: $(TOMMATH_DIR)/bn_s_mp_get_bit.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_s_mp_get_bit.c bn_mp_grow.o: $(TOMMATH_DIR)/bn_mp_grow.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_grow.c bn_mp_init.o: $(TOMMATH_DIR)/bn_mp_init.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_init.c |
︙ | ︙ | |||
1523 1524 1525 1526 1527 1528 1529 | bn_mp_sub.o: $(TOMMATH_DIR)/bn_mp_sub.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_sub.c bn_mp_sub_d.o: $(TOMMATH_DIR)/bn_mp_sub_d.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_sub_d.c | < < < < < < | | < < < | 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 | bn_mp_sub.o: $(TOMMATH_DIR)/bn_mp_sub.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_sub.c bn_mp_sub_d.o: $(TOMMATH_DIR)/bn_mp_sub_d.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_sub_d.c bn_mp_signed_rsh.o: $(TOMMATH_DIR)/bn_mp_signed_rsh.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_signed_rsh.c bn_mp_to_unsigned_bin.o: $(TOMMATH_DIR)/bn_mp_to_unsigned_bin.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_to_unsigned_bin.c bn_mp_to_unsigned_bin_n.o: $(TOMMATH_DIR)/bn_mp_to_unsigned_bin_n.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_to_unsigned_bin_n.c |
︙ | ︙ |
Changes to jni/tcl/win/Makefile.in.
︙ | ︙ | |||
331 332 333 334 335 336 337 | bn_mp_div_d.${OBJEXT} \ bn_mp_div_2.${OBJEXT} \ bn_mp_div_2d.${OBJEXT} \ bn_mp_div_3.${OBJEXT} \ bn_mp_exch.${OBJEXT} \ bn_mp_expt_d.${OBJEXT} \ bn_mp_expt_d_ex.${OBJEXT} \ | | | 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 | bn_mp_div_d.${OBJEXT} \ bn_mp_div_2.${OBJEXT} \ bn_mp_div_2d.${OBJEXT} \ bn_mp_div_3.${OBJEXT} \ bn_mp_exch.${OBJEXT} \ bn_mp_expt_d.${OBJEXT} \ bn_mp_expt_d_ex.${OBJEXT} \ bn_s_mp_get_bit.${OBJEXT} \ bn_mp_grow.${OBJEXT} \ bn_mp_init.${OBJEXT} \ bn_mp_init_copy.${OBJEXT} \ bn_mp_init_multi.${OBJEXT} \ bn_mp_init_set.${OBJEXT} \ bn_mp_init_set_int.${OBJEXT} \ bn_mp_init_size.${OBJEXT} \ |
︙ | ︙ | |||
362 363 364 365 366 367 368 | bn_mp_set_int.${OBJEXT} \ bn_mp_set_long.${OBJEXT} \ bn_mp_shrink.${OBJEXT} \ bn_mp_sqr.${OBJEXT} \ bn_mp_sqrt.${OBJEXT} \ bn_mp_sub.${OBJEXT} \ bn_mp_sub_d.${OBJEXT} \ | < < | < | 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 | bn_mp_set_int.${OBJEXT} \ bn_mp_set_long.${OBJEXT} \ bn_mp_shrink.${OBJEXT} \ bn_mp_sqr.${OBJEXT} \ bn_mp_sqrt.${OBJEXT} \ bn_mp_sub.${OBJEXT} \ bn_mp_sub_d.${OBJEXT} \ bn_mp_signed_rsh.${OBJEXT} \ bn_mp_to_unsigned_bin.${OBJEXT} \ bn_mp_to_unsigned_bin_n.${OBJEXT} \ bn_mp_toom_mul.${OBJEXT} \ bn_mp_toom_sqr.${OBJEXT} \ bn_mp_toradix_n.${OBJEXT} \ bn_mp_unsigned_bin_size.${OBJEXT} \ bn_mp_xor.${OBJEXT} \ |
︙ | ︙ |
Changes to jni/tcl/win/makefile.vc.
︙ | ︙ | |||
270 271 272 273 274 275 276 | $(TMP_DIR)\bn_mp_div_d.obj \ $(TMP_DIR)\bn_mp_div_2.obj \ $(TMP_DIR)\bn_mp_div_2d.obj \ $(TMP_DIR)\bn_mp_div_3.obj \ $(TMP_DIR)\bn_mp_exch.obj \ $(TMP_DIR)\bn_mp_expt_d.obj \ $(TMP_DIR)\bn_mp_expt_d_ex.obj \ | | | 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 | $(TMP_DIR)\bn_mp_div_d.obj \ $(TMP_DIR)\bn_mp_div_2.obj \ $(TMP_DIR)\bn_mp_div_2d.obj \ $(TMP_DIR)\bn_mp_div_3.obj \ $(TMP_DIR)\bn_mp_exch.obj \ $(TMP_DIR)\bn_mp_expt_d.obj \ $(TMP_DIR)\bn_mp_expt_d_ex.obj \ $(TMP_DIR)\bn_s_mp_get_bit.obj \ $(TMP_DIR)\bn_mp_grow.obj \ $(TMP_DIR)\bn_mp_init.obj \ $(TMP_DIR)\bn_mp_init_copy.obj \ $(TMP_DIR)\bn_mp_init_multi.obj \ $(TMP_DIR)\bn_mp_init_set.obj \ $(TMP_DIR)\bn_mp_init_set_int.obj \ $(TMP_DIR)\bn_mp_init_size.obj \ |
︙ | ︙ | |||
301 302 303 304 305 306 307 | $(TMP_DIR)\bn_mp_set_int.obj \ $(TMP_DIR)\bn_mp_set_long.obj \ $(TMP_DIR)\bn_mp_shrink.obj \ $(TMP_DIR)\bn_mp_sqr.obj \ $(TMP_DIR)\bn_mp_sqrt.obj \ $(TMP_DIR)\bn_mp_sub.obj \ $(TMP_DIR)\bn_mp_sub_d.obj \ | < < | < | 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 | $(TMP_DIR)\bn_mp_set_int.obj \ $(TMP_DIR)\bn_mp_set_long.obj \ $(TMP_DIR)\bn_mp_shrink.obj \ $(TMP_DIR)\bn_mp_sqr.obj \ $(TMP_DIR)\bn_mp_sqrt.obj \ $(TMP_DIR)\bn_mp_sub.obj \ $(TMP_DIR)\bn_mp_sub_d.obj \ $(TMP_DIR)\bn_mp_signed_rsh.obj \ $(TMP_DIR)\bn_mp_to_unsigned_bin.obj \ $(TMP_DIR)\bn_mp_to_unsigned_bin_n.obj \ $(TMP_DIR)\bn_mp_toom_mul.obj \ $(TMP_DIR)\bn_mp_toom_sqr.obj \ $(TMP_DIR)\bn_mp_toradix_n.obj \ $(TMP_DIR)\bn_mp_unsigned_bin_size.obj \ $(TMP_DIR)\bn_mp_xor.obj \ |
︙ | ︙ |