Tcl Source Code

Check-in [a6db8815ce]
Login

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

Overview
Comment:Merge trunk
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | tip-502-for-9
Files: files | file ages | folders
SHA3-256: a6db8815ce3fbc8c88223d978d1796347b8ce04d748aa5a34808808bbceee5f5
User & Date: jan.nijtmans 2019-02-04 22:45:59.773
Context
2019-02-05
21:58
Merge trunk Closed-Leaf check-in: b95e36dfa8 user: jan.nijtmans tags: tip-502-for-9
2019-02-04
22:45
Merge trunk check-in: a6db8815ce user: jan.nijtmans tags: tip-502-for-9
2019-02-01
20:36
Another (big) round of int -> size_t enhancements. So Tcl can handle string >2GiB in more places. check-in: 8534448b44 user: jan.nijtmans tags: trunk
2019-01-24
21:07
Merge trunk check-in: 28d2c77936 user: jan.nijtmans tags: tip-502-for-9
Changes
Unified Diff Ignore Whitespace Patch
Changes to compat/strtol.c.
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
    long result;

    /*
     * Skip any leading blanks.
     */

    p = string;
    while (isspace(UCHAR(*p))) {
	p += 1;
    }

    /*
     * Check for a sign.
     */








|







49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
    long result;

    /*
     * Skip any leading blanks.
     */

    p = string;
    while (TclIsSpaceProc(*p)) {
	p += 1;
    }

    /*
     * Check for a sign.
     */

Changes to compat/strtoul.c.
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
    int overflow=0;

    /*
     * Skip any leading blanks.
     */

    p = string;
    while (isspace(UCHAR(*p))) {
	p += 1;
    }
    if (*p == '-') {
        negative = 1;
        p += 1;
    } else {
        if (*p == '+') {







|







70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
    int overflow=0;

    /*
     * Skip any leading blanks.
     */

    p = string;
    while (TclIsSpaceProc(*p)) {
	p += 1;
    }
    if (*p == '-') {
        negative = 1;
        p += 1;
    } else {
        if (*p == '+') {
Deleted compat/unistd.h.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
 * unistd.h --
 *
 *      Macros, constants and prototypes for Posix conformance.
 *
 * Copyright 1989 Regents of the University of California Permission to use,
 * copy, modify, and distribute this software and its documentation for any
 * purpose and without fee is hereby granted, provided that the above
 * copyright notice appear in all copies. The University of California makes
 * no representations about the suitability of this software for any purpose.
 * It is provided "as is" without express or implied warranty.
 */

#ifndef _UNISTD
#define _UNISTD

#include <sys/types.h>

#ifndef NULL
#define NULL    0
#endif

/*
 * Strict POSIX stuff goes here. Extensions go down below, in the ifndef
 * _POSIX_SOURCE section.
 */

extern void		_exit(int status);
extern int		access(const char *path, int mode);
extern int		chdir(const char *path);
extern int		chown(const char *path, uid_t owner, gid_t group);
extern int		close(int fd);
extern int		dup(int oldfd);
extern int		dup2(int oldfd, int newfd);
extern int		execl(const char *path, ...);
extern int		execle(const char *path, ...);
extern int		execlp(const char *file, ...);
extern int		execv(const char *path, char **argv);
extern int		execve(const char *path, char **argv, char **envp);
extern int		execvpw(const char *file, char **argv);
extern pid_t		fork(void);
extern char *		getcwd(char *buf, size_t size);
extern gid_t		getegid(void);
extern uid_t		geteuid(void);
extern gid_t		getgid(void);
extern int		getgroups(int bufSize, int *buffer);
extern pid_t		getpid(void);
extern uid_t		getuid(void);
extern int		isatty(int fd);
extern long		lseek(int fd, long offset, int whence);
extern int		pipe(int *fildes);
extern int		read(int fd, char *buf, size_t size);
extern int		setgid(gid_t group);
extern int		setuid(uid_t user);
extern unsigned		sleep(unsigned seconds);
extern char *		ttyname(int fd);
extern int		unlink(const char *path);
extern int		write(int fd, const char *buf, size_t size);

#ifndef	_POSIX_SOURCE
extern char *		crypt(const char *, const char *);
extern int		fchown(int fd, uid_t owner, gid_t group);
extern int		flock(int fd, int operation);
extern int		ftruncate(int fd, unsigned long length);
extern int		ioctl(int fd, int request, ...);
extern int		readlink(const char *path, char *buf, int bufsize);
extern int		setegid(gid_t group);
extern int		seteuidw(uid_t user);
extern int		setreuid(int ruid, int euid);
extern int		symlink(const char *, const char *);
extern int		ttyslot(void);
extern int		truncate(const char *path, unsigned long length);
extern int		vfork(void);
#endif /* _POSIX_SOURCE */

#endif /* _UNISTD */
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
























































































































































Changes to doc/ParseArgs.3.
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
As noted above, the \fItype\fR field is used to describe the interpretation of
the argument's value. The following values are acceptable values for
\fItype\fR:
.TP
\fBTCL_ARGV_CONSTANT\fR
.
The argument does not take any following value argument. If this argument is
present, the int pointed to by the \fIsrcPtr\fR field is copied to the
\fIdstPtr\fR field. The \fIclientData\fR field is ignored.
.TP
\fBTCL_ARGV_END\fR
.
This value marks the end of all option descriptors in the table. All other
fields are ignored.
.TP
\fBTCL_ARGV_FLOAT\fR







|
|







99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
As noted above, the \fItype\fR field is used to describe the interpretation of
the argument's value. The following values are acceptable values for
\fItype\fR:
.TP
\fBTCL_ARGV_CONSTANT\fR
.
The argument does not take any following value argument. If this argument is
present, the \fIsrcPtr\fR field (casted to \fIint\fR) is copied to the variable
pointed to by the \fIdstPtr\fR field. The \fIclientData\fR field is ignored.
.TP
\fBTCL_ARGV_END\fR
.
This value marks the end of all option descriptors in the table. All other
fields are ignored.
.TP
\fBTCL_ARGV_FLOAT\fR
Changes to generic/regcomp.c.
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
 * forward declarations, up here so forward datatypes etc. are defined early
 */
/* =====^!^===== begin forwards =====^!^===== */
/* automatically gathered by fwd; do not hand-edit */
/* === regcomp.c === */
int compile(regex_t *, const chr *, size_t, int);
static void moresubs(struct vars *, int);
static int freev(struct vars *, int);
static void makesearch(struct vars *, struct nfa *);
static struct subre *parse(struct vars *, int, int, struct state *, struct state *);
static struct subre *parsebranch(struct vars *, int, int, struct state *, struct state *, int);
static void parseqatom(struct vars *, int, int, struct state *, struct state *, struct subre *);
static void nonword(struct vars *, int, struct state *, struct state *);
static void word(struct vars *, int, struct state *, struct state *);







|







35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
 * forward declarations, up here so forward datatypes etc. are defined early
 */
/* =====^!^===== begin forwards =====^!^===== */
/* automatically gathered by fwd; do not hand-edit */
/* === regcomp.c === */
int compile(regex_t *, const chr *, size_t, int);
static void moresubs(struct vars *, size_t);
static int freev(struct vars *, int);
static void makesearch(struct vars *, struct nfa *);
static struct subre *parse(struct vars *, int, int, struct state *, struct state *);
static struct subre *parsebranch(struct vars *, int, int, struct state *, struct state *, int);
static void parseqatom(struct vars *, int, int, struct state *, struct state *, struct subre *);
static void nonword(struct vars *, int, struct state *, struct state *);
static void word(struct vars *, int, struct state *, struct state *);
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509

    assert(v->err == 0);
    return freev(v, 0);
}

/*
 - moresubs - enlarge subRE vector
 ^ static void moresubs(struct vars *, int);
 */
static void
moresubs(
    struct vars *v,
    int wanted)			/* want enough room for this one */
{
    struct subre **p;
    size_t n;

    assert(wanted > 0 && (size_t)wanted >= v->nsubs);
    n = (size_t)wanted * 3 / 2 + 1;
    if (v->subs == v->sub10) {
	p = (struct subre **) MALLOC(n * sizeof(struct subre *));
	if (p != NULL) {
	    memcpy(p, v->subs, v->nsubs * sizeof(struct subre *));
	}
    } else {
	p = (struct subre **) REALLOC(v->subs, n*sizeof(struct subre *));
    }
    if (p == NULL) {
	ERR(REG_ESPACE);
	return;
    }

    v->subs = p;
    for (p = &v->subs[v->nsubs]; v->nsubs < n; p++, v->nsubs++) {
	*p = NULL;
    }
    assert(v->nsubs == n);
    assert((size_t)wanted < v->nsubs);
}

/*
 - freev - free vars struct's substructures where necessary
 * Optionally does error-number setting, and always returns error code (if
 * any), to make error-handling code terser.
 ^ static int freev(struct vars *, int);







|




|




|
|


















|







465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509

    assert(v->err == 0);
    return freev(v, 0);
}

/*
 - moresubs - enlarge subRE vector
 ^ static void moresubs(struct vars *, size_t);
 */
static void
moresubs(
    struct vars *v,
    size_t wanted)			/* want enough room for this one */
{
    struct subre **p;
    size_t n;

    assert(wanted > 0 && wanted >= v->nsubs);
    n = wanted * 3 / 2 + 1;
    if (v->subs == v->sub10) {
	p = (struct subre **) MALLOC(n * sizeof(struct subre *));
	if (p != NULL) {
	    memcpy(p, v->subs, v->nsubs * sizeof(struct subre *));
	}
    } else {
	p = (struct subre **) REALLOC(v->subs, n*sizeof(struct subre *));
    }
    if (p == NULL) {
	ERR(REG_ESPACE);
	return;
    }

    v->subs = p;
    for (p = &v->subs[v->nsubs]; v->nsubs < n; p++, v->nsubs++) {
	*p = NULL;
    }
    assert(v->nsubs == n);
    assert(wanted < v->nsubs);
}

/*
 - freev - free vars struct's substructures where necessary
 * Optionally does error-number setting, and always returns error code (if
 * any), to make error-handling code terser.
 ^ static int freev(struct vars *, int);
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
    struct state *s2;
#define	ARCV(t, val)	newarc(v->nfa, t, val, lp, rp)
    int m, n;
    struct subre *atom;		/* atom's subtree */
    struct subre *t;
    int cap;			/* capturing parens? */
    int pos;			/* positive lookahead? */
    int subno;			/* capturing-parens or backref number */
    int atomtype;
    int qprefer;		/* quantifier short/long preference */
    int f;
    struct subre **atomp;	/* where the pointer to atom is */

    /*
     * Initial bookkeeping.







|







793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
    struct state *s2;
#define	ARCV(t, val)	newarc(v->nfa, t, val, lp, rp)
    int m, n;
    struct subre *atom;		/* atom's subtree */
    struct subre *t;
    int cap;			/* capturing parens? */
    int pos;			/* positive lookahead? */
    size_t subno;			/* capturing-parens or backref number */
    int atomtype;
    int qprefer;		/* quantifier short/long preference */
    int f;
    struct subre **atomp;	/* where the pointer to atom is */

    /*
     * Initial bookkeeping.
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
	 */

    case '(':			/* value flags as capturing or non */
	cap = (type == LACON) ? 0 : v->nextvalue;
	if (cap) {
	    v->nsubexp++;
	    subno = v->nsubexp;
	    if ((size_t)subno >= v->nsubs) {
		moresubs(v, subno);
	    }
	    assert((size_t)subno < v->nsubs);
	} else {
	    atomtype = PLAIN;	/* something that's not '(' */
	}
	NEXT();

	/*
	 * Need new endpoints because tree will contain pointers.







|


|







950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
	 */

    case '(':			/* value flags as capturing or non */
	cap = (type == LACON) ? 0 : v->nextvalue;
	if (cap) {
	    v->nsubexp++;
	    subno = v->nsubexp;
	    if (subno >= v->nsubs) {
		moresubs(v, subno);
	    }
	    assert(subno < v->nsubs);
	} else {
	    atomtype = PLAIN;	/* something that's not '(' */
	}
	NEXT();

	/*
	 * Need new endpoints because tree will contain pointers.
Changes to generic/tcl.h.
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
typedef union Tcl_ObjIntRep {	/* The internal representation: */
    long longValue;		/*   - an long integer value. */
    double doubleValue;		/*   - a double-precision floating value. */
    void *otherValuePtr;	/*   - another, type-specific value, */
				/*     not used internally any more. */
    Tcl_WideInt wideValue;	/*   - an integer value >= 64bits */
    struct {			/*   - internal rep as two pointers. */
	void *ptr1;		
	void *ptr2;
    } twoPtrValue;
    struct {			/*   - internal rep as a pointer and a long, */
	void *ptr;		/*     not used internally any more. */
	unsigned long value;
    } ptrAndLongRep;
} Tcl_ObjIntRep;







|







623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
typedef union Tcl_ObjIntRep {	/* The internal representation: */
    long longValue;		/*   - an long integer value. */
    double doubleValue;		/*   - a double-precision floating value. */
    void *otherValuePtr;	/*   - another, type-specific value, */
				/*     not used internally any more. */
    Tcl_WideInt wideValue;	/*   - an integer value >= 64bits */
    struct {			/*   - internal rep as two pointers. */
	void *ptr1;
	void *ptr2;
    } twoPtrValue;
    struct {			/*   - internal rep as a pointer and a long, */
	void *ptr;		/*     not used internally any more. */
	unsigned long value;
    } ptrAndLongRep;
} Tcl_ObjIntRep;
Changes to generic/tclAlloc.c.
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
	if (newPtr == NULL) {
	    return NULL;
	}
	maxSize -= OVERHEAD;
	if (maxSize < numBytes) {
	    numBytes = maxSize;
	}
	memcpy(newPtr, oldPtr, (size_t) numBytes);
	TclpFree(oldPtr);
	return newPtr;
    }

    /*
     * Ok, we don't have to copy, it fits as-is
     */







|







599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
	if (newPtr == NULL) {
	    return NULL;
	}
	maxSize -= OVERHEAD;
	if (maxSize < numBytes) {
	    numBytes = maxSize;
	}
	memcpy(newPtr, oldPtr, numBytes);
	TclpFree(oldPtr);
	return newPtr;
    }

    /*
     * Ok, we don't have to copy, it fits as-is
     */
Changes to generic/tclBasic.c.
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
     * Register Tcl's version number.
     * TIP #268: Full patchlevel instead of just major.minor
     */

    Tcl_PkgProvideEx(interp, "Tcl", TCL_PATCH_LEVEL, &tclStubs);

    if (TclTommath_Init(interp) != TCL_OK) {
	Tcl_Panic("%s", TclGetString(Tcl_GetObjResult(interp)));
    }

    if (TclOOInit(interp) != TCL_OK) {
	Tcl_Panic("%s", TclGetString(Tcl_GetObjResult(interp)));
    }

    /*
     * Only build in zlib support if we've successfully detected a library to
     * compile and link against.
     */

#ifdef HAVE_ZLIB
    if (TclZlibInit(interp) != TCL_OK) {
	Tcl_Panic("%s", TclGetString(Tcl_GetObjResult(interp)));
    }
    if (TclZipfs_Init(interp) != TCL_OK) {
	Tcl_Panic("%s", Tcl_GetString(Tcl_GetObjResult(interp)));
    }
#endif

    TOP_CB(iPtr) = NULL;
    return interp;
}








|



|









|


|







1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
     * Register Tcl's version number.
     * TIP #268: Full patchlevel instead of just major.minor
     */

    Tcl_PkgProvideEx(interp, "Tcl", TCL_PATCH_LEVEL, &tclStubs);

    if (TclTommath_Init(interp) != TCL_OK) {
	Tcl_Panic("%s", Tcl_GetStringResult(interp));
    }

    if (TclOOInit(interp) != TCL_OK) {
	Tcl_Panic("%s", Tcl_GetStringResult(interp));
    }

    /*
     * Only build in zlib support if we've successfully detected a library to
     * compile and link against.
     */

#ifdef HAVE_ZLIB
    if (TclZlibInit(interp) != TCL_OK) {
	Tcl_Panic("%s", Tcl_GetStringResult(interp));
    }
    if (TclZipfs_Init(interp) != TCL_OK) {
	Tcl_Panic("%s", Tcl_GetStringResult(interp));
    }
#endif

    TOP_CB(iPtr) = NULL;
    return interp;
}

1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229

            if (TclRenameCommand(interp, TclGetString(cmdName),
                        "___tmp") != TCL_OK
                    || Tcl_HideCommand(interp, "___tmp",
                            TclGetString(hideName)) != TCL_OK) {
                Tcl_Panic("problem making '%s %s' safe: %s",
                        unsafePtr->ensembleNsName, unsafePtr->commandName,
                        Tcl_GetString(Tcl_GetObjResult(interp)));
            }
            Tcl_CreateObjCommand(interp, TclGetString(cmdName),
                    BadEnsembleSubcommand, (ClientData) unsafePtr, NULL);
            TclDecrRefCount(cmdName);
            TclDecrRefCount(hideName);
        } else {
            /*
             * Hide an ensemble main command (for compatibility).
             */

            if (Tcl_HideCommand(interp, unsafePtr->ensembleNsName,
                    unsafePtr->ensembleNsName) != TCL_OK) {
                Tcl_Panic("problem making '%s' safe: %s",
                        unsafePtr->ensembleNsName,
                        Tcl_GetString(Tcl_GetObjResult(interp)));
            }
        }
    }

    return TCL_OK;
}








|














|







1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229

            if (TclRenameCommand(interp, TclGetString(cmdName),
                        "___tmp") != TCL_OK
                    || Tcl_HideCommand(interp, "___tmp",
                            TclGetString(hideName)) != TCL_OK) {
                Tcl_Panic("problem making '%s %s' safe: %s",
                        unsafePtr->ensembleNsName, unsafePtr->commandName,
                        Tcl_GetStringResult(interp));
            }
            Tcl_CreateObjCommand(interp, TclGetString(cmdName),
                    BadEnsembleSubcommand, (ClientData) unsafePtr, NULL);
            TclDecrRefCount(cmdName);
            TclDecrRefCount(hideName);
        } else {
            /*
             * Hide an ensemble main command (for compatibility).
             */

            if (Tcl_HideCommand(interp, unsafePtr->ensembleNsName,
                    unsafePtr->ensembleNsName) != TCL_OK) {
                Tcl_Panic("problem making '%s' safe: %s",
                        unsafePtr->ensembleNsName,
                        Tcl_GetStringResult(interp));
            }
        }
    }

    return TCL_OK;
}

3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
     * allowed to catch the script cancellation because the evaluation stack
     * for the interp is completely unwound.
     */

    if (resultObjPtr != NULL) {
	result = TclGetStringFromObj(resultObjPtr, &cancelInfo->length);
	cancelInfo->result = Tcl_Realloc(cancelInfo->result,cancelInfo->length);
	memcpy(cancelInfo->result, result, (size_t) cancelInfo->length);
	TclDecrRefCount(resultObjPtr);	/* Discard their result object. */
    } else {
	cancelInfo->result = NULL;
	cancelInfo->length = 0;
    }
    cancelInfo->clientData = clientData;
    cancelInfo->flags = flags;







|







3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
     * allowed to catch the script cancellation because the evaluation stack
     * for the interp is completely unwound.
     */

    if (resultObjPtr != NULL) {
	result = TclGetStringFromObj(resultObjPtr, &cancelInfo->length);
	cancelInfo->result = Tcl_Realloc(cancelInfo->result,cancelInfo->length);
	memcpy(cancelInfo->result, result, cancelInfo->length);
	TclDecrRefCount(resultObjPtr);	/* Discard their result object. */
    } else {
	cancelInfo->result = NULL;
	cancelInfo->length = 0;
    }
    cancelInfo->clientData = clientData;
    cancelInfo->flags = flags;
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
    if (objc != 2) {
	MathFuncWrongNumArgs(interp, 2, objc, objv);
	return TCL_ERROR;
    }
    code = Tcl_GetDoubleFromObj(interp, objv[1], &d);
#ifdef ACCEPT_NAN
    if (code != TCL_OK) {
	const Tcl_ObjIntRep *irPtr = Tcl_FetchIntRep(objv[1], &tclDoubleType);

	if (irPtr) {
	    Tcl_SetObjResult(interp, objv[1]);
	    return TCL_OK;
	}
    }
#endif







|







6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
    if (objc != 2) {
	MathFuncWrongNumArgs(interp, 2, objc, objv);
	return TCL_ERROR;
    }
    code = Tcl_GetDoubleFromObj(interp, objv[1], &d);
#ifdef ACCEPT_NAN
    if (code != TCL_OK) {
	const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objv[1], &tclDoubleType);

	if (irPtr) {
	    Tcl_SetObjResult(interp, objv[1]);
	    return TCL_OK;
	}
    }
#endif
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
    if (objc != 2) {
	MathFuncWrongNumArgs(interp, 2, objc, objv);
	return TCL_ERROR;
    }
    code = Tcl_GetDoubleFromObj(interp, objv[1], &d);
#ifdef ACCEPT_NAN
    if (code != TCL_OK) {
	const Tcl_ObjIntRep *irPtr = Tcl_FetchIntRep(objv[1], &tclDoubleType);

	if (irPtr) {
	    Tcl_SetObjResult(interp, objv[1]);
	    return TCL_OK;
	}
    }
#endif







|







6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
    if (objc != 2) {
	MathFuncWrongNumArgs(interp, 2, objc, objv);
	return TCL_ERROR;
    }
    code = Tcl_GetDoubleFromObj(interp, objv[1], &d);
#ifdef ACCEPT_NAN
    if (code != TCL_OK) {
	const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objv[1], &tclDoubleType);

	if (irPtr) {
	    Tcl_SetObjResult(interp, objv[1]);
	    return TCL_OK;
	}
    }
#endif
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
    if (objc != 2) {
	MathFuncWrongNumArgs(interp, 2, objc, objv);
	return TCL_ERROR;
    }
    code = Tcl_GetDoubleFromObj(interp, objv[1], &d);
#ifdef ACCEPT_NAN
    if (code != TCL_OK) {
	const Tcl_ObjIntRep *irPtr = Tcl_FetchIntRep(objv[1], &tclDoubleType);

	if (irPtr) {
	    Tcl_SetObjResult(interp, objv[1]);
	    return TCL_OK;
	}
    }
#endif







|







6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
    if (objc != 2) {
	MathFuncWrongNumArgs(interp, 2, objc, objv);
	return TCL_ERROR;
    }
    code = Tcl_GetDoubleFromObj(interp, objv[1], &d);
#ifdef ACCEPT_NAN
    if (code != TCL_OK) {
	const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objv[1], &tclDoubleType);

	if (irPtr) {
	    Tcl_SetObjResult(interp, objv[1]);
	    return TCL_OK;
	}
    }
#endif
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
    if (objc != 2) {
	MathFuncWrongNumArgs(interp, 2, objc, objv);
	return TCL_ERROR;
    }
    code = Tcl_GetDoubleFromObj(interp, objv[1], &d);
#ifdef ACCEPT_NAN
    if (code != TCL_OK) {
	const Tcl_ObjIntRep *irPtr = Tcl_FetchIntRep(objv[1], &tclDoubleType);

	if (irPtr) {
	    d = irPtr->doubleValue;
	    Tcl_ResetResult(interp);
	    code = TCL_OK;
	}
    }







|







6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
    if (objc != 2) {
	MathFuncWrongNumArgs(interp, 2, objc, objv);
	return TCL_ERROR;
    }
    code = Tcl_GetDoubleFromObj(interp, objv[1], &d);
#ifdef ACCEPT_NAN
    if (code != TCL_OK) {
	const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objv[1], &tclDoubleType);

	if (irPtr) {
	    d = irPtr->doubleValue;
	    Tcl_ResetResult(interp);
	    code = TCL_OK;
	}
    }
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
    if (objc != 3) {
	MathFuncWrongNumArgs(interp, 3, objc, objv);
	return TCL_ERROR;
    }
    code = Tcl_GetDoubleFromObj(interp, objv[1], &d1);
#ifdef ACCEPT_NAN
    if (code != TCL_OK) {
	const Tcl_ObjIntRep *irPtr = Tcl_FetchIntRep(objv[1], &tclDoubleType);

	if (irPtr) {
	    d1 = irPtr->doubleValue;
	    Tcl_ResetResult(interp);
	    code = TCL_OK;
	}
    }
#endif
    if (code != TCL_OK) {
	return TCL_ERROR;
    }
    code = Tcl_GetDoubleFromObj(interp, objv[2], &d2);
#ifdef ACCEPT_NAN
    if (code != TCL_OK) {
	const Tcl_ObjIntRep *irPtr = Tcl_FetchIntRep(objv[1], &tclDoubleType);

	if (irPtr) {
	    d2 = irPtr->doubleValue;
	    Tcl_ResetResult(interp);
	    code = TCL_OK;
	}
    }







|














|







6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
    if (objc != 3) {
	MathFuncWrongNumArgs(interp, 3, objc, objv);
	return TCL_ERROR;
    }
    code = Tcl_GetDoubleFromObj(interp, objv[1], &d1);
#ifdef ACCEPT_NAN
    if (code != TCL_OK) {
	const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objv[1], &tclDoubleType);

	if (irPtr) {
	    d1 = irPtr->doubleValue;
	    Tcl_ResetResult(interp);
	    code = TCL_OK;
	}
    }
#endif
    if (code != TCL_OK) {
	return TCL_ERROR;
    }
    code = Tcl_GetDoubleFromObj(interp, objv[2], &d2);
#ifdef ACCEPT_NAN
    if (code != TCL_OK) {
	const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objv[1], &tclDoubleType);

	if (irPtr) {
	    d2 = irPtr->doubleValue;
	    Tcl_ResetResult(interp);
	    code = TCL_OK;
	}
    }
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168

    if (objc != 2) {
	MathFuncWrongNumArgs(interp, 2, objc, objv);
	return TCL_ERROR;
    }
    if (Tcl_GetDoubleFromObj(interp, objv[1], &dResult) != TCL_OK) {
#ifdef ACCEPT_NAN
	if (Tcl_FetchIntRep(objv[1], &tclDoubleType)) {
	    Tcl_SetObjResult(interp, objv[1]);
	    return TCL_OK;
	}
#endif
	return TCL_ERROR;
    }
    Tcl_SetObjResult(interp, Tcl_NewDoubleObj(dResult));







|







7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168

    if (objc != 2) {
	MathFuncWrongNumArgs(interp, 2, objc, objv);
	return TCL_ERROR;
    }
    if (Tcl_GetDoubleFromObj(interp, objv[1], &dResult) != TCL_OK) {
#ifdef ACCEPT_NAN
	if (objv[1]->typePtr == &tclDoubleType) {
	    Tcl_SetObjResult(interp, objv[1]);
	    return TCL_OK;
	}
#endif
	return TCL_ERROR;
    }
    Tcl_SetObjResult(interp, Tcl_NewDoubleObj(dResult));
Changes to generic/tclBinary.c.
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <assert.h>

/*
 * The following constants are used by GetFormatSpec to indicate various
 * special conditions in the parsing of a format specifier.
 */

#define BINARY_ALL -1		/* Use all elements in the argument. */
#define BINARY_NOCOUNT -2	/* No count was specified in format. */

/*
 * The following flags may be ORed together and returned by GetFormatSpec
 */

#define BINARY_SIGNED 0		/* Field to be read as signed data */
#define BINARY_UNSIGNED 1	/* Field to be read as unsigned data */







|
|







18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <assert.h>

/*
 * The following constants are used by GetFormatSpec to indicate various
 * special conditions in the parsing of a format specifier.
 */

#define BINARY_ALL ((size_t)-1)		/* Use all elements in the argument. */
#define BINARY_NOCOUNT ((size_t)-2)	/* No count was specified in format. */

/*
 * The following flags may be ORed together and returned by GetFormatSpec
 */

#define BINARY_SIGNED 0		/* Field to be read as signed data */
#define BINARY_UNSIGNED 1	/* Field to be read as unsigned data */
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83

/*
 * Prototypes for local procedures defined in this file:
 */

static void		DupByteArrayInternalRep(Tcl_Obj *srcPtr,
			    Tcl_Obj *copyPtr);
static void		DupProperByteArrayInternalRep(Tcl_Obj *srcPtr,
			    Tcl_Obj *copyPtr);
static int		FormatNumber(Tcl_Interp *interp, int type,
			    Tcl_Obj *src, unsigned char **cursorPtr);
static void		FreeByteArrayInternalRep(Tcl_Obj *objPtr);
static void		FreeProperByteArrayInternalRep(Tcl_Obj *objPtr);
static int		GetFormatSpec(const char **formatPtr, char *cmdPtr,
			    int *countPtr, int *flagsPtr);
static Tcl_Obj *	ScanNumber(unsigned char *buffer, int type,
			    int flags, Tcl_HashTable **numberCachePtr);
static int		SetByteArrayFromAny(Tcl_Interp *interp,
			    Tcl_Obj *objPtr);
static void		UpdateStringOfByteArray(Tcl_Obj *listPtr);
static void		DeleteScanNumberCache(Tcl_HashTable *numberCachePtr);
static int		NeedReversing(int format);
static void		CopyNumber(const void *from, void *to,
			    unsigned length, int type);
/* Binary ensemble commands */
static int		BinaryFormatCmd(ClientData clientData,
			    Tcl_Interp *interp,
			    int objc, Tcl_Obj *const objv[]);
static int		BinaryScanCmd(ClientData clientData,
			    Tcl_Interp *interp,
			    int objc, Tcl_Obj *const objv[]);







<
<



<

|








|







53
54
55
56
57
58
59


60
61
62

63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80

/*
 * Prototypes for local procedures defined in this file:
 */

static void		DupByteArrayInternalRep(Tcl_Obj *srcPtr,
			    Tcl_Obj *copyPtr);


static int		FormatNumber(Tcl_Interp *interp, int type,
			    Tcl_Obj *src, unsigned char **cursorPtr);
static void		FreeByteArrayInternalRep(Tcl_Obj *objPtr);

static int		GetFormatSpec(const char **formatPtr, char *cmdPtr,
			    size_t *countPtr, int *flagsPtr);
static Tcl_Obj *	ScanNumber(unsigned char *buffer, int type,
			    int flags, Tcl_HashTable **numberCachePtr);
static int		SetByteArrayFromAny(Tcl_Interp *interp,
			    Tcl_Obj *objPtr);
static void		UpdateStringOfByteArray(Tcl_Obj *listPtr);
static void		DeleteScanNumberCache(Tcl_HashTable *numberCachePtr);
static int		NeedReversing(int format);
static void		CopyNumber(const void *from, void *to,
			    size_t length, int type);
/* Binary ensemble commands */
static int		BinaryFormatCmd(ClientData clientData,
			    Tcl_Interp *interp,
			    int objc, Tcl_Obj *const objv[]);
static int		BinaryScanCmd(ClientData clientData,
			    Tcl_Interp *interp,
			    int objc, Tcl_Obj *const objv[]);
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
 * been retrofitted with the required "purity testing".  The set of values
 * able to pass the purity test can be increased via the introduction of
 * a "canonical" flag marker, but the only way the broken interface itself
 * can be discarded is to start over and define the Tcl_ObjType properly.
 * Bytearrays should simply be usable as bytearrays without a kabuki
 * dance of testing.
 *
 * The Tcl_ObjType "properByteArrayType" is (nearly) a correct
 * implementation of bytearrays.  Any Tcl value with the type
 * properByteArrayType can have its bytearray value fetched and
 * used with confidence that acting on that value is equivalent to
 * acting on the true Tcl string value.  This still implies a side
 * testing burden -- past mistakes will not let us avoid that
 * immediately, but it is at least a conventional test of type, and
 * can be implemented entirely by examining the objPtr fields, with







|







215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
 * been retrofitted with the required "purity testing".  The set of values
 * able to pass the purity test can be increased via the introduction of
 * a "canonical" flag marker, but the only way the broken interface itself
 * can be discarded is to start over and define the Tcl_ObjType properly.
 * Bytearrays should simply be usable as bytearrays without a kabuki
 * dance of testing.
 *
 * The "Pure" ByteArray type is (nearly) a correct
 * implementation of bytearrays.  Any Tcl value with the type
 * properByteArrayType can have its bytearray value fetched and
 * used with confidence that acting on that value is equivalent to
 * acting on the true Tcl string value.  This still implies a side
 * testing burden -- past mistakes will not let us avoid that
 * immediately, but it is at least a conventional test of type, and
 * can be implemented entirely by examining the objPtr fields, with
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
 * so that Tcl 9 will no longer have any trace of it.  Prescribing a
 * migration path will be the key element of that work.  The internal
 * changes now in place are the limit of what can be done short of
 * interface repair.  They provide a great expansion of the histories
 * over which bytearray values can be useful in the meanwhile.
 */

static const Tcl_ObjType properByteArrayType = {
    "bytearray",
    FreeProperByteArrayInternalRep,
    DupProperByteArrayInternalRep,
    UpdateStringOfByteArray,
    NULL
};

const Tcl_ObjType tclByteArrayType = {
    "bytearray",
    FreeByteArrayInternalRep,







|

|
|







241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
 * so that Tcl 9 will no longer have any trace of it.  Prescribing a
 * migration path will be the key element of that work.  The internal
 * changes now in place are the limit of what can be done short of
 * interface repair.  They provide a great expansion of the histories
 * over which bytearray values can be useful in the meanwhile.
 */

const Tcl_ObjType tclPureByteArrayType = {
    "bytearray",
    FreeByteArrayInternalRep,
    DupByteArrayInternalRep,
    UpdateStringOfByteArray,
    NULL
};

const Tcl_ObjType tclByteArrayType = {
    "bytearray",
    FreeByteArrayInternalRep,
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
				 * above. */
} ByteArray;

#define BYTEARRAY_SIZE(len) \
		((TclOffset(ByteArray, bytes) + (len)))
#define GET_BYTEARRAY(irPtr) ((ByteArray *) (irPtr)->twoPtrValue.ptr1)
#define SET_BYTEARRAY(irPtr, baPtr) \
		(irPtr)->twoPtrValue.ptr1 = (void *) (baPtr)

int
TclIsPureByteArray(
    Tcl_Obj * objPtr)
{
    return (NULL != Tcl_FetchIntRep(objPtr, &properByteArrayType));
}

/*
 *----------------------------------------------------------------------
 *
 * Tcl_NewByteArrayObj --
 *
 *	This procedure is creates a new ByteArray object and initializes it







|
<
<
<
<
<
<
<







278
279
280
281
282
283
284
285







286
287
288
289
290
291
292
				 * above. */
} ByteArray;

#define BYTEARRAY_SIZE(len) \
		((TclOffset(ByteArray, bytes) + (len)))
#define GET_BYTEARRAY(irPtr) ((ByteArray *) (irPtr)->twoPtrValue.ptr1)
#define SET_BYTEARRAY(irPtr, baPtr) \
		(irPtr)->twoPtrValue.ptr1 = (baPtr)








/*
 *----------------------------------------------------------------------
 *
 * Tcl_NewByteArrayObj --
 *
 *	This procedure is creates a new ByteArray object and initializes it
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
    byteArrayPtr->allocated = length;

    if ((bytes != NULL) && (length > 0)) {
	memcpy(byteArrayPtr->bytes, bytes, length);
    }
    SET_BYTEARRAY(&ir, byteArrayPtr);

    Tcl_StoreIntRep(objPtr, &properByteArrayType, &ir);
}

/*
 *----------------------------------------------------------------------
 *
 * Tcl_GetByteArrayFromObj --
 *







|







406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
    byteArrayPtr->allocated = length;

    if ((bytes != NULL) && (length > 0)) {
	memcpy(byteArrayPtr->bytes, bytes, length);
    }
    SET_BYTEARRAY(&ir, byteArrayPtr);

    Tcl_StoreIntRep(objPtr, &tclPureByteArrayType, &ir);
}

/*
 *----------------------------------------------------------------------
 *
 * Tcl_GetByteArrayFromObj --
 *
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
unsigned char *
Tcl_GetByteArrayFromObj(
    Tcl_Obj *objPtr,		/* The ByteArray object. */
    int *lengthPtr)		/* If non-NULL, filled with length of the
				 * array of bytes in the ByteArray object. */
{
    ByteArray *baPtr;
    const Tcl_ObjIntRep *irPtr = Tcl_FetchIntRep(objPtr, &properByteArrayType);

    if (irPtr == NULL) {
	irPtr = Tcl_FetchIntRep(objPtr, &tclByteArrayType);
	if (irPtr == NULL) {
	    SetByteArrayFromAny(NULL, objPtr);
	    irPtr = Tcl_FetchIntRep(objPtr, &properByteArrayType);
	    if (irPtr == NULL) {
		irPtr = Tcl_FetchIntRep(objPtr, &tclByteArrayType);
	    }
	}
    }
    baPtr = GET_BYTEARRAY(irPtr);

    if (lengthPtr != NULL) {
	*lengthPtr = baPtr->used;







|


|


|

|







434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
unsigned char *
Tcl_GetByteArrayFromObj(
    Tcl_Obj *objPtr,		/* The ByteArray object. */
    int *lengthPtr)		/* If non-NULL, filled with length of the
				 * array of bytes in the ByteArray object. */
{
    ByteArray *baPtr;
    const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objPtr, &tclPureByteArrayType);

    if (irPtr == NULL) {
	irPtr = TclFetchIntRep(objPtr, &tclByteArrayType);
	if (irPtr == NULL) {
	    SetByteArrayFromAny(NULL, objPtr);
	    irPtr = TclFetchIntRep(objPtr, &tclPureByteArrayType);
	    if (irPtr == NULL) {
		irPtr = TclFetchIntRep(objPtr, &tclByteArrayType);
	    }
	}
    }
    baPtr = GET_BYTEARRAY(irPtr);

    if (lengthPtr != NULL) {
	*lengthPtr = baPtr->used;
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
    ByteArray *byteArrayPtr;
    Tcl_ObjIntRep *irPtr;

    if (Tcl_IsShared(objPtr)) {
	Tcl_Panic("%s called with shared object", "Tcl_SetByteArrayLength");
    }

    irPtr = Tcl_FetchIntRep(objPtr, &properByteArrayType);
    if (irPtr == NULL) {
	irPtr = Tcl_FetchIntRep(objPtr, &tclByteArrayType);
	if (irPtr == NULL) {
	    SetByteArrayFromAny(NULL, objPtr);
	    irPtr = Tcl_FetchIntRep(objPtr, &properByteArrayType);
	    if (irPtr == NULL) {
		irPtr = Tcl_FetchIntRep(objPtr, &tclByteArrayType);
	    }
	}
    }

    byteArrayPtr = GET_BYTEARRAY(irPtr);
    if (length > byteArrayPtr->allocated) {
	byteArrayPtr = Tcl_Realloc(byteArrayPtr, BYTEARRAY_SIZE(length));







|

|


|

|







488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
    ByteArray *byteArrayPtr;
    Tcl_ObjIntRep *irPtr;

    if (Tcl_IsShared(objPtr)) {
	Tcl_Panic("%s called with shared object", "Tcl_SetByteArrayLength");
    }

    irPtr = TclFetchIntRep(objPtr, &tclPureByteArrayType);
    if (irPtr == NULL) {
	irPtr = TclFetchIntRep(objPtr, &tclByteArrayType);
	if (irPtr == NULL) {
	    SetByteArrayFromAny(NULL, objPtr);
	    irPtr = TclFetchIntRep(objPtr, &tclPureByteArrayType);
	    if (irPtr == NULL) {
		irPtr = TclFetchIntRep(objPtr, &tclByteArrayType);
	    }
	}
    }

    byteArrayPtr = GET_BYTEARRAY(irPtr);
    if (length > byteArrayPtr->allocated) {
	byteArrayPtr = Tcl_Realloc(byteArrayPtr, BYTEARRAY_SIZE(length));
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
    size_t length;
    int improper = 0;
    const char *src, *srcEnd;
    unsigned char *dst;
    ByteArray *byteArrayPtr;
    Tcl_ObjIntRep ir;

    if (Tcl_FetchIntRep(objPtr, &properByteArrayType)) {
	return TCL_OK;
    }
    if (Tcl_FetchIntRep(objPtr, &tclByteArrayType)) {
	return TCL_OK;
    }

    src = TclGetString(objPtr);
    length = objPtr->length;
    srcEnd = src + length;

    byteArrayPtr = Tcl_Alloc(BYTEARRAY_SIZE(length));
    for (dst = byteArrayPtr->bytes; src < srcEnd; ) {
	Tcl_UniChar ch = 0;
	src += TclUtfToUniChar(src, &ch);
	improper = improper || (ch > 255);
	*dst++ = UCHAR(ch);
    }

    byteArrayPtr->used = dst - byteArrayPtr->bytes;
    byteArrayPtr->allocated = length;

    SET_BYTEARRAY(&ir, byteArrayPtr);
    Tcl_StoreIntRep(objPtr,
	    improper ? &tclByteArrayType : &properByteArrayType, &ir);
    return TCL_OK;
}

/*
 *----------------------------------------------------------------------
 *
 * FreeByteArrayInternalRep --







|
<
<
|



|
<















|







539
540
541
542
543
544
545
546


547
548
549
550
551

552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
    size_t length;
    int improper = 0;
    const char *src, *srcEnd;
    unsigned char *dst;
    ByteArray *byteArrayPtr;
    Tcl_ObjIntRep ir;

    if ((objPtr->typePtr == &tclPureByteArrayType)


	    || (objPtr->typePtr == &tclByteArrayType)) {
	return TCL_OK;
    }

    src = TclGetStringFromObj(objPtr, &length);

    srcEnd = src + length;

    byteArrayPtr = Tcl_Alloc(BYTEARRAY_SIZE(length));
    for (dst = byteArrayPtr->bytes; src < srcEnd; ) {
	Tcl_UniChar ch = 0;
	src += TclUtfToUniChar(src, &ch);
	improper = improper || (ch > 255);
	*dst++ = UCHAR(ch);
    }

    byteArrayPtr->used = dst - byteArrayPtr->bytes;
    byteArrayPtr->allocated = length;

    SET_BYTEARRAY(&ir, byteArrayPtr);
    Tcl_StoreIntRep(objPtr,
	    improper ? &tclByteArrayType : &tclPureByteArrayType, &ir);
    return TCL_OK;
}

/*
 *----------------------------------------------------------------------
 *
 * FreeByteArrayInternalRep --
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
 *----------------------------------------------------------------------
 */

static void
FreeByteArrayInternalRep(
    Tcl_Obj *objPtr)		/* Object with internal rep to free. */
{
    Tcl_Free(GET_BYTEARRAY(Tcl_FetchIntRep(objPtr, &tclByteArrayType)));
}

static void
FreeProperByteArrayInternalRep(
    Tcl_Obj *objPtr)		/* Object with internal rep to free. */
{
    Tcl_Free(GET_BYTEARRAY(Tcl_FetchIntRep(objPtr, &properByteArrayType)));
}

/*
 *----------------------------------------------------------------------
 *
 * DupByteArrayInternalRep --
 *







|
<
<
<
<
<
<
<







585
586
587
588
589
590
591
592







593
594
595
596
597
598
599
 *----------------------------------------------------------------------
 */

static void
FreeByteArrayInternalRep(
    Tcl_Obj *objPtr)		/* Object with internal rep to free. */
{
    Tcl_Free(GET_BYTEARRAY(&(objPtr->internalRep)));







}

/*
 *----------------------------------------------------------------------
 *
 * DupByteArrayInternalRep --
 *
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
    Tcl_Obj *srcPtr,		/* Object with internal rep to copy. */
    Tcl_Obj *copyPtr)		/* Object with internal rep to set. */
{
    size_t length;
    ByteArray *srcArrayPtr, *copyArrayPtr;
    Tcl_ObjIntRep ir;

    srcArrayPtr = GET_BYTEARRAY(Tcl_FetchIntRep(srcPtr, &tclByteArrayType));
    length = srcArrayPtr->used;

    copyArrayPtr = Tcl_Alloc(BYTEARRAY_SIZE(length));
    copyArrayPtr->used = length;
    copyArrayPtr->allocated = length;
    memcpy(copyArrayPtr->bytes, srcArrayPtr->bytes, length);

    SET_BYTEARRAY(&ir, copyArrayPtr);
    Tcl_StoreIntRep(copyPtr, &tclByteArrayType, &ir);
}

static void
DupProperByteArrayInternalRep(
    Tcl_Obj *srcPtr,		/* Object with internal rep to copy. */
    Tcl_Obj *copyPtr)		/* Object with internal rep to set. */
{
    size_t length;
    ByteArray *srcArrayPtr, *copyArrayPtr;
    Tcl_ObjIntRep ir;

    srcArrayPtr = GET_BYTEARRAY(Tcl_FetchIntRep(srcPtr, &properByteArrayType));
    length = srcArrayPtr->used;

    copyArrayPtr = Tcl_Alloc(BYTEARRAY_SIZE(length));
    copyArrayPtr->used = length;
    copyArrayPtr->allocated = length;
    memcpy(copyArrayPtr->bytes, srcArrayPtr->bytes, length);

    SET_BYTEARRAY(&ir, copyArrayPtr);
    Tcl_StoreIntRep(copyPtr, &properByteArrayType, &ir);
}

/*
 *----------------------------------------------------------------------
 *
 * UpdateStringOfByteArray --
 *







|








|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630





















631
632
633
634
635
636
637
    Tcl_Obj *srcPtr,		/* Object with internal rep to copy. */
    Tcl_Obj *copyPtr)		/* Object with internal rep to set. */
{
    size_t length;
    ByteArray *srcArrayPtr, *copyArrayPtr;
    Tcl_ObjIntRep ir;

    srcArrayPtr = GET_BYTEARRAY(&(srcPtr->internalRep));
    length = srcArrayPtr->used;

    copyArrayPtr = Tcl_Alloc(BYTEARRAY_SIZE(length));
    copyArrayPtr->used = length;
    copyArrayPtr->allocated = length;
    memcpy(copyArrayPtr->bytes, srcArrayPtr->bytes, length);

    SET_BYTEARRAY(&ir, copyArrayPtr);
    Tcl_StoreIntRep(copyPtr, srcPtr->typePtr, &ir);





















}

/*
 *----------------------------------------------------------------------
 *
 * UpdateStringOfByteArray --
 *
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
 */

static void
UpdateStringOfByteArray(
    Tcl_Obj *objPtr)		/* ByteArray object whose string rep to
				 * update. */
{
    const Tcl_ObjIntRep *irPtr = Tcl_FetchIntRep(objPtr, &properByteArrayType);
    ByteArray *byteArrayPtr = GET_BYTEARRAY(irPtr);
    unsigned char *src = byteArrayPtr->bytes;
    size_t i, length = byteArrayPtr->used;
    size_t size = length;

    /*
     * How much space will string rep need?







|







648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
 */

static void
UpdateStringOfByteArray(
    Tcl_Obj *objPtr)		/* ByteArray object whose string rep to
				 * update. */
{
    const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objPtr, &tclPureByteArrayType);
    ByteArray *byteArrayPtr = GET_BYTEARRAY(irPtr);
    unsigned char *src = byteArrayPtr->bytes;
    size_t i, length = byteArrayPtr->used;
    size_t size = length;

    /*
     * How much space will string rep need?
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
		"TclAppendBytesToByteArray");
    }
    if (len == 0) {
	/* Append zero bytes is a no-op. */
	return;
    }

    irPtr = Tcl_FetchIntRep(objPtr, &properByteArrayType);
    if (irPtr == NULL) {
	irPtr = Tcl_FetchIntRep(objPtr, &tclByteArrayType);
	if (irPtr == NULL) {
	    SetByteArrayFromAny(NULL, objPtr);
	    irPtr = Tcl_FetchIntRep(objPtr, &properByteArrayType);
	    if (irPtr == NULL) {
		irPtr = Tcl_FetchIntRep(objPtr, &tclByteArrayType);
	    }
	}
    }
    byteArrayPtr = GET_BYTEARRAY(irPtr);

    if (len > UINT_MAX - byteArrayPtr->used) {
	Tcl_Panic("max size for a Tcl value (%u bytes) exceeded", UINT_MAX);







|

|


|

|







718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
		"TclAppendBytesToByteArray");
    }
    if (len == 0) {
	/* Append zero bytes is a no-op. */
	return;
    }

    irPtr = TclFetchIntRep(objPtr, &tclPureByteArrayType);
    if (irPtr == NULL) {
	irPtr = TclFetchIntRep(objPtr, &tclByteArrayType);
	if (irPtr == NULL) {
	    SetByteArrayFromAny(NULL, objPtr);
	    irPtr = TclFetchIntRep(objPtr, &tclPureByteArrayType);
	    if (irPtr == NULL) {
		irPtr = TclFetchIntRep(objPtr, &tclByteArrayType);
	    }
	}
    }
    byteArrayPtr = GET_BYTEARRAY(irPtr);

    if (len > UINT_MAX - byteArrayPtr->used) {
	Tcl_Panic("max size for a Tcl value (%u bytes) exceeded", UINT_MAX);
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891

892
893
894
895
896
897
898
    int objc,			/* Number of arguments. */
    Tcl_Obj *const objv[])	/* Argument objects. */
{
    int arg;			/* Index of next argument to consume. */
    int value = 0;		/* Current integer value to be packed.
				 * Initialized to avoid compiler warning. */
    char cmd;			/* Current format character. */
    int count;			/* Count associated with current format
				 * character. */
    int flags;			/* Format field flags */
    const char *format;	/* Pointer to current position in format
				 * string. */
    Tcl_Obj *resultPtr = NULL;	/* Object holding result buffer. */
    unsigned char *buffer;	/* Start of result buffer. */
    unsigned char *cursor;	/* Current position within result buffer. */
    unsigned char *maxPos;	/* Greatest position within result buffer that
				 * cursor has visited.*/
    const char *errorString;
    const char *errorValue, *str;
    int offset, size, length;


    if (objc < 2) {
	Tcl_WrongNumArgs(interp, 1, objv, "formatString ?arg ...?");
	return TCL_ERROR;
    }

    /*







|











|
>







831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
    int objc,			/* Number of arguments. */
    Tcl_Obj *const objv[])	/* Argument objects. */
{
    int arg;			/* Index of next argument to consume. */
    int value = 0;		/* Current integer value to be packed.
				 * Initialized to avoid compiler warning. */
    char cmd;			/* Current format character. */
    size_t count;			/* Count associated with current format
				 * character. */
    int flags;			/* Format field flags */
    const char *format;	/* Pointer to current position in format
				 * string. */
    Tcl_Obj *resultPtr = NULL;	/* Object holding result buffer. */
    unsigned char *buffer;	/* Start of result buffer. */
    unsigned char *cursor;	/* Current position within result buffer. */
    unsigned char *maxPos;	/* Greatest position within result buffer that
				 * cursor has visited.*/
    const char *errorString;
    const char *errorValue, *str;
    int offset, size;
    size_t length;

    if (objc < 2) {
	Tcl_WrongNumArgs(interp, 1, objv, "formatString ?arg ...?");
	return TCL_ERROR;
    }

    /*
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
	     * of bytes in a single argument.
	     */

	    if (arg >= objc) {
		goto badIndex;
	    }
	    if (count == BINARY_ALL) {
		TclGetByteArrayFromObj(objv[arg], &count);
	    } else if (count == BINARY_NOCOUNT) {
		count = 1;
	    }
	    arg++;
	    if (cmd == 'a' || cmd == 'A') {
		offset += count;
	    } else if (cmd == 'b' || cmd == 'B') {







|







883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
	     * of bytes in a single argument.
	     */

	    if (arg >= objc) {
		goto badIndex;
	    }
	    if (count == BINARY_ALL) {
		(void)TclGetByteArrayFromObj(objv[arg], &count);
	    } else if (count == BINARY_NOCOUNT) {
		count = 1;
	    }
	    arg++;
	    if (cmd == 'a' || cmd == 'A') {
		offset += count;
	    } else if (cmd == 'b' || cmd == 'B') {
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
			&listv) != TCL_OK) {
		    return TCL_ERROR;
		}
		arg++;

		if (count == BINARY_ALL) {
		    count = listc;
		} else if (count > listc) {
		    Tcl_SetObjResult(interp, Tcl_NewStringObj(
			    "number of elements in list does not match count",
			    -1));
		    return TCL_ERROR;
		}
	    }
	    offset += count*size;







|







955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
			&listv) != TCL_OK) {
		    return TCL_ERROR;
		}
		arg++;

		if (count == BINARY_ALL) {
		    count = listc;
		} else if (count > (size_t)listc) {
		    Tcl_SetObjResult(interp, Tcl_NewStringObj(
			    "number of elements in list does not match count",
			    -1));
		    return TCL_ERROR;
		}
	    }
	    offset += count*size;
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
	    }
	    offset += count;
	    break;
	case 'X':
	    if (count == BINARY_NOCOUNT) {
		count = 1;
	    }
	    if ((count > offset) || (count == BINARY_ALL)) {
		count = offset;
	    }
	    if (offset > length) {
		length = offset;
	    }
	    offset -= count;
	    break;
	case '@':
	    if (offset > length) {
		length = offset;
	    }
	    if (count == BINARY_ALL) {
		offset = length;
	    } else if (count == BINARY_NOCOUNT) {
		goto badCount;
	    } else {
		offset = count;
	    }
	    break;
	default:
	    errorString = str;
	    goto badField;
	}
    }
    if (offset > length) {
	length = offset;
    }
    if (length == 0) {
	return TCL_OK;
    }

    /*
     * Prepare the result object by preallocating the caclulated number of
     * bytes and filling with nulls.
     */

    resultPtr = Tcl_NewObj();
    buffer = Tcl_SetByteArrayLength(resultPtr, length);
    memset(buffer, 0, (size_t) length);

    /*
     * Pack the data into the result object. Note that we can skip the
     * error checking during this pass, since we have already parsed the
     * string once.
     */








|


|





|















|













|







979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
	    }
	    offset += count;
	    break;
	case 'X':
	    if (count == BINARY_NOCOUNT) {
		count = 1;
	    }
	    if ((count > (size_t)offset) || (count == BINARY_ALL)) {
		count = offset;
	    }
	    if (offset > (int)length) {
		length = offset;
	    }
	    offset -= count;
	    break;
	case '@':
	    if (offset > (int)length) {
		length = offset;
	    }
	    if (count == BINARY_ALL) {
		offset = length;
	    } else if (count == BINARY_NOCOUNT) {
		goto badCount;
	    } else {
		offset = count;
	    }
	    break;
	default:
	    errorString = str;
	    goto badField;
	}
    }
    if (offset > (int)length) {
	length = offset;
    }
    if (length == 0) {
	return TCL_OK;
    }

    /*
     * Prepare the result object by preallocating the caclulated number of
     * bytes and filling with nulls.
     */

    resultPtr = Tcl_NewObj();
    buffer = Tcl_SetByteArrayLength(resultPtr, length);
    memset(buffer, 0, length);

    /*
     * Pack the data into the result object. Note that we can skip the
     * error checking during this pass, since we have already parsed the
     * string once.
     */

1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
	    arg++;
	    if (count == BINARY_ALL) {
		count = length;
	    } else if (count == BINARY_NOCOUNT) {
		count = 1;
	    }
	    if (length >= count) {
		memcpy(cursor, bytes, (size_t) count);
	    } else {
		memcpy(cursor, bytes, (size_t) length);
		memset(cursor + length, pad, (size_t) (count - length));
	    }
	    cursor += count;
	    break;
	}
	case 'b':
	case 'B': {
	    unsigned char *last;

	    str = Tcl_GetStringFromObj(objv[arg], &length);
	    arg++;
	    if (count == BINARY_ALL) {
		count = length;
	    } else if (count == BINARY_NOCOUNT) {
		count = 1;
	    }
	    last = cursor + ((count + 7) / 8);
	    if (count > length) {
		count = length;
	    }
	    value = 0;
	    errorString = "binary";
	    if (cmd == 'B') {
		for (offset = 0; offset < count; offset++) {
		    value <<= 1;
		    if (str[offset] == '1') {
			value |= 1;
		    } else if (str[offset] != '0') {
			errorValue = str;
			Tcl_DecrRefCount(resultPtr);
			goto badValue;
		    }
		    if (((offset + 1) % 8) == 0) {
			*cursor++ = UCHAR(value);
			value = 0;
		    }
		}
	    } else {
		for (offset = 0; offset < count; offset++) {
		    value >>= 1;
		    if (str[offset] == '1') {
			value |= 128;
		    } else if (str[offset] != '0') {
			errorValue = str;
			Tcl_DecrRefCount(resultPtr);
			goto badValue;







|

|
|








|













|














|







1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
	    arg++;
	    if (count == BINARY_ALL) {
		count = length;
	    } else if (count == BINARY_NOCOUNT) {
		count = 1;
	    }
	    if (length >= count) {
		memcpy(cursor, bytes, count);
	    } else {
		memcpy(cursor, bytes, length);
		memset(cursor + length, pad, count - length);
	    }
	    cursor += count;
	    break;
	}
	case 'b':
	case 'B': {
	    unsigned char *last;

	    str = TclGetStringFromObj(objv[arg], &length);
	    arg++;
	    if (count == BINARY_ALL) {
		count = length;
	    } else if (count == BINARY_NOCOUNT) {
		count = 1;
	    }
	    last = cursor + ((count + 7) / 8);
	    if (count > length) {
		count = length;
	    }
	    value = 0;
	    errorString = "binary";
	    if (cmd == 'B') {
		for (offset = 0; (size_t)offset < count; offset++) {
		    value <<= 1;
		    if (str[offset] == '1') {
			value |= 1;
		    } else if (str[offset] != '0') {
			errorValue = str;
			Tcl_DecrRefCount(resultPtr);
			goto badValue;
		    }
		    if (((offset + 1) % 8) == 0) {
			*cursor++ = UCHAR(value);
			value = 0;
		    }
		}
	    } else {
		for (offset = 0; (size_t)offset < count; offset++) {
		    value >>= 1;
		    if (str[offset] == '1') {
			value |= 128;
		    } else if (str[offset] != '0') {
			errorValue = str;
			Tcl_DecrRefCount(resultPtr);
			goto badValue;
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
	    break;
	}
	case 'h':
	case 'H': {
	    unsigned char *last;
	    int c;

	    str = Tcl_GetStringFromObj(objv[arg], &length);
	    arg++;
	    if (count == BINARY_ALL) {
		count = length;
	    } else if (count == BINARY_NOCOUNT) {
		count = 1;
	    }
	    last = cursor + ((count + 1) / 2);
	    if (count > length) {
		count = length;
	    }
	    value = 0;
	    errorString = "hexadecimal";
	    if (cmd == 'H') {
		for (offset = 0; offset < count; offset++) {
		    value <<= 4;
		    if (!isxdigit(UCHAR(str[offset]))) {     /* INTL: digit */
			errorValue = str;
			Tcl_DecrRefCount(resultPtr);
			goto badValue;
		    }
		    c = str[offset] - '0';
		    if (c > 9) {
			c += ('0' - 'A') + 10;
		    }
		    if (c > 16) {
			c += ('A' - 'a');
		    }
		    value |= (c & 0xf);
		    if (offset % 2) {
			*cursor++ = (char) value;
			value = 0;
		    }
		}
	    } else {
		for (offset = 0; offset < count; offset++) {
		    value >>= 4;

		    if (!isxdigit(UCHAR(str[offset]))) {     /* INTL: digit */
			errorValue = str;
			Tcl_DecrRefCount(resultPtr);
			goto badValue;
		    }







|













|




















|







1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
	    break;
	}
	case 'h':
	case 'H': {
	    unsigned char *last;
	    int c;

	    str = TclGetStringFromObj(objv[arg], &length);
	    arg++;
	    if (count == BINARY_ALL) {
		count = length;
	    } else if (count == BINARY_NOCOUNT) {
		count = 1;
	    }
	    last = cursor + ((count + 1) / 2);
	    if (count > length) {
		count = length;
	    }
	    value = 0;
	    errorString = "hexadecimal";
	    if (cmd == 'H') {
		for (offset = 0; (size_t)offset < count; offset++) {
		    value <<= 4;
		    if (!isxdigit(UCHAR(str[offset]))) {     /* INTL: digit */
			errorValue = str;
			Tcl_DecrRefCount(resultPtr);
			goto badValue;
		    }
		    c = str[offset] - '0';
		    if (c > 9) {
			c += ('0' - 'A') + 10;
		    }
		    if (c > 16) {
			c += ('A' - 'a');
		    }
		    value |= (c & 0xf);
		    if (offset % 2) {
			*cursor++ = (char) value;
			value = 0;
		    }
		}
	    } else {
		for (offset = 0; (size_t)offset < count; offset++) {
		    value >>= 4;

		    if (!isxdigit(UCHAR(str[offset]))) {     /* INTL: digit */
			errorValue = str;
			Tcl_DecrRefCount(resultPtr);
			goto badValue;
		    }
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
	    } else {
		TclListObjGetElements(interp, objv[arg], &listc, &listv);
		if (count == BINARY_ALL) {
		    count = listc;
		}
	    }
	    arg++;
	    for (i = 0; i < count; i++) {
		if (FormatNumber(interp, cmd, listv[i], &cursor)!=TCL_OK) {
		    Tcl_DecrRefCount(resultPtr);
		    return TCL_ERROR;
		}
	    }
	    break;
	}
	case 'x':
	    if (count == BINARY_NOCOUNT) {
		count = 1;
	    }
	    memset(cursor, 0, (size_t) count);
	    cursor += count;
	    break;
	case 'X':
	    if (cursor > maxPos) {
		maxPos = cursor;
	    }
	    if (count == BINARY_NOCOUNT) {
		count = 1;
	    }
	    if ((count == BINARY_ALL) || (count > (cursor - buffer))) {
		cursor = buffer;
	    } else {
		cursor -= count;
	    }
	    break;
	case '@':
	    if (cursor > maxPos) {







|











|









|







1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
	    } else {
		TclListObjGetElements(interp, objv[arg], &listc, &listv);
		if (count == BINARY_ALL) {
		    count = listc;
		}
	    }
	    arg++;
	    for (i = 0; (size_t)i < count; i++) {
		if (FormatNumber(interp, cmd, listv[i], &cursor)!=TCL_OK) {
		    Tcl_DecrRefCount(resultPtr);
		    return TCL_ERROR;
		}
	    }
	    break;
	}
	case 'x':
	    if (count == BINARY_NOCOUNT) {
		count = 1;
	    }
	    memset(cursor, 0, count);
	    cursor += count;
	    break;
	case 'X':
	    if (cursor > maxPos) {
		maxPos = cursor;
	    }
	    if (count == BINARY_NOCOUNT) {
		count = 1;
	    }
	    if ((count == BINARY_ALL) || (count > (size_t)(cursor - buffer))) {
		cursor = buffer;
	    } else {
		cursor -= count;
	    }
	    break;
	case '@':
	    if (cursor > maxPos) {
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393

1394
1395
1396
1397
1398
1399
1400
    int objc,			/* Number of arguments. */
    Tcl_Obj *const objv[])	/* Argument objects. */
{
    int arg;			/* Index of next argument to consume. */
    int value = 0;		/* Current integer value to be packed.
				 * Initialized to avoid compiler warning. */
    char cmd;			/* Current format character. */
    int count;			/* Count associated with current format
				 * character. */
    int flags;			/* Format field flags */
    const char *format;	/* Pointer to current position in format
				 * string. */
    Tcl_Obj *resultPtr = NULL;	/* Object holding result buffer. */
    unsigned char *buffer;	/* Start of result buffer. */
    const char *errorString;
    const char *str;
    int offset, size, length;


    int i;
    Tcl_Obj *valuePtr, *elementPtr;
    Tcl_HashTable numberCacheHash;
    Tcl_HashTable *numberCachePtr;

    if (objc < 3) {







|








|
>







1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
    int objc,			/* Number of arguments. */
    Tcl_Obj *const objv[])	/* Argument objects. */
{
    int arg;			/* Index of next argument to consume. */
    int value = 0;		/* Current integer value to be packed.
				 * Initialized to avoid compiler warning. */
    char cmd;			/* Current format character. */
    size_t count;			/* Count associated with current format
				 * character. */
    int flags;			/* Format field flags */
    const char *format;	/* Pointer to current position in format
				 * string. */
    Tcl_Obj *resultPtr = NULL;	/* Object holding result buffer. */
    unsigned char *buffer;	/* Start of result buffer. */
    const char *errorString;
    const char *str;
    int offset, size;
    size_t length;

    int i;
    Tcl_Obj *valuePtr, *elementPtr;
    Tcl_HashTable numberCacheHash;
    Tcl_HashTable *numberCachePtr;

    if (objc < 3) {
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
	    }
	    if (count == BINARY_ALL) {
		count = length - offset;
	    } else {
		if (count == BINARY_NOCOUNT) {
		    count = 1;
		}
		if (count > (length - offset)) {
		    goto done;
		}
	    }

	    src = buffer + offset;
	    size = count;








|







1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
	    }
	    if (count == BINARY_ALL) {
		count = length - offset;
	    } else {
		if (count == BINARY_NOCOUNT) {
		    count = 1;
		}
		if (count > length - offset) {
		    goto done;
		}
	    }

	    src = buffer + offset;
	    size = count;

1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
	    }
	    if (count == BINARY_ALL) {
		count = (length - offset) * 8;
	    } else {
		if (count == BINARY_NOCOUNT) {
		    count = 1;
		}
		if (count > (length - offset) * 8) {
		    goto done;
		}
	    }
	    src = buffer + offset;
	    valuePtr = Tcl_NewObj();
	    Tcl_SetObjLength(valuePtr, count);
	    dest = TclGetString(valuePtr);

	    if (cmd == 'b') {
		for (i = 0; i < count; i++) {
		    if (i % 8) {
			value >>= 1;
		    } else {
			value = *src++;
		    }
		    *dest++ = (char) ((value & 1) ? '1' : '0');
		}
	    } else {
		for (i = 0; i < count; i++) {
		    if (i % 8) {
			value <<= 1;
		    } else {
			value = *src++;
		    }
		    *dest++ = (char) ((value & 0x80) ? '1' : '0');
		}







|









|








|







1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
	    }
	    if (count == BINARY_ALL) {
		count = (length - offset) * 8;
	    } else {
		if (count == BINARY_NOCOUNT) {
		    count = 1;
		}
		if (count > (size_t)(length - offset) * 8) {
		    goto done;
		}
	    }
	    src = buffer + offset;
	    valuePtr = Tcl_NewObj();
	    Tcl_SetObjLength(valuePtr, count);
	    dest = TclGetString(valuePtr);

	    if (cmd == 'b') {
		for (i = 0; (size_t)i < count; i++) {
		    if (i % 8) {
			value >>= 1;
		    } else {
			value = *src++;
		    }
		    *dest++ = (char) ((value & 1) ? '1' : '0');
		}
	    } else {
		for (i = 0; (size_t)i < count; i++) {
		    if (i % 8) {
			value <<= 1;
		    } else {
			value = *src++;
		    }
		    *dest++ = (char) ((value & 0x80) ? '1' : '0');
		}
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
	    }
	    src = buffer + offset;
	    valuePtr = Tcl_NewObj();
	    Tcl_SetObjLength(valuePtr, count);
	    dest = TclGetString(valuePtr);

	    if (cmd == 'h') {
		for (i = 0; i < count; i++) {
		    if (i % 2) {
			value >>= 4;
		    } else {
			value = *src++;
		    }
		    *dest++ = hexdigit[value & 0xf];
		}
	    } else {
		for (i = 0; i < count; i++) {
		    if (i % 2) {
			value <<= 4;
		    } else {
			value = *src++;
		    }
		    *dest++ = hexdigit[(value >> 4) & 0xf];
		}







|








|







1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
	    }
	    src = buffer + offset;
	    valuePtr = Tcl_NewObj();
	    Tcl_SetObjLength(valuePtr, count);
	    dest = TclGetString(valuePtr);

	    if (cmd == 'h') {
		for (i = 0; (size_t)i < count; i++) {
		    if (i % 2) {
			value >>= 4;
		    } else {
			value = *src++;
		    }
		    *dest++ = hexdigit[value & 0xf];
		}
	    } else {
		for (i = 0; (size_t)i < count; i++) {
		    if (i % 2) {
			value <<= 4;
		    } else {
			value = *src++;
		    }
		    *dest++ = hexdigit[(value >> 4) & 0xf];
		}
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675

	scanNumber:
	    if (arg >= objc) {
		DeleteScanNumberCache(numberCachePtr);
		goto badIndex;
	    }
	    if (count == BINARY_NOCOUNT) {
		if ((length - offset) < size) {
		    goto done;
		}
		valuePtr = ScanNumber(buffer+offset, cmd, flags,
			&numberCachePtr);
		offset += size;
	    } else {
		if (count == BINARY_ALL) {
		    count = (length - offset) / size;
		}
		if ((length - offset) < (count * size)) {
		    goto done;
		}
		valuePtr = Tcl_NewObj();
		src = buffer + offset;
		for (i = 0; i < count; i++) {
		    elementPtr = ScanNumber(src, cmd, flags, &numberCachePtr);
		    src += size;
		    Tcl_ListObjAppendElement(NULL, valuePtr, elementPtr);
		}
		offset += count * size;
	    }

	    resultPtr = Tcl_ObjSetVar2(interp, objv[arg], NULL, valuePtr,
		    TCL_LEAVE_ERR_MSG);
	    arg++;
	    if (resultPtr == NULL) {
		DeleteScanNumberCache(numberCachePtr);
		return TCL_ERROR;
	    }
	    break;
	}
	case 'x':
	    if (count == BINARY_NOCOUNT) {
		count = 1;
	    }
	    if ((count == BINARY_ALL) || (count > (length - offset))) {
		offset = length;
	    } else {
		offset += count;
	    }
	    break;
	case 'X':
	    if (count == BINARY_NOCOUNT) {
		count = 1;
	    }
	    if ((count == BINARY_ALL) || (count > offset)) {
		offset = 0;
	    } else {
		offset -= count;
	    }
	    break;
	case '@':
	    if (count == BINARY_NOCOUNT) {







|














|




















|









|







1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636

	scanNumber:
	    if (arg >= objc) {
		DeleteScanNumberCache(numberCachePtr);
		goto badIndex;
	    }
	    if (count == BINARY_NOCOUNT) {
		if ((length - offset) < (size_t)size) {
		    goto done;
		}
		valuePtr = ScanNumber(buffer+offset, cmd, flags,
			&numberCachePtr);
		offset += size;
	    } else {
		if (count == BINARY_ALL) {
		    count = (length - offset) / size;
		}
		if ((length - offset) < (count * size)) {
		    goto done;
		}
		valuePtr = Tcl_NewObj();
		src = buffer + offset;
		for (i = 0; (size_t)i < count; i++) {
		    elementPtr = ScanNumber(src, cmd, flags, &numberCachePtr);
		    src += size;
		    Tcl_ListObjAppendElement(NULL, valuePtr, elementPtr);
		}
		offset += count * size;
	    }

	    resultPtr = Tcl_ObjSetVar2(interp, objv[arg], NULL, valuePtr,
		    TCL_LEAVE_ERR_MSG);
	    arg++;
	    if (resultPtr == NULL) {
		DeleteScanNumberCache(numberCachePtr);
		return TCL_ERROR;
	    }
	    break;
	}
	case 'x':
	    if (count == BINARY_NOCOUNT) {
		count = 1;
	    }
	    if ((count == BINARY_ALL) || (count > length - offset)) {
		offset = length;
	    } else {
		offset += count;
	    }
	    break;
	case 'X':
	    if (count == BINARY_NOCOUNT) {
		count = 1;
	    }
	    if ((count == BINARY_ALL) || (count > (size_t)offset)) {
		offset = 0;
	    } else {
		offset -= count;
	    }
	    break;
	case '@':
	    if (count == BINARY_NOCOUNT) {
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
 *----------------------------------------------------------------------
 */

static int
GetFormatSpec(
    const char **formatPtr,	/* Pointer to format string. */
    char *cmdPtr,		/* Pointer to location of command char. */
    int *countPtr,		/* Pointer to repeat count value. */
    int *flagsPtr)		/* Pointer to field flags */
{
    /*
     * Skip any leading blanks.
     */

    while (**formatPtr == ' ') {







|







1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
 *----------------------------------------------------------------------
 */

static int
GetFormatSpec(
    const char **formatPtr,	/* Pointer to format string. */
    char *cmdPtr,		/* Pointer to location of command char. */
    size_t *countPtr,		/* Pointer to repeat count value. */
    int *flagsPtr)		/* Pointer to field flags */
{
    /*
     * Skip any leading blanks.
     */

    while (**formatPtr == ' ') {
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
 *----------------------------------------------------------------------
 */

static void
CopyNumber(
    const void *from,		/* source */
    void *to,			/* destination */
    unsigned length,		/* Number of bytes to copy */
    int type)			/* What type of thing are we copying? */
{
    switch (NeedReversing(type)) {
    case 0:
	memcpy(to, from, length);
	break;
    case 1: {







|







1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
 *----------------------------------------------------------------------
 */

static void
CopyNumber(
    const void *from,		/* source */
    void *to,			/* destination */
    size_t length,		/* Number of bytes to copy */
    int type)			/* What type of thing are we copying? */
{
    switch (NeedReversing(type)) {
    case 0:
	memcpy(to, from, length);
	break;
    case 1: {
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
	/*
	 * Double-precision floating point values. Tcl_GetDoubleFromObj
	 * returns TCL_ERROR for NaN, but we can check by comparing the
	 * object's type pointer.
	 */

	if (Tcl_GetDoubleFromObj(interp, src, &dvalue) != TCL_OK) {
	    const Tcl_ObjIntRep *irPtr = Tcl_FetchIntRep(src, &tclDoubleType);
	    if (irPtr == NULL) {
		return TCL_ERROR;
	    }
	    dvalue = irPtr->doubleValue;
	}
	CopyNumber(&dvalue, *cursorPtr, sizeof(double), type);
	*cursorPtr += sizeof(double);
	return TCL_OK;

    case 'f':
    case 'r':
    case 'R':
	/*
	 * Single-precision floating point values. Tcl_GetDoubleFromObj
	 * returns TCL_ERROR for NaN, but we can check by comparing the
	 * object's type pointer.
	 */

	if (Tcl_GetDoubleFromObj(interp, src, &dvalue) != TCL_OK) {
	    const Tcl_ObjIntRep *irPtr = Tcl_FetchIntRep(src, &tclDoubleType);
	    if (irPtr == NULL) {
		return TCL_ERROR;
	    }
	    dvalue = irPtr->doubleValue;
	}

	/*







|



















|







1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
	/*
	 * Double-precision floating point values. Tcl_GetDoubleFromObj
	 * returns TCL_ERROR for NaN, but we can check by comparing the
	 * object's type pointer.
	 */

	if (Tcl_GetDoubleFromObj(interp, src, &dvalue) != TCL_OK) {
	    const Tcl_ObjIntRep *irPtr = TclFetchIntRep(src, &tclDoubleType);
	    if (irPtr == NULL) {
		return TCL_ERROR;
	    }
	    dvalue = irPtr->doubleValue;
	}
	CopyNumber(&dvalue, *cursorPtr, sizeof(double), type);
	*cursorPtr += sizeof(double);
	return TCL_OK;

    case 'f':
    case 'r':
    case 'R':
	/*
	 * Single-precision floating point values. Tcl_GetDoubleFromObj
	 * returns TCL_ERROR for NaN, but we can check by comparing the
	 * object's type pointer.
	 */

	if (Tcl_GetDoubleFromObj(interp, src, &dvalue) != TCL_OK) {
	    const Tcl_ObjIntRep *irPtr = TclFetchIntRep(src, &tclDoubleType);
	    if (irPtr == NULL) {
		return TCL_ERROR;
	    }
	    dvalue = irPtr->doubleValue;
	}

	/*
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
    Tcl_Interp *interp,
    int objc,
    Tcl_Obj *const objv[])
{
    Tcl_Obj *resultObj = NULL;
    unsigned char *data = NULL;
    unsigned char *cursor = NULL;
    int offset = 0, count = 0;

    if (objc != 2) {
	Tcl_WrongNumArgs(interp, 1, objv, "data");
	return TCL_ERROR;
    }

    TclNewObj(resultObj);







|







2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
    Tcl_Interp *interp,
    int objc,
    Tcl_Obj *const objv[])
{
    Tcl_Obj *resultObj = NULL;
    unsigned char *data = NULL;
    unsigned char *cursor = NULL;
    size_t offset = 0, count = 0;

    if (objc != 2) {
	Tcl_WrongNumArgs(interp, 1, objv, "data");
	return TCL_ERROR;
    }

    TclNewObj(resultObj);
2607
2608
2609
2610
2611
2612
2613
2614

2615
2616
2617
2618
2619
2620
2621
    Tcl_Obj *const objv[])
{
    Tcl_Obj *resultObj;
    unsigned char *data, *cursor, *limit;
    int maxlen = 0;
    const char *wrapchar = "\n";
    size_t wrapcharlen = 1;
    int offset, i, index, size, outindex = 0, count = 0;

    enum {OPT_MAXLEN, OPT_WRAPCHAR };
    static const char *const optStrings[] = { "-maxlen", "-wrapchar", NULL };

    if (objc < 2 || objc%2 != 0) {
	Tcl_WrongNumArgs(interp, 1, objv,
		"?-maxlen len? ?-wrapchar char? data");
	return TCL_ERROR;







|
>







2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
    Tcl_Obj *const objv[])
{
    Tcl_Obj *resultObj;
    unsigned char *data, *cursor, *limit;
    int maxlen = 0;
    const char *wrapchar = "\n";
    size_t wrapcharlen = 1;
    int i, index, size, outindex = 0;
    size_t offset, count = 0;
    enum {OPT_MAXLEN, OPT_WRAPCHAR };
    static const char *const optStrings[] = { "-maxlen", "-wrapchar", NULL };

    if (objc < 2 || objc%2 != 0) {
	Tcl_WrongNumArgs(interp, 1, objv,
		"?-maxlen len? ?-wrapchar char? data");
	return TCL_ERROR;
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
    ClientData clientData,
    Tcl_Interp *interp,
    int objc,
    Tcl_Obj *const objv[])
{
    Tcl_Obj *resultObj;
    unsigned char *data, *start, *cursor;
    int offset, count, rawLength, n, i, j, bits, index;
    int lineLength = 61;
    const unsigned char SingleNewline[] = { (unsigned char) '\n' };
    const unsigned char *wrapchar = SingleNewline;
    int wrapcharlen = sizeof(SingleNewline);
    enum { OPT_MAXLEN, OPT_WRAPCHAR };
    static const char *const optStrings[] = { "-maxlen", "-wrapchar", NULL };

    if (objc < 2 || objc%2 != 0) {
	Tcl_WrongNumArgs(interp, 1, objv,
		"?-maxlen len? ?-wrapchar char? data");
	return TCL_ERROR;







|



|







2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
    ClientData clientData,
    Tcl_Interp *interp,
    int objc,
    Tcl_Obj *const objv[])
{
    Tcl_Obj *resultObj;
    unsigned char *data, *start, *cursor;
    int rawLength, n, i, bits, index;
    int lineLength = 61;
    const unsigned char SingleNewline[] = { (unsigned char) '\n' };
    const unsigned char *wrapchar = SingleNewline;
    size_t j, offset, count, wrapcharlen = sizeof(SingleNewline);
    enum { OPT_MAXLEN, OPT_WRAPCHAR };
    static const char *const optStrings[] = { "-maxlen", "-wrapchar", NULL };

    if (objc < 2 || objc%2 != 0) {
	Tcl_WrongNumArgs(interp, 1, objv,
		"?-maxlen len? ?-wrapchar char? data");
	return TCL_ERROR;
Changes to generic/tclCkalloc.c.
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
	    fflush(stdout);
	    byte &= 0xff;
	    fprintf(stderr, "low guard byte %" TCL_Z_MODIFIER "u is 0x%x  \t%c\n", idx, byte,
		    (isprint(UCHAR(byte)) ? byte : ' ')); /* INTL: bytes */
	}
    }
    if (guard_failed) {
	TclDumpMemoryInfo((ClientData) stderr, 0);
	fprintf(stderr, "low guard failed at %p, %s %d\n",
		memHeaderP->body, file, line);
	fflush(stderr);			/* In case name pointer is bad. */
	fprintf(stderr, "%" TCL_Z_MODIFIER "u bytes allocated at (%s %d)\n", memHeaderP->length,
		memHeaderP->file, memHeaderP->line);
	Tcl_Panic("Memory validation failure");
    }







|







244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
	    fflush(stdout);
	    byte &= 0xff;
	    fprintf(stderr, "low guard byte %" TCL_Z_MODIFIER "u is 0x%x  \t%c\n", idx, byte,
		    (isprint(UCHAR(byte)) ? byte : ' ')); /* INTL: bytes */
	}
    }
    if (guard_failed) {
	TclDumpMemoryInfo(stderr, 0);
	fprintf(stderr, "low guard failed at %p, %s %d\n",
		memHeaderP->body, file, line);
	fflush(stderr);			/* In case name pointer is bad. */
	fprintf(stderr, "%" TCL_Z_MODIFIER "u bytes allocated at (%s %d)\n", memHeaderP->length,
		memHeaderP->file, memHeaderP->line);
	Tcl_Panic("Memory validation failure");
    }
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
	    byte &= 0xff;
	    fprintf(stderr, "hi guard byte %" TCL_Z_MODIFIER "u is 0x%x  \t%c\n", idx, byte,
		    (isprint(UCHAR(byte)) ? byte : ' ')); /* INTL: bytes */
	}
    }

    if (guard_failed) {
	TclDumpMemoryInfo((ClientData) stderr, 0);
	fprintf(stderr, "high guard failed at %p, %s %d\n",
		memHeaderP->body, file, line);
	fflush(stderr);			/* In case name pointer is bad. */
	fprintf(stderr, "%" TCL_Z_MODIFIER "u bytes allocated at (%s %d)\n",
		memHeaderP->length, memHeaderP->file,
		memHeaderP->line);
	Tcl_Panic("Memory validation failure");







|







266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
	    byte &= 0xff;
	    fprintf(stderr, "hi guard byte %" TCL_Z_MODIFIER "u is 0x%x  \t%c\n", idx, byte,
		    (isprint(UCHAR(byte)) ? byte : ' ')); /* INTL: bytes */
	}
    }

    if (guard_failed) {
	TclDumpMemoryInfo(stderr, 0);
	fprintf(stderr, "high guard failed at %p, %s %d\n",
		memHeaderP->body, file, line);
	fflush(stderr);			/* In case name pointer is bad. */
	fprintf(stderr, "%" TCL_Z_MODIFIER "u bytes allocated at (%s %d)\n",
		memHeaderP->length, memHeaderP->file,
		memHeaderP->line);
	Tcl_Panic("Memory validation failure");
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
    /* Don't let size argument to TclpAlloc overflow */
    if (size <= UINT_MAX - HIGH_GUARD_SIZE -sizeof(struct mem_header)) {
	result = (struct mem_header *) TclpAlloc(size +
		sizeof(struct mem_header) + HIGH_GUARD_SIZE);
    }
    if (result == NULL) {
	fflush(stdout);
	TclDumpMemoryInfo((ClientData) stderr, 0);
	Tcl_Panic("unable to alloc %" TCL_Z_MODIFIER "u bytes, %s line %d", size, file, line);
    }

    /*
     * Fill in guard zones and size. Also initialize the contents of the block
     * with bogus bytes to detect uses of initialized data. Link into
     * allocated list.







|







404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
    /* Don't let size argument to TclpAlloc overflow */
    if (size <= UINT_MAX - HIGH_GUARD_SIZE -sizeof(struct mem_header)) {
	result = (struct mem_header *) TclpAlloc(size +
		sizeof(struct mem_header) + HIGH_GUARD_SIZE);
    }
    if (result == NULL) {
	fflush(stdout);
	TclDumpMemoryInfo(stderr, 0);
	Tcl_Panic("unable to alloc %" TCL_Z_MODIFIER "u bytes, %s line %d", size, file, line);
    }

    /*
     * Fill in guard zones and size. Also initialize the contents of the block
     * with bogus bytes to detect uses of initialized data. Link into
     * allocated list.
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
    /* Don't let size argument to TclpAlloc overflow */
    if (size <= UINT_MAX - HIGH_GUARD_SIZE - sizeof(struct mem_header)) {
	result = (struct mem_header *) TclpAlloc(size +
		sizeof(struct mem_header) + HIGH_GUARD_SIZE);
    }
    if (result == NULL) {
	fflush(stdout);
	TclDumpMemoryInfo((ClientData) stderr, 0);
	return NULL;
    }

    /*
     * Fill in guard zones and size. Also initialize the contents of the block
     * with bogus bytes to detect uses of initialized data. Link into
     * allocated list.







|







494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
    /* Don't let size argument to TclpAlloc overflow */
    if (size <= UINT_MAX - HIGH_GUARD_SIZE - sizeof(struct mem_header)) {
	result = (struct mem_header *) TclpAlloc(size +
		sizeof(struct mem_header) + HIGH_GUARD_SIZE);
    }
    if (result == NULL) {
	fflush(stdout);
	TclDumpMemoryInfo(stderr, 0);
	return NULL;
    }

    /*
     * Fill in guard zones and size. Also initialize the contents of the block
     * with bogus bytes to detect uses of initialized data. Link into
     * allocated list.
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
    memp = (struct mem_header *) (((size_t) ptr) - BODY_OFFSET);

    copySize = size;
    if (copySize > memp->length) {
	copySize = memp->length;
    }
    newPtr = Tcl_DbCkalloc(size, file, line);
    memcpy(newPtr, ptr, (size_t) copySize);
    Tcl_DbCkfree(ptr, file, line);
    return newPtr;
}

void *
Tcl_AttemptDbCkrealloc(
    void *ptr,







|







685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
    memp = (struct mem_header *) (((size_t) ptr) - BODY_OFFSET);

    copySize = size;
    if (copySize > memp->length) {
	copySize = memp->length;
    }
    newPtr = Tcl_DbCkalloc(size, file, line);
    memcpy(newPtr, ptr, copySize);
    Tcl_DbCkfree(ptr, file, line);
    return newPtr;
}

void *
Tcl_AttemptDbCkrealloc(
    void *ptr,
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
    if (copySize > memp->length) {
	copySize = memp->length;
    }
    newPtr = Tcl_AttemptDbCkalloc(size, file, line);
    if (newPtr == NULL) {
	return NULL;
    }
    memcpy(newPtr, ptr, (size_t) copySize);
    Tcl_DbCkfree(ptr, file, line);
    return newPtr;
}


/*
 *----------------------------------------------------------------------







|







719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
    if (copySize > memp->length) {
	copySize = memp->length;
    }
    newPtr = Tcl_AttemptDbCkalloc(size, file, line);
    if (newPtr == NULL) {
	return NULL;
    }
    memcpy(newPtr, ptr, copySize);
    Tcl_DbCkfree(ptr, file, line);
    return newPtr;
}


/*
 *----------------------------------------------------------------------
Changes to generic/tclClock.c.
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
    }

    /*
     * fields.seconds could be an unsigned number that overflowed. Make sure
     * that it isn't.
     */

    if (Tcl_FetchIntRep(objv[1], &tclBignumType)) {
	Tcl_SetObjResult(interp, literals[LIT_INTEGER_VALUE_TOO_LARGE]);
	return TCL_ERROR;
    }

    /*
     * Convert UTC time to local.
     */







|







448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
    }

    /*
     * fields.seconds could be an unsigned number that overflowed. Make sure
     * that it isn't.
     */

    if (objv[1]->typePtr == &tclBignumType) {
	Tcl_SetObjResult(interp, literals[LIT_INTEGER_VALUE_TOO_LARGE]);
	return TCL_ERROR;
    }

    /*
     * Convert UTC time to local.
     */
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
    formatObj = litPtr[LIT__DEFAULT_FORMAT];
    localeObj = litPtr[LIT_C];
    timezoneObj = litPtr[LIT__NIL];
    for (i = 2; i < objc; i+=2) {
	if (Tcl_GetIndexFromObj(interp, objv[i], options, "option", 0,
		&optionIndex) != TCL_OK) {
	    Tcl_SetErrorCode(interp, "CLOCK", "badOption",
		    Tcl_GetString(objv[i]), NULL);
	    return TCL_ERROR;
	}
	switch (optionIndex) {
	case CLOCK_FORMAT_FORMAT:
	    formatObj = objv[i+1];
	    break;
	case CLOCK_FORMAT_GMT:







|







1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
    formatObj = litPtr[LIT__DEFAULT_FORMAT];
    localeObj = litPtr[LIT_C];
    timezoneObj = litPtr[LIT__NIL];
    for (i = 2; i < objc; i+=2) {
	if (Tcl_GetIndexFromObj(interp, objv[i], options, "option", 0,
		&optionIndex) != TCL_OK) {
	    Tcl_SetErrorCode(interp, "CLOCK", "badOption",
		    TclGetString(objv[i]), NULL);
	    return TCL_ERROR;
	}
	switch (optionIndex) {
	case CLOCK_FORMAT_FORMAT:
	    formatObj = objv[i+1];
	    break;
	case CLOCK_FORMAT_GMT:
Changes to generic/tclCmdAH.c.
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
	Tcl_WrongNumArgs(interp, 1, objv, "name");
	return TCL_ERROR;
    }
    fsInfo = Tcl_FSFileSystemInfo(objv[1]);
    if (fsInfo == NULL) {
	Tcl_SetObjResult(interp, Tcl_NewStringObj("unrecognised path", -1));
	Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "FILESYSTEM",
		Tcl_GetString(objv[1]), NULL);
	return TCL_ERROR;
    }
    Tcl_SetObjResult(interp, fsInfo);
    return TCL_OK;
}

/*







|







1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
	Tcl_WrongNumArgs(interp, 1, objv, "name");
	return TCL_ERROR;
    }
    fsInfo = Tcl_FSFileSystemInfo(objv[1]);
    if (fsInfo == NULL) {
	Tcl_SetObjResult(interp, Tcl_NewStringObj("unrecognised path", -1));
	Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "FILESYSTEM",
		TclGetString(objv[1]), NULL);
	return TCL_ERROR;
    }
    Tcl_SetObjResult(interp, fsInfo);
    return TCL_OK;
}

/*
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
    } else {
	Tcl_Obj *separatorObj = Tcl_FSPathSeparator(objv[1]);

	if (separatorObj == NULL) {
	    Tcl_SetObjResult(interp, Tcl_NewStringObj(
		    "unrecognised path", -1));
	    Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "FILESYSTEM",
		    Tcl_GetString(objv[1]), NULL);
	    return TCL_ERROR;
	}
	Tcl_SetObjResult(interp, separatorObj);
    }
    return TCL_OK;
}








|







1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
    } else {
	Tcl_Obj *separatorObj = Tcl_FSPathSeparator(objv[1]);

	if (separatorObj == NULL) {
	    Tcl_SetObjResult(interp, Tcl_NewStringObj(
		    "unrecognised path", -1));
	    Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "FILESYSTEM",
		    TclGetString(objv[1]), NULL);
	    return TCL_ERROR;
	}
	Tcl_SetObjResult(interp, separatorObj);
    }
    return TCL_OK;
}

Changes to generic/tclCmdIL.c.
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
    if ((objc != 1) && (objc != 2)) {
	Tcl_WrongNumArgs(interp, 1, objv, "?interp?");
	return TCL_ERROR;
    }

    target = interp;
    if (objc == 2) {
	target = Tcl_GetSlave(interp, Tcl_GetString(objv[1]));
	if (target == NULL) {
	    return TCL_ERROR;
	}
    }

    iPtr = (Interp *) target;
    Tcl_SetObjResult(interp, iPtr->errorStack);







|







1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
    if ((objc != 1) && (objc != 2)) {
	Tcl_WrongNumArgs(interp, 1, objv, "?interp?");
	return TCL_ERROR;
    }

    target = interp;
    if (objc == 2) {
	target = Tcl_GetSlave(interp, TclGetString(objv[1]));
	if (target == NULL) {
	    return TCL_ERROR;
	}
    }

    iPtr = (Interp *) target;
    Tcl_SetObjResult(interp, iPtr->errorStack);
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
{
    Tcl_Command command;

    if (objc != 2) {
	Tcl_WrongNumArgs(interp, 1, objv, "commandName");
	return TCL_ERROR;
    }
    command = Tcl_FindCommand(interp, Tcl_GetString(objv[1]), NULL,
	    TCL_LEAVE_ERR_MSG);
    if (command == NULL) {
	return TCL_ERROR;
    }

    /*
     * There's one special case: safe slave interpreters can't see aliases as







|







2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
{
    Tcl_Command command;

    if (objc != 2) {
	Tcl_WrongNumArgs(interp, 1, objv, "commandName");
	return TCL_ERROR;
    }
    command = Tcl_FindCommand(interp, TclGetString(objv[1]), NULL,
	    TCL_LEAVE_ERR_MSG);
    if (command == NULL) {
	return TCL_ERROR;
    }

    /*
     * There's one special case: safe slave interpreters can't see aliases as
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
		if (TclIndexEncode(interp, indices[j], TCL_INDEX_NONE,
			TCL_INDEX_NONE, &encoded) != TCL_OK) {
		    result = TCL_ERROR;
		}
		if (encoded == (int)TCL_INDEX_NONE) {
		    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
			    "index \"%s\" cannot select an element "
			    "from any list", Tcl_GetString(indices[j])));
		    Tcl_SetErrorCode(interp, "TCL", "VALUE", "INDEX"
			    "OUTOFRANGE", NULL);
		    result = TCL_ERROR;
		}
		if (result == TCL_ERROR) {
		    Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
			    "\n    (-index option item number %d)", j));







|







3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
		if (TclIndexEncode(interp, indices[j], TCL_INDEX_NONE,
			TCL_INDEX_NONE, &encoded) != TCL_OK) {
		    result = TCL_ERROR;
		}
		if (encoded == (int)TCL_INDEX_NONE) {
		    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
			    "index \"%s\" cannot select an element "
			    "from any list", TclGetString(indices[j])));
		    Tcl_SetErrorCode(interp, "TCL", "VALUE", "INDEX"
			    "OUTOFRANGE", NULL);
		    result = TCL_ERROR;
		}
		if (result == TCL_ERROR) {
		    Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
			    "\n    (-index option item number %d)", j));
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
		int encoded = 0;
		int result = TclIndexEncode(interp, indexv[j],
			TCL_INDEX_NONE, TCL_INDEX_NONE, &encoded);

		if ((result == TCL_OK) && (encoded == (int)TCL_INDEX_NONE)) {
		    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
			    "index \"%s\" cannot select an element "
			    "from any list", Tcl_GetString(indexv[j])));
		    Tcl_SetErrorCode(interp, "TCL", "VALUE", "INDEX"
			    "OUTOFRANGE", NULL);
		    result = TCL_ERROR;
		}
		if (result == TCL_ERROR) {
		    Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
			    "\n    (-index option item number %d)", j));







|







3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
		int encoded = 0;
		int result = TclIndexEncode(interp, indexv[j],
			TCL_INDEX_NONE, TCL_INDEX_NONE, &encoded);

		if ((result == TCL_OK) && (encoded == (int)TCL_INDEX_NONE)) {
		    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
			    "index \"%s\" cannot select an element "
			    "from any list", TclGetString(indexv[j])));
		    Tcl_SetErrorCode(interp, "TCL", "VALUE", "INDEX"
			    "OUTOFRANGE", NULL);
		    result = TCL_ERROR;
		}
		if (result == TCL_ERROR) {
		    Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
			    "\n    (-index option item number %d)", j));
Changes to generic/tclCmdMZ.c.
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
		wlen = 0;
	    }
	} else {
	    wsrclc = Tcl_UniCharToLower(*wsrc);
	    for (p = wfirstChar = wstring; wstring < wend; wstring++) {
		if ((*wstring == *wsrc ||
			(nocase && Tcl_UniCharToLower(*wstring)==wsrclc)) &&
			(slen==1 || (strCmpFn(wstring, wsrc,
				(size_t)slen) == 0))) {
		    if (numMatches == 0) {
			resultPtr = Tcl_NewUnicodeObj(wstring, 0);
			Tcl_IncrRefCount(resultPtr);
		    }
		    if (p != wstring) {
			Tcl_AppendUnicodeToObj(resultPtr, p, wstring - p);
			p = wstring + slen;







|
<







631
632
633
634
635
636
637
638

639
640
641
642
643
644
645
		wlen = 0;
	    }
	} else {
	    wsrclc = Tcl_UniCharToLower(*wsrc);
	    for (p = wfirstChar = wstring; wstring < wend; wstring++) {
		if ((*wstring == *wsrc ||
			(nocase && Tcl_UniCharToLower(*wstring)==wsrclc)) &&
			(slen==1 || (strCmpFn(wstring, wsrc, slen) == 0))) {

		    if (numMatches == 0) {
			resultPtr = Tcl_NewUnicodeObj(wstring, 0);
			Tcl_IncrRefCount(resultPtr);
		    }
		    if (p != wstring) {
			Tcl_AppendUnicodeToObj(resultPtr, p, wstring - p);
			p = wstring + slen;
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
     */

    end = Tcl_GetCharLength(objv[1]) - 1;
    if (TclGetIntForIndexM(interp, objv[2], end, &index) != TCL_OK) {
	return TCL_ERROR;
    }

    if ((index != TCL_INDEX_NONE) && ((size_t)index + 1 <= end + 1)) {
	int ch = Tcl_GetUniChar(objv[1], index);

	if (ch == -1) {
	    return TCL_OK;
	}

	/*







|







1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
     */

    end = Tcl_GetCharLength(objv[1]) - 1;
    if (TclGetIntForIndexM(interp, objv[2], end, &index) != TCL_OK) {
	return TCL_ERROR;
    }

    if ((index != TCL_INDEX_NONE) && (index + 1 <= end + 1)) {
	int ch = Tcl_GetUniChar(objv[1], index);

	if (ch == -1) {
	    return TCL_OK;
	}

	/*
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
	}
	break;
    }
    case STR_IS_DIGIT:
	chcomp = Tcl_UniCharIsDigit;
	break;
    case STR_IS_DOUBLE: {
	if (Tcl_FetchIntRep(objPtr, &tclDoubleType) ||
		Tcl_FetchIntRep(objPtr, &tclIntType) ||
		Tcl_FetchIntRep(objPtr, &tclBignumType)) {
	    break;
	}
	string1 = TclGetStringFromObj(objPtr, &length1);
	if (length1 == 0) {
	    if (strict) {
		result = 0;
	    }







|
|
|







1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
	}
	break;
    }
    case STR_IS_DIGIT:
	chcomp = Tcl_UniCharIsDigit;
	break;
    case STR_IS_DOUBLE: {
	if ((objPtr->typePtr == &tclDoubleType) ||
		(objPtr->typePtr == &tclIntType) ||
		(objPtr->typePtr == &tclBignumType)) {
	    break;
	}
	string1 = TclGetStringFromObj(objPtr, &length1);
	if (length1 == 0) {
	    if (strict) {
		result = 0;
	    }
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
	break;
    }
    case STR_IS_GRAPH:
	chcomp = Tcl_UniCharIsGraph;
	break;
    case STR_IS_INT:
    case STR_IS_ENTIER:
	if (Tcl_FetchIntRep(objPtr, &tclIntType) ||
		Tcl_FetchIntRep(objPtr, &tclBignumType)) {
	    break;
	}
	string1 = TclGetStringFromObj(objPtr, &length1);
	if (length1 == 0) {
	    if (strict) {
		result = 0;
	    }







|
|







1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
	break;
    }
    case STR_IS_GRAPH:
	chcomp = Tcl_UniCharIsGraph;
	break;
    case STR_IS_INT:
    case STR_IS_ENTIER:
	if ((objPtr->typePtr == &tclIntType) ||
		(objPtr->typePtr == &tclBignumType)) {
	    break;
	}
	string1 = TclGetStringFromObj(objPtr, &length1);
	if (length1 == 0) {
	    if (strict) {
		result = 0;
	    }
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
	return TCL_ERROR;
    }

    if (objc == 4) {
	const char *string = TclGetStringFromObj(objv[1], &length2);

	if ((length2 > 1) &&
		strncmp(string, "-nocase", (size_t) length2) == 0) {
	    nocase = 1;
	} else {
	    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		    "bad option \"%s\": must be -nocase", string));
	    Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "INDEX", "option",
		    string, NULL);
	    return TCL_ERROR;
	}
    }

    /*
     * This test is tricky, but has to be that way or you get other strange
     * inconsistencies (see test string-10.20.1 for illustration why!)
     */

    if (!TclHasStringRep(objv[objc-2])
	    && Tcl_FetchIntRep(objv[objc-2], &tclDictType)){
	int i, done;
	Tcl_DictSearch search;

	/*
	 * We know the type exactly, so all dict operations will succeed for
	 * sure. This shortens this code quite a bit.
	 */







|
















|







1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
	return TCL_ERROR;
    }

    if (objc == 4) {
	const char *string = TclGetStringFromObj(objv[1], &length2);

	if ((length2 > 1) &&
		strncmp(string, "-nocase", length2) == 0) {
	    nocase = 1;
	} else {
	    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		    "bad option \"%s\": must be -nocase", string));
	    Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "INDEX", "option",
		    string, NULL);
	    return TCL_ERROR;
	}
    }

    /*
     * This test is tricky, but has to be that way or you get other strange
     * inconsistencies (see test string-10.20.1 for illustration why!)
     */

    if (!TclHasStringRep(objv[objc-2])
	    && (objv[objc-2]->typePtr == &tclDictType)){
	int i, done;
	Tcl_DictSearch search;

	/*
	 * We know the type exactly, so all dict operations will succeed for
	 * sure. This shortens this code quite a bit.
	 */
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
#endif

    if (count <= 1) {
	/*
	 * Use int obj since we know time is not fractional. [Bug 1202178]
	 */

	objs[0] = Tcl_NewWideIntObj((count <= 0) ? 0 : (Tcl_WideInt) totalMicroSec);
    } else {
	objs[0] = Tcl_NewDoubleObj(totalMicroSec/count);
    }

    /*
     * Construct the result as a list because many programs have always parsed
     * as such (extracting the first element, typically).







|







4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
#endif

    if (count <= 1) {
	/*
	 * Use int obj since we know time is not fractional. [Bug 1202178]
	 */

	objs[0] = Tcl_NewWideIntObj((count <= 0) ? 0 : (Tcl_WideInt)totalMicroSec);
    } else {
	objs[0] = Tcl_NewDoubleObj(totalMicroSec/count);
    }

    /*
     * Construct the result as a list because many programs have always parsed
     * as such (extracting the first element, typically).
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
			"ARGUMENT", NULL);
		return TCL_ERROR;
	    }
	    code = 1;
	    if (Tcl_ListObjLength(NULL, objv[i+1], &dummy) != TCL_OK) {
		Tcl_SetObjResult(interp, Tcl_ObjPrintf(
			"bad prefix '%s': must be a list",
			Tcl_GetString(objv[i+1])));
		Tcl_DecrRefCount(handlersObj);
		Tcl_SetErrorCode(interp, "TCL", "OPERATION", "TRY", "TRAP",
			"EXNFORMAT", NULL);
		return TCL_ERROR;
	    }
	    info[2] = objv[i+1];








|







4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
			"ARGUMENT", NULL);
		return TCL_ERROR;
	    }
	    code = 1;
	    if (Tcl_ListObjLength(NULL, objv[i+1], &dummy) != TCL_OK) {
		Tcl_SetObjResult(interp, Tcl_ObjPrintf(
			"bad prefix '%s': must be a list",
			TclGetString(objv[i+1])));
		Tcl_DecrRefCount(handlersObj);
		Tcl_SetErrorCode(interp, "TCL", "OPERATION", "TRY", "TRAP",
			"EXNFORMAT", NULL);
		return TCL_ERROR;
	    }
	    info[2] = objv[i+1];

4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
				 * contain n elements. */
    int line,			/* Line the list as a whole starts on. */
    int n,			/* #elements in lines */
    int *lines,			/* Array of line numbers, to fill. */
    Tcl_Obj *const *elems)      /* The list elems as Tcl_Obj*, in need of
				 * derived continuation data */
{
    const char *listStr = Tcl_GetString(listObj);
    const char *listHead = listStr;
    int i, length = strlen(listStr);
    const char *element = NULL, *next = NULL;
    ContLineLoc *clLocPtr = TclContinuationsGet(listObj);
    int *clNext = (clLocPtr ? &clLocPtr->loc[0] : NULL);

    for (i = 0; i < n; i++) {







|







4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
				 * contain n elements. */
    int line,			/* Line the list as a whole starts on. */
    int n,			/* #elements in lines */
    int *lines,			/* Array of line numbers, to fill. */
    Tcl_Obj *const *elems)      /* The list elems as Tcl_Obj*, in need of
				 * derived continuation data */
{
    const char *listStr = TclGetString(listObj);
    const char *listHead = listStr;
    int i, length = strlen(listStr);
    const char *element = NULL, *next = NULL;
    ContLineLoc *clLocPtr = TclContinuationsGet(listObj);
    int *clNext = (clLocPtr ? &clLocPtr->loc[0] : NULL);

    for (i = 0; i < n; i++) {
Changes to generic/tclCompCmds.c.
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
    }

    /*
     * Everything is a literal, so the result is constant too (or an error if
     * the format is broken). Do the format now.
     */

    tmpObj = Tcl_Format(interp, Tcl_GetString(formatObj),
	    parsePtr->numWords-2, objv);
    for (; --i>=0 ;) {
	Tcl_DecrRefCount(objv[i]);
    }
    Tcl_Free(objv);
    Tcl_DecrRefCount(formatObj);
    if (tmpObj == NULL) {







|







3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
    }

    /*
     * Everything is a literal, so the result is constant too (or an error if
     * the format is broken). Do the format now.
     */

    tmpObj = Tcl_Format(interp, TclGetString(formatObj),
	    parsePtr->numWords-2, objv);
    for (; --i>=0 ;) {
	Tcl_DecrRefCount(objv[i]);
    }
    Tcl_Free(objv);
    Tcl_DecrRefCount(formatObj);
    if (tmpObj == NULL) {
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
    tokenPtr = TokenAfter(tokenPtr);
    i = 0;

    /*
     * Now scan through and check for non-%s and non-%% substitutions.
     */

    for (bytes = Tcl_GetString(formatObj) ; *bytes ; bytes++) {
	if (*bytes == '%') {
	    bytes++;
	    if (*bytes == 's') {
		i++;
		continue;
	    } else if (*bytes == '%') {
		continue;







|







3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
    tokenPtr = TokenAfter(tokenPtr);
    i = 0;

    /*
     * Now scan through and check for non-%s and non-%% substitutions.
     */

    for (bytes = TclGetString(formatObj) ; *bytes ; bytes++) {
	if (*bytes == '%') {
	    bytes++;
	    if (*bytes == 's') {
		i++;
		continue;
	    } else if (*bytes == '%') {
		continue;
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
     * we'd have the case in the first half of this function) which we will
     * concatenate.
     */

    i = 0;			/* The count of things to concat. */
    j = 2;			/* The index into the argument tokens, for
				 * TIP#280 handling. */
    start = Tcl_GetString(formatObj);
				/* The start of the currently-scanned literal
				 * in the format string. */
    tmpObj = Tcl_NewObj();	/* The buffer used to accumulate the literal
				 * being built. */
    for (bytes = start ; *bytes ; bytes++) {
	if (*bytes == '%') {
	    Tcl_AppendToObj(tmpObj, start, bytes - start);







|







3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
     * we'd have the case in the first half of this function) which we will
     * concatenate.
     */

    i = 0;			/* The count of things to concat. */
    j = 2;			/* The index into the argument tokens, for
				 * TIP#280 handling. */
    start = TclGetString(formatObj);
				/* The start of the currently-scanned literal
				 * in the format string. */
    tmpObj = Tcl_NewObj();	/* The buffer used to accumulate the literal
				 * being built. */
    for (bytes = start ; *bytes ; bytes++) {
	if (*bytes == '%') {
	    Tcl_AppendToObj(tmpObj, start, bytes - start);
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448

3449

3450
3451
3452
3453
3454
3455

3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476

3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
    Tcl_Token *varTokenPtr,	/* Points to a variable token. */
    CompileEnv *envPtr,		/* Holds resulting instructions. */
    int flags,			/* TCL_NO_LARGE_INDEX | TCL_NO_ELEMENT. */
    int *localIndexPtr,		/* Must not be NULL. */
    int *isScalarPtr)		/* Must not be NULL. */
{
    register const char *p;
    const char *name, *elName;
    register size_t i, n;
    Tcl_Token *elemTokenPtr = NULL;
    size_t nameChars, elNameChars;
    int simpleVarName, localIndex;
    int elemTokenCount = 0, allocedTokens = 0, removedParen = 0;

    /*
     * Decide if we can use a frame slot for the var/array name or if we need
     * to emit code to compute and push the name at runtime. We use a frame
     * slot (entry in the array of local vars) if we are compiling a procedure
     * body and if the name is simple text that does not include namespace
     * qualifiers.
     */

    simpleVarName = 0;
    name = elName = NULL;
    nameChars = elNameChars = 0;
    localIndex = -1;

    if (varTokenPtr->type == TCL_TOKEN_SIMPLE_WORD) {
	/*
	 * A simple variable name. Divide it up into "name" and "elName"
	 * strings. If it is not a local variable, look it up at runtime.
	 */

	simpleVarName = 1;

	name = varTokenPtr[1].start;
	nameChars = varTokenPtr[1].size;
	if (name[nameChars-1] == ')') {
	    /*
	     * last char is ')' => potential array reference.
	     */



	    for (i=0,p=name ; i<nameChars ; i++,p++) {
		if (*p == '(') {
		    elName = p + 1;
		    elNameChars = nameChars - i - 2;
		    nameChars = i;
		    break;

		}
	    }

	    if (!(flags & TCL_NO_ELEMENT) && (elName != NULL) && elNameChars) {
		/*
		 * An array element, the element name is a simple string:
		 * assemble the corresponding token.
		 */

		elemTokenPtr = TclStackAlloc(interp, sizeof(Tcl_Token));
		allocedTokens = 1;
		elemTokenPtr->type = TCL_TOKEN_TEXT;
		elemTokenPtr->start = elName;
		elemTokenPtr->size = elNameChars;
		elemTokenPtr->numComponents = 0;
		elemTokenCount = 1;
	    }
	}
    } else if (interp && ((n = varTokenPtr->numComponents) > 1)
	    && (varTokenPtr[1].type == TCL_TOKEN_TEXT)
	    && (varTokenPtr[n].type == TCL_TOKEN_TEXT)

	    && (varTokenPtr[n].start[varTokenPtr[n].size - 1] == ')')) {
	/*
	 * Check for parentheses inside first token.
	 */

	simpleVarName = 0;
	for (i = 0, p = varTokenPtr[1].start;
		i < varTokenPtr[1].size; i++, p++) {
	    if (*p == '(') {
		simpleVarName = 1;
		break;
	    }
	}
	if (simpleVarName) {
	    size_t remainingChars;

	    /*
	     * Check the last token: if it is just ')', do not count it.
	     * Otherwise, remove the ')' and flag so that it is restored at
	     * the end.
	     */

	    if (varTokenPtr[n].size == 1) {
		n--;
	    } else {
		varTokenPtr[n].size--;
		removedParen = n;
	    }

	    name = varTokenPtr[1].start;
	    nameChars = p - varTokenPtr[1].start;
	    elName = p + 1;
	    remainingChars = (varTokenPtr[2].start - p) - 1;
	    elNameChars = (varTokenPtr[n].start-p) + varTokenPtr[n].size - 1;

	    if (!(flags & TCL_NO_ELEMENT)) {
	      if (remainingChars) {
		/*
		 * Make a first token with the extra characters in the first
		 * token.
		 */

		elemTokenPtr = TclStackAlloc(interp, n * sizeof(Tcl_Token));
		allocedTokens = 1;
		elemTokenPtr->type = TCL_TOKEN_TEXT;
		elemTokenPtr->start = elName;
		elemTokenPtr->size = remainingChars;
		elemTokenPtr->numComponents = 0;
		elemTokenCount = n;

		/*
		 * Copy the remaining tokens.
		 */








|
|

|













|











|
|



>

>
|
|
|
|
|
|
>



|









|







>
|





|
|






|















|

|
|


|









|







3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
    Tcl_Token *varTokenPtr,	/* Points to a variable token. */
    CompileEnv *envPtr,		/* Holds resulting instructions. */
    int flags,			/* TCL_NO_LARGE_INDEX | TCL_NO_ELEMENT. */
    int *localIndexPtr,		/* Must not be NULL. */
    int *isScalarPtr)		/* Must not be NULL. */
{
    register const char *p;
    const char *last, *name, *elName;
    register size_t n;
    Tcl_Token *elemTokenPtr = NULL;
	size_t nameLen, elNameLen;
    int simpleVarName, localIndex;
    int elemTokenCount = 0, allocedTokens = 0, removedParen = 0;

    /*
     * Decide if we can use a frame slot for the var/array name or if we need
     * to emit code to compute and push the name at runtime. We use a frame
     * slot (entry in the array of local vars) if we are compiling a procedure
     * body and if the name is simple text that does not include namespace
     * qualifiers.
     */

    simpleVarName = 0;
    name = elName = NULL;
    nameLen = elNameLen = 0;
    localIndex = -1;

    if (varTokenPtr->type == TCL_TOKEN_SIMPLE_WORD) {
	/*
	 * A simple variable name. Divide it up into "name" and "elName"
	 * strings. If it is not a local variable, look it up at runtime.
	 */

	simpleVarName = 1;

	name = varTokenPtr[1].start;
	nameLen = varTokenPtr[1].size;
	if (name[nameLen-1] == ')') {
	    /*
	     * last char is ')' => potential array reference.
	     */
	    last = Tcl_UtfPrev(name + nameLen, name);

	    if (*last == ')') {
		for (p = name;  p < last;  p = Tcl_UtfNext(p)) {
		    if (*p == '(') {
			elName = p + 1;
			elNameLen = last - elName;
			nameLen = p - name;
			break;
		    }
		}
	    }

	    if (!(flags & TCL_NO_ELEMENT) && elNameLen) {
		/*
		 * An array element, the element name is a simple string:
		 * assemble the corresponding token.
		 */

		elemTokenPtr = TclStackAlloc(interp, sizeof(Tcl_Token));
		allocedTokens = 1;
		elemTokenPtr->type = TCL_TOKEN_TEXT;
		elemTokenPtr->start = elName;
		elemTokenPtr->size = elNameLen;
		elemTokenPtr->numComponents = 0;
		elemTokenCount = 1;
	    }
	}
    } else if (interp && ((n = varTokenPtr->numComponents) > 1)
	    && (varTokenPtr[1].type == TCL_TOKEN_TEXT)
	    && (varTokenPtr[n].type == TCL_TOKEN_TEXT)
	    && (*((p = varTokenPtr[n].start + varTokenPtr[n].size)-1) == ')')
	    && (*Tcl_UtfPrev(p, varTokenPtr[n].start) == ')')) {
	/*
	 * Check for parentheses inside first token.
	 */

	simpleVarName = 0;
	for (p = varTokenPtr[1].start,
	     last = p + varTokenPtr[1].size;  p < last;  p = Tcl_UtfNext(p)) {
	    if (*p == '(') {
		simpleVarName = 1;
		break;
	    }
	}
	if (simpleVarName) {
	    size_t remainingLen;

	    /*
	     * Check the last token: if it is just ')', do not count it.
	     * Otherwise, remove the ')' and flag so that it is restored at
	     * the end.
	     */

	    if (varTokenPtr[n].size == 1) {
		n--;
	    } else {
		varTokenPtr[n].size--;
		removedParen = n;
	    }

	    name = varTokenPtr[1].start;
	    nameLen = p - varTokenPtr[1].start;
	    elName = p + 1;
	    remainingLen = (varTokenPtr[2].start - p) - 1;
	    elNameLen = (varTokenPtr[n].start-p) + varTokenPtr[n].size - 1;

	    if (!(flags & TCL_NO_ELEMENT)) {
	      if (remainingLen) {
		/*
		 * Make a first token with the extra characters in the first
		 * token.
		 */

		elemTokenPtr = TclStackAlloc(interp, n * sizeof(Tcl_Token));
		allocedTokens = 1;
		elemTokenPtr->type = TCL_TOKEN_TEXT;
		elemTokenPtr->start = elName;
		elemTokenPtr->size = remainingLen;
		elemTokenPtr->numComponents = 0;
		elemTokenCount = n;

		/*
		 * Copy the remaining tokens.
		 */

3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
    if (simpleVarName) {
	/*
	 * See whether name has any namespace separators (::'s).
	 */

	int hasNsQualifiers = 0;

	for (i = 0, p = name;  i < nameChars;  i++, p++) {
	    if ((*p == ':') && ((i+1) < nameChars) && (*(p+1) == ':')) {
		hasNsQualifiers = 1;
		break;
	    }
	}

	/*
	 * Look up the var name's index in the array of local vars in the proc
	 * frame. If retrieving the var's value and it doesn't already exist,
	 * push its name and look it up at runtime.
	 */

	if (!hasNsQualifiers) {
	    localIndex = TclFindCompiledLocal(name, nameChars, 1, envPtr);
	    if ((flags & TCL_NO_LARGE_INDEX) && (localIndex > 255)) {
		/*
		 * We'll push the name.
		 */

		localIndex = -1;
	    }
	}
	if (interp && localIndex < 0) {
	    PushLiteral(envPtr, name, nameChars);
	}

	/*
	 * Compile the element script, if any, and only if not inhibited. [Bug
	 * 3600328]
	 */

	if (elName != NULL && !(flags & TCL_NO_ELEMENT)) {
	    if (elNameChars) {
		TclCompileTokens(interp, elemTokenPtr, elemTokenCount,
			envPtr);
	    } else {
		PushStringLiteral(envPtr, "");
	    }
	}
    } else if (interp) {







|
|












|









|








|







3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
    if (simpleVarName) {
	/*
	 * See whether name has any namespace separators (::'s).
	 */

	int hasNsQualifiers = 0;

	for (p = name, last = p + nameLen-1;  p < last;  p = Tcl_UtfNext(p)) {
	    if ((*p == ':') && (*(p+1) == ':')) {
		hasNsQualifiers = 1;
		break;
	    }
	}

	/*
	 * Look up the var name's index in the array of local vars in the proc
	 * frame. If retrieving the var's value and it doesn't already exist,
	 * push its name and look it up at runtime.
	 */

	if (!hasNsQualifiers) {
	    localIndex = TclFindCompiledLocal(name, nameLen, 1, envPtr);
	    if ((flags & TCL_NO_LARGE_INDEX) && (localIndex > 255)) {
		/*
		 * We'll push the name.
		 */

		localIndex = -1;
	    }
	}
	if (interp && localIndex < 0) {
	    PushLiteral(envPtr, name, nameLen);
	}

	/*
	 * Compile the element script, if any, and only if not inhibited. [Bug
	 * 3600328]
	 */

	if (elName != NULL && !(flags & TCL_NO_ELEMENT)) {
	    if (elNameLen) {
		TclCompileTokens(interp, elemTokenPtr, elemTokenCount,
			envPtr);
	    } else {
		PushStringLiteral(envPtr, "");
	    }
	}
    } else if (interp) {
Changes to generic/tclCompCmdsGR.c.
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
    }
    tokenPtr = TokenAfter(parsePtr->tokenPtr);
    objPtr = Tcl_NewObj();
    Tcl_IncrRefCount(objPtr);
    if (!TclWordKnownAtCompileTime(tokenPtr, objPtr)) {
	goto notCompilable;
    }
    bytes = Tcl_GetString(objPtr);

    /*
     * We require that the argument start with "::" and not have any of "*\[?"
     * in it. (Theoretically, we should look in only the final component, but
     * the difference is so slight given current naming practices.)
     */








|







603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
    }
    tokenPtr = TokenAfter(parsePtr->tokenPtr);
    objPtr = Tcl_NewObj();
    Tcl_IncrRefCount(objPtr);
    if (!TclWordKnownAtCompileTime(tokenPtr, objPtr)) {
	goto notCompilable;
    }
    bytes = TclGetString(objPtr);

    /*
     * We require that the argument start with "::" and not have any of "*\[?"
     * in it. (Theoretically, we should look in only the final component, but
     * the difference is so slight given current naming practices.)
     */

2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309

    Tcl_DStringInit(&pattern);
    tokenPtr = TokenAfter(tokenPtr);
    patternObj = Tcl_NewObj();
    if (!TclWordKnownAtCompileTime(tokenPtr, patternObj)) {
	goto done;
    }
    if (Tcl_GetString(patternObj)[0] == '-') {
	if (strcmp(Tcl_GetString(patternObj), "--") != 0
		|| parsePtr->numWords == 5) {
	    goto done;
	}
	tokenPtr = TokenAfter(tokenPtr);
	Tcl_DecrRefCount(patternObj);
	patternObj = Tcl_NewObj();
	if (!TclWordKnownAtCompileTime(tokenPtr, patternObj)) {







|
|







2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309

    Tcl_DStringInit(&pattern);
    tokenPtr = TokenAfter(tokenPtr);
    patternObj = Tcl_NewObj();
    if (!TclWordKnownAtCompileTime(tokenPtr, patternObj)) {
	goto done;
    }
    if (TclGetString(patternObj)[0] == '-') {
	if (strcmp(TclGetString(patternObj), "--") != 0
		|| parsePtr->numWords == 5) {
	    goto done;
	}
	tokenPtr = TokenAfter(tokenPtr);
	Tcl_DecrRefCount(patternObj);
	patternObj = Tcl_NewObj();
	if (!TclWordKnownAtCompileTime(tokenPtr, patternObj)) {
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
	    }
	case '\0': case '?': case '[': case '\\':
	    goto done;
	}
	bytes++;
    }
  isSimpleGlob:
    for (bytes = Tcl_GetString(replacementObj); *bytes; bytes++) {
	switch (*bytes) {
	case '\\': case '&':
	    goto done;
	}
    }

    /*







|







2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
	    }
	case '\0': case '?': case '[': case '\\':
	    goto done;
	}
	bytes++;
    }
  isSimpleGlob:
    for (bytes = TclGetString(replacementObj); *bytes; bytes++) {
	switch (*bytes) {
	case '\\': case '&':
	    goto done;
	}
    }

    /*
Changes to generic/tclCompCmdsSZ.c.
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775

    if (parsePtr->numWords == 4) {
	if (tokenPtr->type != TCL_TOKEN_SIMPLE_WORD) {
	    return TclCompileBasic3ArgCmd(interp, parsePtr, cmdPtr, envPtr);
	}
	str = tokenPtr[1].start;
	length = tokenPtr[1].size;
	if ((length <= 1) || strncmp(str, "-nocase", (size_t) length)) {
	    /*
	     * Fail at run time, not in compilation.
	     */

	    return TclCompileBasic3ArgCmd(interp, parsePtr, cmdPtr, envPtr);
	}
	nocase = 1;







|







761
762
763
764
765
766
767
768
769
770
771
772
773
774
775

    if (parsePtr->numWords == 4) {
	if (tokenPtr->type != TCL_TOKEN_SIMPLE_WORD) {
	    return TclCompileBasic3ArgCmd(interp, parsePtr, cmdPtr, envPtr);
	}
	str = tokenPtr[1].start;
	length = tokenPtr[1].size;
	if ((length <= 1) || strncmp(str, "-nocase", length)) {
	    /*
	     * Fail at run time, not in compilation.
	     */

	    return TclCompileBasic3ArgCmd(interp, parsePtr, cmdPtr, envPtr);
	}
	nocase = 1;
Changes to generic/tclCompExpr.c.
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
		 * Single element word. Copy tokens and convert the leading
		 * token to TCL_TOKEN_SUB_EXPR.
		 */

		TclGrowParseTokenArray(parsePtr, toCopy);
		subExprTokenPtr = parsePtr->tokenPtr + parsePtr->numTokens;
		memcpy(subExprTokenPtr, tokenPtr,
			(size_t) toCopy * sizeof(Tcl_Token));
		subExprTokenPtr->type = TCL_TOKEN_SUB_EXPR;
		parsePtr->numTokens += toCopy;
	    } else {
		/*
		 * Multiple element word. Create a TCL_TOKEN_SUB_EXPR token to
		 * lead, with fields initialized from the leading token, then
		 * copy entire set of word tokens.
		 */

		TclGrowParseTokenArray(parsePtr, toCopy+1);
		subExprTokenPtr = parsePtr->tokenPtr + parsePtr->numTokens;
		*subExprTokenPtr = *tokenPtr;
		subExprTokenPtr->type = TCL_TOKEN_SUB_EXPR;
		subExprTokenPtr->numComponents++;
		subExprTokenPtr++;
		memcpy(subExprTokenPtr, tokenPtr,
			(size_t) toCopy * sizeof(Tcl_Token));
		parsePtr->numTokens += toCopy + 1;
	    }

	    scanned = tokenPtr->start + tokenPtr->size - start;
	    start += scanned;
	    numBytes -= scanned;
	    tokenPtr += toCopy;







|
















|







1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
		 * Single element word. Copy tokens and convert the leading
		 * token to TCL_TOKEN_SUB_EXPR.
		 */

		TclGrowParseTokenArray(parsePtr, toCopy);
		subExprTokenPtr = parsePtr->tokenPtr + parsePtr->numTokens;
		memcpy(subExprTokenPtr, tokenPtr,
			toCopy * sizeof(Tcl_Token));
		subExprTokenPtr->type = TCL_TOKEN_SUB_EXPR;
		parsePtr->numTokens += toCopy;
	    } else {
		/*
		 * Multiple element word. Create a TCL_TOKEN_SUB_EXPR token to
		 * lead, with fields initialized from the leading token, then
		 * copy entire set of word tokens.
		 */

		TclGrowParseTokenArray(parsePtr, toCopy+1);
		subExprTokenPtr = parsePtr->tokenPtr + parsePtr->numTokens;
		*subExprTokenPtr = *tokenPtr;
		subExprTokenPtr->type = TCL_TOKEN_SUB_EXPR;
		subExprTokenPtr->numComponents++;
		subExprTokenPtr++;
		memcpy(subExprTokenPtr, tokenPtr,
			toCopy * sizeof(Tcl_Token));
		parsePtr->numTokens += toCopy + 1;
	    }

	    scanned = tokenPtr->start + tokenPtr->size - start;
	    start += scanned;
	    numBytes -= scanned;
	    tokenPtr += toCopy;
Changes to generic/tclCompile.c.
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
    codePtr->numAuxDataItems = envPtr->auxDataArrayNext;
    codePtr->numCmdLocBytes = cmdLocBytes;
    codePtr->maxExceptDepth = envPtr->maxExceptDepth;
    codePtr->maxStackDepth = envPtr->maxStackDepth;

    p += sizeof(ByteCode);
    codePtr->codeStart = p;
    memcpy(p, envPtr->codeStart, (size_t) codeBytes);

    p += TCL_ALIGN(codeBytes);		/* align object array */
    codePtr->objArrayPtr = (Tcl_Obj **) p;
    for (i = 0;  i < numLitObjects;  i++) {
	codePtr->objArrayPtr[i] = TclFetchLiteral(envPtr, i);
    }

    p += TCL_ALIGN(objArrayBytes);	/* align exception range array */
    if (exceptArrayBytes > 0) {
	codePtr->exceptArrayPtr = (ExceptionRange *) p;
	memcpy(p, envPtr->exceptArrayPtr, (size_t) exceptArrayBytes);
    } else {
	codePtr->exceptArrayPtr = NULL;
    }

    p += TCL_ALIGN(exceptArrayBytes);	/* align AuxData array */
    if (auxDataArrayBytes > 0) {
	codePtr->auxDataArrayPtr = (AuxData *) p;
	memcpy(p, envPtr->auxDataArrayPtr, (size_t) auxDataArrayBytes);
    } else {
	codePtr->auxDataArrayPtr = NULL;
    }

    p += auxDataArrayBytes;
#ifndef TCL_COMPILE_DEBUG
    EncodeCmdLocMap(envPtr, codePtr, (unsigned char *) p);







|










|







|







2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
    codePtr->numAuxDataItems = envPtr->auxDataArrayNext;
    codePtr->numCmdLocBytes = cmdLocBytes;
    codePtr->maxExceptDepth = envPtr->maxExceptDepth;
    codePtr->maxStackDepth = envPtr->maxStackDepth;

    p += sizeof(ByteCode);
    codePtr->codeStart = p;
    memcpy(p, envPtr->codeStart, codeBytes);

    p += TCL_ALIGN(codeBytes);		/* align object array */
    codePtr->objArrayPtr = (Tcl_Obj **) p;
    for (i = 0;  i < numLitObjects;  i++) {
	codePtr->objArrayPtr[i] = TclFetchLiteral(envPtr, i);
    }

    p += TCL_ALIGN(objArrayBytes);	/* align exception range array */
    if (exceptArrayBytes > 0) {
	codePtr->exceptArrayPtr = (ExceptionRange *) p;
	memcpy(p, envPtr->exceptArrayPtr, exceptArrayBytes);
    } else {
	codePtr->exceptArrayPtr = NULL;
    }

    p += TCL_ALIGN(exceptArrayBytes);	/* align AuxData array */
    if (auxDataArrayBytes > 0) {
	codePtr->auxDataArrayPtr = (AuxData *) p;
	memcpy(p, envPtr->auxDataArrayPtr, auxDataArrayBytes);
    } else {
	codePtr->auxDataArrayPtr = NULL;
    }

    p += auxDataArrayBytes;
#ifndef TCL_COMPILE_DEBUG
    EncodeCmdLocMap(envPtr, codePtr, (unsigned char *) p);
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
	int localCt = procPtr->numCompiledLocals;

	localPtr = procPtr->firstLocalPtr;
	for (i = 0;  i < localCt;  i++) {
	    if (!TclIsVarTemporary(localPtr)) {
		char *localName = localPtr->name;

		if ((nameBytes == (size_t)localPtr->nameLength) &&
			(strncmp(name,localName,nameBytes) == 0)) {
		    return i;
		}
	    }
	    localPtr = localPtr->nextPtr;
	}
    }







|







2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
	int localCt = procPtr->numCompiledLocals;

	localPtr = procPtr->firstLocalPtr;
	for (i = 0;  i < localCt;  i++) {
	    if (!TclIsVarTemporary(localPtr)) {
		char *localName = localPtr->name;

		if ((nameBytes == localPtr->nameLength) &&
			(strncmp(name,localName,nameBytes) == 0)) {
		    return i;
		}
	    }
	    localPtr = localPtr->nextPtr;
	}
    }
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
	if (name == NULL) {
	    localPtr->flags |= VAR_TEMPORARY;
	}
	localPtr->defValuePtr = NULL;
	localPtr->resolveInfo = NULL;

	if (name != NULL) {
	    memcpy(localPtr->name, name, (size_t) nameBytes);
	}
	localPtr->name[nameBytes] = '\0';
	procPtr->numCompiledLocals++;
    }
    return localVar;
}








|







3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
	if (name == NULL) {
	    localPtr->flags |= VAR_TEMPORARY;
	}
	localPtr->defValuePtr = NULL;
	localPtr->resolveInfo = NULL;

	if (name != NULL) {
	    memcpy(localPtr->name, name, nameBytes);
	}
	localPtr->name[nameBytes] = '\0';
	procPtr->numCompiledLocals++;
    }
    return localVar;
}

Changes to generic/tclCompile.h.
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
    } while (0)



#define ByteCodeGetIntRep(objPtr, typePtr, codePtr)			\
    do {								\
	const Tcl_ObjIntRep *irPtr;					\
	irPtr = Tcl_FetchIntRep((objPtr), (typePtr));			\
	(codePtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL;		\
    } while (0)

/*
 * Opcodes for the Tcl bytecode instructions. These must correspond to the
 * entries in the table of instruction descriptions, tclInstructionTable, in
 * tclCompile.c. Also, the order and number of the expression opcodes (e.g.,







|







524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
    } while (0)



#define ByteCodeGetIntRep(objPtr, typePtr, codePtr)			\
    do {								\
	const Tcl_ObjIntRep *irPtr;					\
	irPtr = TclFetchIntRep((objPtr), (typePtr));			\
	(codePtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL;		\
    } while (0)

/*
 * Opcodes for the Tcl bytecode instructions. These must correspond to the
 * entries in the table of instruction descriptions, tclInstructionTable, in
 * tclCompile.c. Also, the order and number of the expression opcodes (e.g.,
Changes to generic/tclConfig.c.
198
199
200
201
202
203
204

205
206
207
208
209
210
211
212
    Tcl_Interp *interp,
    int objc,
    struct Tcl_Obj *const *objv)
{
    QCCD *cdPtr = clientData;
    Tcl_Obj *pkgName = cdPtr->pkg;
    Tcl_Obj *pDB, *pkgDict, *val, *listPtr;

    int n, index;
    static const char *const subcmdStrings[] = {
	"get", "list", NULL
    };
    enum subcmds {
	CFG_GET, CFG_LIST
    };
    Tcl_DString conv;







>
|







198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
    Tcl_Interp *interp,
    int objc,
    struct Tcl_Obj *const *objv)
{
    QCCD *cdPtr = clientData;
    Tcl_Obj *pkgName = cdPtr->pkg;
    Tcl_Obj *pDB, *pkgDict, *val, *listPtr;
    size_t n;
    int index, m;
    static const char *const subcmdStrings[] = {
	"get", "list", NULL
    };
    enum subcmds {
	CFG_GET, CFG_LIST
    };
    Tcl_DString conv;
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294

    case CFG_LIST:
	if (objc != 2) {
	    Tcl_WrongNumArgs(interp, 2, objv, NULL);
	    return TCL_ERROR;
	}

	Tcl_DictObjSize(interp, pkgDict, &n);
	listPtr = Tcl_NewListObj(n, NULL);

	if (!listPtr) {
	    Tcl_SetObjResult(interp, Tcl_NewStringObj(
		    "insufficient memory to create list", -1));
	    Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
	    return TCL_ERROR;
	}

	if (n) {
	    Tcl_DictSearch s;
	    Tcl_Obj *key;
	    int done;

	    for (Tcl_DictObjFirst(interp, pkgDict, &s, &key, NULL, &done);
		    !done; Tcl_DictObjNext(&s, &key, NULL, &done)) {
		Tcl_ListObjAppendElement(NULL, listPtr, key);







|
|








|







271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295

    case CFG_LIST:
	if (objc != 2) {
	    Tcl_WrongNumArgs(interp, 2, objv, NULL);
	    return TCL_ERROR;
	}

	Tcl_DictObjSize(interp, pkgDict, &m);
	listPtr = Tcl_NewListObj(m, NULL);

	if (!listPtr) {
	    Tcl_SetObjResult(interp, Tcl_NewStringObj(
		    "insufficient memory to create list", -1));
	    Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
	    return TCL_ERROR;
	}

	if (m) {
	    Tcl_DictSearch s;
	    Tcl_Obj *key;
	    int done;

	    for (Tcl_DictObjFirst(interp, pkgDict, &s, &key, NULL, &done);
		    !done; Tcl_DictObjNext(&s, &key, NULL, &done)) {
		Tcl_ListObjAppendElement(NULL, listPtr, key);
Changes to generic/tclDate.c.
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771

    if (objc != 5) {
	Tcl_WrongNumArgs(interp, 1, objv,
		"stringToParse baseYear baseMonth baseDay" );
	return TCL_ERROR;
    }

    yyInput = Tcl_GetString( objv[1] );
    dateInfo.dateStart = yyInput;

    yyHaveDate = 0;
    if (Tcl_GetIntFromObj(interp, objv[2], &yr) != TCL_OK
	    || Tcl_GetIntFromObj(interp, objv[3], &mo) != TCL_OK
	    || Tcl_GetIntFromObj(interp, objv[4], &da) != TCL_OK) {
	return TCL_ERROR;







|







2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771

    if (objc != 5) {
	Tcl_WrongNumArgs(interp, 1, objv,
		"stringToParse baseYear baseMonth baseDay" );
	return TCL_ERROR;
    }

    yyInput = TclGetString(objv[1]);
    dateInfo.dateStart = yyInput;

    yyHaveDate = 0;
    if (Tcl_GetIntFromObj(interp, objv[2], &yr) != TCL_OK
	    || Tcl_GetIntFromObj(interp, objv[3], &mo) != TCL_OK
	    || Tcl_GetIntFromObj(interp, objv[4], &da) != TCL_OK) {
	return TCL_ERROR;
Changes to generic/tclDictObj.c.
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
        ir.twoPtrValue.ptr2 = NULL;                                     \
        Tcl_StoreIntRep((objPtr), &tclDictType, &ir);                   \
    } while (0)

#define DictGetIntRep(objPtr, dictRepPtr)				\
    do {                                                                \
        const Tcl_ObjIntRep *irPtr;                                     \
        irPtr = Tcl_FetchIntRep((objPtr), &tclDictType);                \
        (dictRepPtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL;          \
    } while (0)

/*
 * The type of the specially adapted version of the Tcl_Obj*-containing hash
 * table defined in the tclObj.c code. This version differs in that it
 * allocates a bit more space in each hash entry in order to hold the pointers







|







169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
        ir.twoPtrValue.ptr2 = NULL;                                     \
        Tcl_StoreIntRep((objPtr), &tclDictType, &ir);                   \
    } while (0)

#define DictGetIntRep(objPtr, dictRepPtr)				\
    do {                                                                \
        const Tcl_ObjIntRep *irPtr;                                     \
        irPtr = TclFetchIntRep((objPtr), &tclDictType);                \
        (dictRepPtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL;          \
    } while (0)

/*
 * The type of the specially adapted version of the Tcl_Obj*-containing hash
 * table defined in the tclObj.c code. This version differs in that it
 * allocates a bit more space in each hash entry in order to hold the pointers
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627

    /*
     * Since lists and dictionaries have very closely-related string
     * representations (i.e. the same parsing code) we can safely special-case
     * the conversion from lists to dictionaries.
     */

    if (Tcl_FetchIntRep(objPtr, &tclListType)) {
	int objc, i;
	Tcl_Obj **objv;

	/* Cannot fail, we already know the Tcl_ObjType is "list". */
	TclListObjGetElements(NULL, objPtr, &objc, &objv);
	if (objc & 1) {
	    goto missingValue;







|







613
614
615
616
617
618
619
620
621
622
623
624
625
626
627

    /*
     * Since lists and dictionaries have very closely-related string
     * representations (i.e. the same parsing code) we can safely special-case
     * the conversion from lists to dictionaries.
     */

    if (objPtr->typePtr == &tclListType) {
	int objc, i;
	Tcl_Obj **objv;

	/* Cannot fail, we already know the Tcl_ObjType is "list". */
	TclListObjGetElements(NULL, objPtr, &objc, &objv);
	if (objc & 1) {
	    goto missingValue;
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650

		/*
		 * Not really a well-formed dictionary as there are duplicate
		 * keys, so better get the string rep here so that we can
		 * convert back.
		 */

		(void) Tcl_GetString(objPtr);

		TclDecrRefCount(discardedValue);
	    }
	    Tcl_SetHashValue(hPtr, objv[i+1]);
	    Tcl_IncrRefCount(objv[i+1]); /* Since hash now holds ref to it */
	}
    } else {







|







636
637
638
639
640
641
642
643
644
645
646
647
648
649
650

		/*
		 * Not really a well-formed dictionary as there are duplicate
		 * keys, so better get the string rep here so that we can
		 * convert back.
		 */

		(void) TclGetString(objPtr);

		TclDecrRefCount(discardedValue);
	    }
	    Tcl_SetHashValue(hPtr, objv[i+1]);
	    Tcl_IncrRefCount(objv[i+1]); /* Since hash now holds ref to it */
	}
    } else {
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
    for (i=2 ; i+2<objc ; i+=2) {
	if (Tcl_DictObjGet(interp, dictPtr, objv[i], &objPtr) != TCL_OK) {
	    TclDecrRefCount(dictPtr);
	    return TCL_ERROR;
	}
	if (objPtr == NULL) {
	    /* ??? */
	    Tcl_UnsetVar(interp, Tcl_GetString(objv[i+1]), 0);
	} else if (Tcl_ObjSetVar2(interp, objv[i+1], NULL, objPtr,
		TCL_LEAVE_ERR_MSG) == NULL) {
	    TclDecrRefCount(dictPtr);
	    return TCL_ERROR;
	}
    }
    TclDecrRefCount(dictPtr);







|







3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
    for (i=2 ; i+2<objc ; i+=2) {
	if (Tcl_DictObjGet(interp, dictPtr, objv[i], &objPtr) != TCL_OK) {
	    TclDecrRefCount(dictPtr);
	    return TCL_ERROR;
	}
	if (objPtr == NULL) {
	    /* ??? */
	    Tcl_UnsetVar(interp, TclGetString(objv[i+1]), 0);
	} else if (Tcl_ObjSetVar2(interp, objv[i+1], NULL, objPtr,
		TCL_LEAVE_ERR_MSG) == NULL) {
	    TclDecrRefCount(dictPtr);
	    return TCL_ERROR;
	}
    }
    TclDecrRefCount(dictPtr);
Changes to generic/tclDisassemble.c.
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
	ir.wideValue = (inst);					\
	Tcl_StoreIntRep((objPtr), &instNameType, &ir);		\
    } while (0)

#define InstNameGetIntRep(objPtr, inst)				\
    do {							\
	const Tcl_ObjIntRep *irPtr;				\
	irPtr = Tcl_FetchIntRep((objPtr), &instNameType);	\
	assert(irPtr != NULL);					\
	(inst) = (size_t)irPtr->wideValue;			\
    } while (0)


/*
 *----------------------------------------------------------------------







|







52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
	ir.wideValue = (inst);					\
	Tcl_StoreIntRep((objPtr), &instNameType, &ir);		\
    } while (0)

#define InstNameGetIntRep(objPtr, inst)				\
    do {							\
	const Tcl_ObjIntRep *irPtr;				\
	irPtr = TclFetchIntRep((objPtr), &instNameType);	\
	assert(irPtr != NULL);					\
	(inst) = (size_t)irPtr->wideValue;			\
    } while (0)


/*
 *----------------------------------------------------------------------
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
	    codePtr, codePtr->refCount, codePtr->compileEpoch, iPtr, iPtr->compileEpoch);
    Tcl_AppendToObj(bufferObj, "  Source ", -1);
    PrintSourceToObj(bufferObj, codePtr->source,
	    TclMin(codePtr->numSrcBytes, 55));
    GetLocationInformation(codePtr->procPtr, &fileObj, &line);
    if (line > -1 && fileObj != NULL) {
	Tcl_AppendPrintfToObj(bufferObj, "\n  File \"%s\" Line %d",
		Tcl_GetString(fileObj), line);
    }
    Tcl_AppendPrintfToObj(bufferObj,
	    "\n  Cmds %d, src %d, inst %d, litObjs %u, aux %d, stkDepth %u, code/src %.2f\n",
	    numCmds, codePtr->numSrcBytes, codePtr->numCodeBytes,
	    codePtr->numLitObjects, codePtr->numAuxDataItems,
	    codePtr->maxStackDepth,
#ifdef TCL_COMPILE_STATS







|







284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
	    codePtr, codePtr->refCount, codePtr->compileEpoch, iPtr, iPtr->compileEpoch);
    Tcl_AppendToObj(bufferObj, "  Source ", -1);
    PrintSourceToObj(bufferObj, codePtr->source,
	    TclMin(codePtr->numSrcBytes, 55));
    GetLocationInformation(codePtr->procPtr, &fileObj, &line);
    if (line > -1 && fileObj != NULL) {
	Tcl_AppendPrintfToObj(bufferObj, "\n  File \"%s\" Line %d",
		TclGetString(fileObj), line);
    }
    Tcl_AppendPrintfToObj(bufferObj,
	    "\n  Cmds %d, src %d, inst %d, litObjs %u, aux %d, stkDepth %u, code/src %.2f\n",
	    numCmds, codePtr->numSrcBytes, codePtr->numCodeBytes,
	    codePtr->numLitObjects, codePtr->numAuxDataItems,
	    codePtr->maxStackDepth,
#ifdef TCL_COMPILE_STATS
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
	 */

	if (objc != 3) {
	    Tcl_WrongNumArgs(interp, 2, objv, "script");
	    return TCL_ERROR;
	}

	if ((NULL == Tcl_FetchIntRep(objv[2], &tclByteCodeType)) && (TCL_OK
		!= TclSetByteCodeFromAny(interp, objv[2], NULL, NULL))) {
	    return TCL_ERROR;
	}
	codeObjPtr = objv[2];
	break;

    case DISAS_CLASS_CONSTRUCTOR:







|







1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
	 */

	if (objc != 3) {
	    Tcl_WrongNumArgs(interp, 2, objv, "script");
	    return TCL_ERROR;
	}

	if ((objv[2]->typePtr != &tclByteCodeType) && (TCL_OK
		!= TclSetByteCodeFromAny(interp, objv[2], NULL, NULL))) {
	    return TCL_ERROR;
	}
	codeObjPtr = objv[2];
	break;

    case DISAS_CLASS_CONSTRUCTOR:
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
	if (procPtr == NULL) {
	    Tcl_SetObjResult(interp, Tcl_NewStringObj(
		    "body not available for this kind of method", -1));
	    Tcl_SetErrorCode(interp, "TCL", "OPERATION", "DISASSEMBLE",
		    "METHODTYPE", NULL);
	    return TCL_ERROR;
	}
	if (NULL == Tcl_FetchIntRep(procPtr->bodyPtr, &tclByteCodeType)) {
	    Command cmd;

	    /*
	     * Yes, this is ugly, but we need to pass the namespace in to the
	     * compiler in two places.
	     */








|







1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
	if (procPtr == NULL) {
	    Tcl_SetObjResult(interp, Tcl_NewStringObj(
		    "body not available for this kind of method", -1));
	    Tcl_SetErrorCode(interp, "TCL", "OPERATION", "DISASSEMBLE",
		    "METHODTYPE", NULL);
	    return TCL_ERROR;
	}
	if (procPtr->bodyPtr->typePtr != &tclByteCodeType) {
	    Command cmd;

	    /*
	     * Yes, this is ugly, but we need to pass the namespace in to the
	     * compiler in two places.
	     */

Changes to generic/tclEncoding.c.
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
	ir.twoPtrValue.ptr2 = NULL;					\
	Tcl_StoreIntRep((objPtr), &encodingType, &ir);			\
    } while (0)

#define EncodingGetIntRep(objPtr, encoding)				\
    do {								\
	const Tcl_ObjIntRep *irPtr;					\
	irPtr = Tcl_FetchIntRep ((objPtr), &encodingType);		\
	(encoding) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL;		\
    } while (0)


/*
 *----------------------------------------------------------------------
 *







|







286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
	ir.twoPtrValue.ptr2 = NULL;					\
	Tcl_StoreIntRep((objPtr), &encodingType, &ir);			\
    } while (0)

#define EncodingGetIntRep(objPtr, encoding)				\
    do {								\
	const Tcl_ObjIntRep *irPtr;					\
	irPtr = TclFetchIntRep ((objPtr), &encodingType);		\
	(encoding) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL;		\
    } while (0)


/*
 *----------------------------------------------------------------------
 *
Changes to generic/tclEnsemble.c.
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
	ir.twoPtrValue.ptr2 = NULL;					\
	Tcl_StoreIntRep((objPtr), &ensembleCmdType, &ir);		\
    } while (0)

#define ECRGetIntRep(objPtr, ecRepPtr)					\
    do {								\
	const Tcl_ObjIntRep *irPtr;					\
	irPtr = Tcl_FetchIntRep((objPtr), &ensembleCmdType);		\
	(ecRepPtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL;		\
    } while (0)

/*
 * The internal rep for caching ensemble subcommand lookups and spelling
 * corrections.
 */







|







91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
	ir.twoPtrValue.ptr2 = NULL;					\
	Tcl_StoreIntRep((objPtr), &ensembleCmdType, &ir);		\
    } while (0)

#define ECRGetIntRep(objPtr, ecRepPtr)					\
    do {								\
	const Tcl_ObjIntRep *irPtr;					\
	irPtr = TclFetchIntRep((objPtr), &ensembleCmdType);		\
	(ecRepPtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL;		\
    } while (0)

/*
 * The internal rep for caching ensemble subcommand lookups and spelling
 * corrections.
 */
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
		if (map[i].unsafe && Tcl_IsSafe(interp)) {
		    cmdPtr = (Command *)
			    Tcl_NRCreateCommand(interp, "___tmp", map[i].proc,
			    map[i].nreProc, map[i].clientData, NULL);
		    Tcl_DStringSetLength(&hiddenBuf, hiddenLen);
		    if (Tcl_HideCommand(interp, "___tmp",
			    Tcl_DStringAppend(&hiddenBuf, map[i].name, -1))) {
			Tcl_Panic("%s", Tcl_GetString(Tcl_GetObjResult(interp)));
		    }
		} else {
		    /*
		     * Not hidden, so just create it. Yay!
		     */

		    cmdPtr = (Command *)







|







1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
		if (map[i].unsafe && Tcl_IsSafe(interp)) {
		    cmdPtr = (Command *)
			    Tcl_NRCreateCommand(interp, "___tmp", map[i].proc,
			    map[i].nreProc, map[i].clientData, NULL);
		    Tcl_DStringSetLength(&hiddenBuf, hiddenLen);
		    if (Tcl_HideCommand(interp, "___tmp",
			    Tcl_DStringAppend(&hiddenBuf, map[i].name, -1))) {
			Tcl_Panic("%s", Tcl_GetStringResult(interp));
		    }
		} else {
		    /*
		     * Not hidden, so just create it. Yay!
		     */

		    cmdPtr = (Command *)
Changes to generic/tclEnv.c.
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
    /*
     * For those platforms that support putenv to unset, Linux indicates
     * that no = should be included, and Windows requires it.
     */

#if defined(_WIN32)
    string = Tcl_Alloc(length + 2);
    memcpy(string, name, (size_t) length);
    string[length] = '=';
    string[length+1] = '\0';
#else
    string = Tcl_Alloc(length + 1);
    memcpy(string, name, (size_t) length);
    string[length] = '\0';
#endif /* _WIN32 */

    Tcl_UtfToExternalDString(NULL, string, -1, &envString);
    string = Tcl_Realloc(string, Tcl_DStringLength(&envString) + 1);
    memcpy(string, Tcl_DStringValue(&envString),
	    Tcl_DStringLength(&envString)+1);







|




|







437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
    /*
     * For those platforms that support putenv to unset, Linux indicates
     * that no = should be included, and Windows requires it.
     */

#if defined(_WIN32)
    string = Tcl_Alloc(length + 2);
    memcpy(string, name, length);
    string[length] = '=';
    string[length+1] = '\0';
#else
    string = Tcl_Alloc(length + 1);
    memcpy(string, name, length);
    string[length] = '\0';
#endif /* _WIN32 */

    Tcl_UtfToExternalDString(NULL, string, -1, &envString);
    string = Tcl_Realloc(string, Tcl_DStringLength(&envString) + 1);
    memcpy(string, Tcl_DStringValue(&envString),
	    Tcl_DStringLength(&envString)+1);
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701

	const int growth = 5;

	env.cache = Tcl_Realloc(env.cache,
		(env.cacheSize + growth) * sizeof(char *));
	env.cache[env.cacheSize] = newStr;
	(void) memset(env.cache+env.cacheSize+1, 0,
		(size_t) (growth-1) * sizeof(char *));
	env.cacheSize += growth;
    }
}

/*
 *----------------------------------------------------------------------
 *







|







687
688
689
690
691
692
693
694
695
696
697
698
699
700
701

	const int growth = 5;

	env.cache = Tcl_Realloc(env.cache,
		(env.cacheSize + growth) * sizeof(char *));
	env.cache[env.cacheSize] = newStr;
	(void) memset(env.cache+env.cacheSize+1, 0,
		(growth-1) * sizeof(char *));
	env.cacheSize += growth;
    }
}

/*
 *----------------------------------------------------------------------
 *
Changes to generic/tclEvent.c.
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
    int done, foundEvent;
    const char *nameString;

    if (objc != 2) {
	Tcl_WrongNumArgs(interp, 1, objv, "name");
	return TCL_ERROR;
    }
    nameString = Tcl_GetString(objv[1]);
    if (Tcl_TraceVar2(interp, nameString, NULL,
	    TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
	    VwaitVarProc, &done) != TCL_OK) {
	return TCL_ERROR;
    };
    done = 0;
    foundEvent = 1;







|







1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
    int done, foundEvent;
    const char *nameString;

    if (objc != 2) {
	Tcl_WrongNumArgs(interp, 1, objv, "name");
	return TCL_ERROR;
    }
    nameString = TclGetString(objv[1]);
    if (Tcl_TraceVar2(interp, nameString, NULL,
	    TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
	    VwaitVarProc, &done) != TCL_OK) {
	return TCL_ERROR;
    };
    done = 0;
    foundEvent = 1;
Changes to generic/tclExecute.c.
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
 * MODULE_SCOPE int GetNumberFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
 *			ClientData *ptrPtr, int *tPtr);
 */

#define GetNumberFromObj(interp, objPtr, ptrPtr, tPtr) \
    (((objPtr)->typePtr == &tclIntType)					\
	?	(*(tPtr) = TCL_NUMBER_INT,				\
		*(ptrPtr) = (ClientData)				\
		    (&((objPtr)->internalRep.wideValue)), TCL_OK) :	\
    ((objPtr)->typePtr == &tclDoubleType)				\
	?	(((TclIsNaN((objPtr)->internalRep.doubleValue))		\
		    ?	(*(tPtr) = TCL_NUMBER_NAN)			\
		    :	(*(tPtr) = TCL_NUMBER_DOUBLE)),			\
		*(ptrPtr) = (ClientData)				\
		    (&((objPtr)->internalRep.doubleValue)), TCL_OK) :	\
    (((objPtr)->bytes != NULL) && ((objPtr)->length == 0))		\
	? TCL_ERROR :			\
    TclGetNumberFromObj((interp), (objPtr), (ptrPtr), (tPtr)))

/*
 * Macro used to make the check for type overflow more mnemonic. This works by







|





|







439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
 * MODULE_SCOPE int GetNumberFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
 *			ClientData *ptrPtr, int *tPtr);
 */

#define GetNumberFromObj(interp, objPtr, ptrPtr, tPtr) \
    (((objPtr)->typePtr == &tclIntType)					\
	?	(*(tPtr) = TCL_NUMBER_INT,				\
		*(ptrPtr) = (void *)				\
		    (&((objPtr)->internalRep.wideValue)), TCL_OK) :	\
    ((objPtr)->typePtr == &tclDoubleType)				\
	?	(((TclIsNaN((objPtr)->internalRep.doubleValue))		\
		    ?	(*(tPtr) = TCL_NUMBER_NAN)			\
		    :	(*(tPtr) = TCL_NUMBER_DOUBLE)),			\
		*(ptrPtr) = (void *)				\
		    (&((objPtr)->internalRep.doubleValue)), TCL_OK) :	\
    (((objPtr)->bytes != NULL) && ((objPtr)->length == 0))		\
	? TCL_ERROR :			\
    TclGetNumberFromObj((interp), (objPtr), (ptrPtr), (tPtr)))

/*
 * Macro used to make the check for type overflow more mnemonic. This works by
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
			    int move);
static void		IllegalExprOperandType(Tcl_Interp *interp,
			    const unsigned char *pc, Tcl_Obj *opndPtr);
static void		InitByteCodeExecution(Tcl_Interp *interp);
static inline int	wordSkip(void *ptr);
static void		ReleaseDictIterator(Tcl_Obj *objPtr);
/* Useful elsewhere, make available in tclInt.h or stubs? */
static Tcl_Obj **	StackAllocWords(Tcl_Interp *interp, int numWords);
static Tcl_Obj **	StackReallocWords(Tcl_Interp *interp, int numWords);
static Tcl_NRPostProc	CopyCallback;
static Tcl_NRPostProc	ExprObjCallback;
static Tcl_NRPostProc	FinalizeOONext;
static Tcl_NRPostProc	FinalizeOONextFilter;
static Tcl_NRPostProc   TEBCresume;

/*







|
|







631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
			    int move);
static void		IllegalExprOperandType(Tcl_Interp *interp,
			    const unsigned char *pc, Tcl_Obj *opndPtr);
static void		InitByteCodeExecution(Tcl_Interp *interp);
static inline int	wordSkip(void *ptr);
static void		ReleaseDictIterator(Tcl_Obj *objPtr);
/* Useful elsewhere, make available in tclInt.h or stubs? */
static Tcl_Obj **	StackAllocWords(Tcl_Interp *interp, size_t numWords);
static Tcl_Obj **	StackReallocWords(Tcl_Interp *interp, size_t numWords);
static Tcl_NRPostProc	CopyCallback;
static Tcl_NRPostProc	ExprObjCallback;
static Tcl_NRPostProc	FinalizeOONext;
static Tcl_NRPostProc	FinalizeOONextFilter;
static Tcl_NRPostProc   TEBCresume;

/*
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
ReleaseDictIterator(
    Tcl_Obj *objPtr)
{
    Tcl_DictSearch *searchPtr;
    Tcl_Obj *dictPtr;
    const Tcl_ObjIntRep *irPtr;

    irPtr = Tcl_FetchIntRep(objPtr, &dictIteratorType);
    assert(irPtr != NULL);

    /*
     * First kill the search, and then release the reference to the dictionary
     * that we were holding.
     */








|







688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
ReleaseDictIterator(
    Tcl_Obj *objPtr)
{
    Tcl_DictSearch *searchPtr;
    Tcl_Obj *dictPtr;
    const Tcl_ObjIntRep *irPtr;

    irPtr = TclFetchIntRep(objPtr, &dictIteratorType);
    assert(irPtr != NULL);

    /*
     * First kill the search, and then release the reference to the dictionary
     * that we were holding.
     */

773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
    Tcl_Interp *interp,		/* Interpreter for which the execution
				 * environment is being created. */
    size_t size)			/* The initial stack size, in number of words
				 * [sizeof(Tcl_Obj*)] */
{
    ExecEnv *eePtr = Tcl_Alloc(sizeof(ExecEnv));
    ExecStack *esPtr = Tcl_Alloc(sizeof(ExecStack)
	    + (size_t) (size-1) * sizeof(Tcl_Obj *));

    eePtr->execStackPtr = esPtr;
    TclNewIntObj(eePtr->constants[0], 0);
    Tcl_IncrRefCount(eePtr->constants[0]);
    TclNewIntObj(eePtr->constants[1], 1);
    Tcl_IncrRefCount(eePtr->constants[1]);
    eePtr->interp = interp;







|







773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
    Tcl_Interp *interp,		/* Interpreter for which the execution
				 * environment is being created. */
    size_t size)			/* The initial stack size, in number of words
				 * [sizeof(Tcl_Obj*)] */
{
    ExecEnv *eePtr = Tcl_Alloc(sizeof(ExecEnv));
    ExecStack *esPtr = Tcl_Alloc(sizeof(ExecStack)
	    + (size-1) * sizeof(Tcl_Obj *));

    eePtr->execStackPtr = esPtr;
    TclNewIntObj(eePtr->constants[0], 0);
    Tcl_IncrRefCount(eePtr->constants[0]);
    TclNewIntObj(eePtr->constants[1], 1);
    Tcl_IncrRefCount(eePtr->constants[1]);
    eePtr->interp = interp;
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
    ExecEnv *eePtr,		/* Points to the ExecEnv with an evaluation
				 * stack to enlarge. */
    int growth,			/* How much larger than the current used
				 * size. */
    int move)			/* 1 if move words since last marker. */
{
    ExecStack *esPtr = eePtr->execStackPtr, *oldPtr = NULL;
    int newBytes, newElems, currElems;
    int needed = growth - (esPtr->endPtr - esPtr->tosPtr);
    Tcl_Obj **markerPtr = esPtr->markerPtr, **memStart;
    int moveWords = 0;

    if (move) {
	if (!markerPtr) {
	    Tcl_Panic("STACK: Reallocating with no previous alloc");
	}







|
|







955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
    ExecEnv *eePtr,		/* Points to the ExecEnv with an evaluation
				 * stack to enlarge. */
    int growth,			/* How much larger than the current used
				 * size. */
    int move)			/* 1 if move words since last marker. */
{
    ExecStack *esPtr = eePtr->execStackPtr, *oldPtr = NULL;
    size_t newBytes;
    int newElems, currElems, needed = growth - (esPtr->endPtr - esPtr->tosPtr);
    Tcl_Obj **markerPtr = esPtr->markerPtr, **memStart;
    int moveWords = 0;

    if (move) {
	if (!markerPtr) {
	    Tcl_Panic("STACK: Reallocating with no previous alloc");
	}
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
 *
 *--------------------------------------------------------------
 */

static Tcl_Obj **
StackAllocWords(
    Tcl_Interp *interp,
    int numWords)
{
    /*
     * Note that GrowEvaluationStack sets a marker in the stack. This marker
     * is read when rewinding, e.g., by TclStackFree.
     */

    Interp *iPtr = (Interp *) interp;
    ExecEnv *eePtr = iPtr->execEnvPtr;
    Tcl_Obj **resPtr = GrowEvaluationStack(eePtr, numWords, 0);

    eePtr->execStackPtr->tosPtr += numWords;
    return resPtr;
}

static Tcl_Obj **
StackReallocWords(
    Tcl_Interp *interp,
    int numWords)
{
    Interp *iPtr = (Interp *) interp;
    ExecEnv *eePtr = iPtr->execEnvPtr;
    Tcl_Obj **resPtr = GrowEvaluationStack(eePtr, numWords, 1);

    eePtr->execStackPtr->tosPtr += numWords;
    return resPtr;







|

















|







1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
 *
 *--------------------------------------------------------------
 */

static Tcl_Obj **
StackAllocWords(
    Tcl_Interp *interp,
    size_t numWords)
{
    /*
     * Note that GrowEvaluationStack sets a marker in the stack. This marker
     * is read when rewinding, e.g., by TclStackFree.
     */

    Interp *iPtr = (Interp *) interp;
    ExecEnv *eePtr = iPtr->execEnvPtr;
    Tcl_Obj **resPtr = GrowEvaluationStack(eePtr, numWords, 0);

    eePtr->execStackPtr->tosPtr += numWords;
    return resPtr;
}

static Tcl_Obj **
StackReallocWords(
    Tcl_Interp *interp,
    size_t numWords)
{
    Interp *iPtr = (Interp *) interp;
    ExecEnv *eePtr = iPtr->execEnvPtr;
    Tcl_Obj **resPtr = GrowEvaluationStack(eePtr, numWords, 1);

    eePtr->execStackPtr->tosPtr += numWords;
    return resPtr;
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237

void *
TclStackAlloc(
    Tcl_Interp *interp,
    size_t numBytes)
{
    Interp *iPtr = (Interp *) interp;
    int numWords;

    if (iPtr == NULL || iPtr->execEnvPtr == NULL) {
	return (void *) Tcl_Alloc(numBytes);
    }
    numWords = (numBytes + (sizeof(Tcl_Obj *) - 1))/sizeof(Tcl_Obj *);
    return (void *) StackAllocWords(interp, numWords);
}

void *
TclStackRealloc(
    Tcl_Interp *interp,
    void *ptr,
    size_t numBytes)
{
    Interp *iPtr = (Interp *) interp;
    ExecEnv *eePtr;
    ExecStack *esPtr;
    Tcl_Obj **markerPtr;
    int numWords;

    if (iPtr == NULL || iPtr->execEnvPtr == NULL) {
	return (void *) Tcl_Realloc((char *) ptr, numBytes);
    }

    eePtr = iPtr->execEnvPtr;
    esPtr = eePtr->execStackPtr;
    markerPtr = esPtr->markerPtr;

    if (MEMSTART(markerPtr) != (Tcl_Obj **)ptr) {







|





|












|


|







1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237

void *
TclStackAlloc(
    Tcl_Interp *interp,
    size_t numBytes)
{
    Interp *iPtr = (Interp *) interp;
    size_t numWords;

    if (iPtr == NULL || iPtr->execEnvPtr == NULL) {
	return (void *) Tcl_Alloc(numBytes);
    }
    numWords = (numBytes + (sizeof(Tcl_Obj *) - 1))/sizeof(Tcl_Obj *);
    return StackAllocWords(interp, numWords);
}

void *
TclStackRealloc(
    Tcl_Interp *interp,
    void *ptr,
    size_t numBytes)
{
    Interp *iPtr = (Interp *) interp;
    ExecEnv *eePtr;
    ExecStack *esPtr;
    Tcl_Obj **markerPtr;
    size_t numWords;

    if (iPtr == NULL || iPtr->execEnvPtr == NULL) {
	return Tcl_Realloc(ptr, numBytes);
    }

    eePtr = iPtr->execEnvPtr;
    esPtr = eePtr->execStackPtr;
    markerPtr = esPtr->markerPtr;

    if (MEMSTART(markerPtr) != (Tcl_Obj **)ptr) {
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
	 */

	TclGetIntFromObj(interp, incrPtr, &type1);
	Tcl_AddErrorInfo(interp, "\n    (reading increment)");
	return TCL_ERROR;
    }

    if ((type1 != TCL_NUMBER_BIG) && (type2 != TCL_NUMBER_BIG)) {
	Tcl_WideInt w1, w2, sum;

	TclGetWideIntFromObj(NULL, valuePtr, &w1);
	TclGetWideIntFromObj(NULL, incrPtr, &w2);
	sum = w1 + w2;

	/*
	 * Check for overflow.
	 */

	if (!Overflowing(w1, w2, sum)) {







|


|
|







1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
	 */

	TclGetIntFromObj(interp, incrPtr, &type1);
	Tcl_AddErrorInfo(interp, "\n    (reading increment)");
	return TCL_ERROR;
    }

    if ((type1 == TCL_NUMBER_INT) && (type2 == TCL_NUMBER_INT)) {
	Tcl_WideInt w1, w2, sum;

	w1 = *((const Tcl_WideInt *)ptr1);
	w2 = *((const Tcl_WideInt *)ptr2);
	sum = w1 + w2;

	/*
	 * Check for overflow.
	 */

	if (!Overflowing(w1, w2, sum)) {
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
	varPtr = LOCAL(opnd);
	while (TclIsVarLink(varPtr)) {
	    varPtr = varPtr->value.linkPtr;
	}
	arrayPtr = NULL;
	part1Ptr = part2Ptr = NULL;
	cleanup = 0;
	TRACE(("%u %s => ", opnd, Tcl_GetString(incrPtr)));

    doIncrVar:
	if (TclIsVarDirectModifyable2(varPtr, arrayPtr)) {
	    objPtr = varPtr->value.objPtr;
	    if (Tcl_IsShared(objPtr)) {
		objPtr->refCount--;	/* We know it's shared */
		objResultPtr = Tcl_DuplicateObj(objPtr);







|







3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
	varPtr = LOCAL(opnd);
	while (TclIsVarLink(varPtr)) {
	    varPtr = varPtr->value.linkPtr;
	}
	arrayPtr = NULL;
	part1Ptr = part2Ptr = NULL;
	cleanup = 0;
	TRACE(("%u %s => ", opnd, TclGetString(incrPtr)));

    doIncrVar:
	if (TclIsVarDirectModifyable2(varPtr, arrayPtr)) {
	    objPtr = varPtr->value.objPtr;
	    if (Tcl_IsShared(objPtr)) {
		objPtr->refCount--;	/* We know it's shared */
		objResultPtr = Tcl_DuplicateObj(objPtr);
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
    /*
     *     End of TclOO support instructions.
     * -----------------------------------------------------------------
     *	   Start of INST_LIST and related instructions.
     */

    {
	int numIndices;
	int nocase, match, length2, cflags, s1len, s2len;
	size_t index, slength, fromIdx, toIdx;
	const char *s1, *s2;

    case INST_LIST:
	/*
	 * Pop the opnd (objc) top stack elements into a new list obj and then
	 * decrement their ref counts.
	 */







|
<
|







4519
4520
4521
4522
4523
4524
4525
4526

4527
4528
4529
4530
4531
4532
4533
4534
    /*
     *     End of TclOO support instructions.
     * -----------------------------------------------------------------
     *	   Start of INST_LIST and related instructions.
     */

    {
	int numIndices, nocase, match, cflags;

	size_t slength, length2, fromIdx, toIdx, index, s1len, s2len;
	const char *s1, *s2;

    case INST_LIST:
	/*
	 * Pop the opnd (objc) top stack elements into a new list obj and then
	 * decrement their ref counts.
	 */
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
	TRACE(("\"%.30s\" \"%.30s\" => ", O2S(valuePtr), O2S(value2Ptr)));

	/*
	 * Extract the desired list element.
	 */

	if ((TclListObjGetElements(interp, valuePtr, &objc, &objv) == TCL_OK)
		&& (NULL == Tcl_FetchIntRep(value2Ptr, &tclListType))
		&& (TclGetIntForIndexM(NULL, value2Ptr, objc-1,
			&index) == TCL_OK)) {
	    TclDecrRefCount(value2Ptr);
	    tosPtr--;
	    pcAdjustment = 1;
	    goto lindexFastPath;
	}







|







4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
	TRACE(("\"%.30s\" \"%.30s\" => ", O2S(valuePtr), O2S(value2Ptr)));

	/*
	 * Extract the desired list element.
	 */

	if ((TclListObjGetElements(interp, valuePtr, &objc, &objv) == TCL_OK)
		&& (value2Ptr->typePtr != &tclListType)
		&& (TclGetIntForIndexM(NULL, value2Ptr, objc-1,
			&index) == TCL_OK)) {
	    TclDecrRefCount(value2Ptr);
	    tosPtr--;
	    pcAdjustment = 1;
	    goto lindexFastPath;
	}
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
	    TclNewObj(objResultPtr);
	}
	TRACE_APPEND(("%.30s\n", O2S(objResultPtr)));
	NEXT_INST_F(9, 1, 1);

    {
	Tcl_UniChar *ustring1, *ustring2, *ustring3, *end, *p;
	int length3;
	Tcl_Obj *value3Ptr;

    case INST_STR_REPLACE:
	value3Ptr = POP_OBJECT();
	valuePtr = OBJ_AT_DEPTH(2);
	slength = Tcl_GetCharLength(valuePtr) - 1;
	TRACE(("\"%.20s\" %s %s \"%.20s\" => ", O2S(valuePtr),







|







5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
	    TclNewObj(objResultPtr);
	}
	TRACE_APPEND(("%.30s\n", O2S(objResultPtr)));
	NEXT_INST_F(9, 1, 1);

    {
	Tcl_UniChar *ustring1, *ustring2, *ustring3, *end, *p;
	size_t length3;
	Tcl_Obj *value3Ptr;

    case INST_STR_REPLACE:
	value3Ptr = POP_OBJECT();
	valuePtr = OBJ_AT_DEPTH(2);
	slength = Tcl_GetCharLength(valuePtr) - 1;
	TRACE(("\"%.20s\" %s %s \"%.20s\" => ", O2S(valuePtr),
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
	}
	ustring1 = TclGetUnicodeFromObj(valuePtr, &slength);
	if (slength == 0) {
	    objResultPtr = valuePtr;
	    goto doneStringMap;
	}
	ustring2 = TclGetUnicodeFromObj(value2Ptr, &length2);
	if (length2 > (int)slength || length2 == 0) {
	    objResultPtr = valuePtr;
	    goto doneStringMap;
	} else if (length2 == (int)slength) {
	    if (memcmp(ustring1, ustring2, sizeof(Tcl_UniChar) * slength)) {
		objResultPtr = valuePtr;
	    } else {
		objResultPtr = value3Ptr;
	    }
	    goto doneStringMap;
	}







|


|







5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
	}
	ustring1 = TclGetUnicodeFromObj(valuePtr, &slength);
	if (slength == 0) {
	    objResultPtr = valuePtr;
	    goto doneStringMap;
	}
	ustring2 = TclGetUnicodeFromObj(value2Ptr, &length2);
	if (length2 > slength || length2 == 0) {
	    objResultPtr = valuePtr;
	    goto doneStringMap;
	} else if (length2 == slength) {
	    if (memcmp(ustring1, ustring2, sizeof(Tcl_UniChar) * slength)) {
		objResultPtr = valuePtr;
	    } else {
		objResultPtr = value3Ptr;
	    }
	    goto doneStringMap;
	}
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
	    TclNewObj(statePtr);
	    ir.twoPtrValue.ptr1 = searchPtr;
	    ir.twoPtrValue.ptr2 = dictPtr;
	    Tcl_StoreIntRep(statePtr, &dictIteratorType, &ir);
	}
	varPtr = LOCAL(opnd);
	if (varPtr->value.objPtr) {
	    if (Tcl_FetchIntRep(varPtr->value.objPtr, &dictIteratorType)) {
		Tcl_Panic("mis-issued dictFirst!");
	    }
	    TclDecrRefCount(varPtr->value.objPtr);
	}
	varPtr->value.objPtr = statePtr;
	Tcl_IncrRefCount(statePtr);
	goto pushDictIteratorResult;

    case INST_DICT_NEXT:
	opnd = TclGetUInt4AtPtr(pc+1);
	TRACE(("%u => ", opnd));
	statePtr = (*LOCAL(opnd)).value.objPtr;
	{
	    const Tcl_ObjIntRep *irPtr;

	    if (statePtr &&
		    (irPtr = Tcl_FetchIntRep(statePtr, &dictIteratorType))) {
		searchPtr = irPtr->twoPtrValue.ptr1;
		Tcl_DictObjNext(searchPtr, &keyPtr, &valuePtr, &done);
	    } else {
		Tcl_Panic("mis-issued dictNext!");
	    }
	}
    pushDictIteratorResult:







|
















|







6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
	    TclNewObj(statePtr);
	    ir.twoPtrValue.ptr1 = searchPtr;
	    ir.twoPtrValue.ptr2 = dictPtr;
	    Tcl_StoreIntRep(statePtr, &dictIteratorType, &ir);
	}
	varPtr = LOCAL(opnd);
	if (varPtr->value.objPtr) {
	    if (varPtr->value.objPtr->typePtr == &dictIteratorType) {
		Tcl_Panic("mis-issued dictFirst!");
	    }
	    TclDecrRefCount(varPtr->value.objPtr);
	}
	varPtr->value.objPtr = statePtr;
	Tcl_IncrRefCount(statePtr);
	goto pushDictIteratorResult;

    case INST_DICT_NEXT:
	opnd = TclGetUInt4AtPtr(pc+1);
	TRACE(("%u => ", opnd));
	statePtr = (*LOCAL(opnd)).value.objPtr;
	{
	    const Tcl_ObjIntRep *irPtr;

	    if (statePtr &&
		    (irPtr = TclFetchIntRep(statePtr, &dictIteratorType))) {
		searchPtr = irPtr->twoPtrValue.ptr1;
		Tcl_DictObjNext(searchPtr, &keyPtr, &valuePtr, &done);
	    } else {
		Tcl_Panic("mis-issued dictNext!");
	    }
	}
    pushDictIteratorResult:
7420
7421
7422
7423
7424
7425
7426





















































































7427
7428
7429
7430
7431
7432
7433

    contextPtr->index = PTR2INT(data[2]);
    contextPtr->skip = PTR2INT(data[3]);
    contextPtr->oPtr->flags |= FILTER_HANDLING;
    return result;
}






















































































/*
 *----------------------------------------------------------------------
 *
 * ExecuteExtendedBinaryMathOp, ExecuteExtendedUnaryMathOp --
 *
 *	These functions do advanced math for binary and unary operators
 *	respectively, so that the main TEBC code does not bear the cost of







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517

    contextPtr->index = PTR2INT(data[2]);
    contextPtr->skip = PTR2INT(data[3]);
    contextPtr->oPtr->flags |= FILTER_HANDLING;
    return result;
}

/*
 * WidePwrSmallExpon --
 *
 * Helper to calculate small powers of integers whose result is wide.
 */
static inline Tcl_WideInt
WidePwrSmallExpon(Tcl_WideInt w1, Tcl_WideInt exponent) {

    Tcl_WideInt wResult;

    wResult = w1 * w1;		/* b**2 */
    switch (exponent) {
    case 2:
	break;
    case 3:
	wResult *= w1;		/* b**3 */
	break;
    case 4:
	wResult *= wResult;	/* b**4 */
	break;
    case 5:
	wResult *= wResult;	/* b**4 */
	wResult *= w1;		/* b**5 */
	break;
    case 6:
	wResult *= w1;		/* b**3 */
	wResult *= wResult;	/* b**6 */
	break;
    case 7:
	wResult *= w1;		/* b**3 */
	wResult *= wResult;	/* b**6 */
	wResult *= w1;		/* b**7 */
	break;
    case 8:
	wResult *= wResult;	/* b**4 */
	wResult *= wResult;	/* b**8 */
	break;
    case 9:
	wResult *= wResult;	/* b**4 */
	wResult *= wResult;	/* b**8 */
	wResult *= w1;		/* b**9 */
	break;
    case 10:
	wResult *= wResult;	/* b**4 */
	wResult *= w1;		/* b**5 */
	wResult *= wResult;	/* b**10 */
	break;
    case 11:
	wResult *= wResult;	/* b**4 */
	wResult *= w1;		/* b**5 */
	wResult *= wResult;	/* b**10 */
	wResult *= w1;		/* b**11 */
	break;
    case 12:
	wResult *= w1;		/* b**3 */
	wResult *= wResult;	/* b**6 */
	wResult *= wResult;	/* b**12 */
	break;
    case 13:
	wResult *= w1;		/* b**3 */
	wResult *= wResult;	/* b**6 */
	wResult *= wResult;	/* b**12 */
	wResult *= w1;		/* b**13 */
	break;
    case 14:
	wResult *= w1;		/* b**3 */
	wResult *= wResult;	/* b**6 */
	wResult *= w1;		/* b**7 */
	wResult *= wResult;	/* b**14 */
	break;
    case 15:
	wResult *= w1;		/* b**3 */
	wResult *= wResult;	/* b**6 */
	wResult *= w1;		/* b**7 */
	wResult *= wResult;	/* b**14 */
	wResult *= w1;		/* b**15 */
	break;
    case 16:
	wResult *= wResult;	/* b**4 */
	wResult *= wResult;	/* b**8 */
	wResult *= wResult;	/* b**16 */
	break;
    }
    return wResult;
}
/*
 *----------------------------------------------------------------------
 *
 * ExecuteExtendedBinaryMathOp, ExecuteExtendedUnaryMathOp --
 *
 *	These functions do advanced math for binary and unary operators
 *	respectively, so that the main TEBC code does not bear the cost of
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496

    int type1, type2;
    ClientData ptr1, ptr2;
    double d1, d2, dResult;
    Tcl_WideInt w1, w2, wResult;
    mp_int big1, big2, bigResult, bigRemainder;
    Tcl_Obj *objResultPtr;
    int invalid, numPos, zero;
    long shift;

    (void) GetNumberFromObj(NULL, valuePtr, &ptr1, &type1);
    (void) GetNumberFromObj(NULL, value2Ptr, &ptr2, &type2);

    switch (opcode) {
    case INST_MOD:







|







7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580

    int type1, type2;
    ClientData ptr1, ptr2;
    double d1, d2, dResult;
    Tcl_WideInt w1, w2, wResult;
    mp_int big1, big2, bigResult, bigRemainder;
    Tcl_Obj *objResultPtr;
    int invalid, zero;
    long shift;

    (void) GetNumberFromObj(NULL, valuePtr, &ptr1, &type1);
    (void) GetNumberFromObj(NULL, value2Ptr, &ptr2, &type2);

    switch (opcode) {
    case INST_MOD:
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
	    if (w1 == 0) {
		/*
		 * 0 % (non-zero) always yields remainder of 0.
		 */

		return constants[0];
	    }
	    if (type2 != TCL_NUMBER_BIG) {
		Tcl_WideInt wQuotient, wRemainder;
		Tcl_GetWideIntFromObj(NULL, value2Ptr, &w2);
		wQuotient = w1 / w2;

		/*
		 * Force Tcl's integer division rules.
		 * TODO: examine for logic simplification
		 */








|

|







7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
	    if (w1 == 0) {
		/*
		 * 0 % (non-zero) always yields remainder of 0.
		 */

		return constants[0];
	    }
	    if (type2 == TCL_NUMBER_INT) {
		Tcl_WideInt wQuotient, wRemainder;
		w2 = *((const Tcl_WideInt *)ptr2);
		wQuotient = w1 / w2;

		/*
		 * Force Tcl's integer division rules.
		 * TODO: examine for logic simplification
		 */

7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
	    }
	    shift = (int)(*((const Tcl_WideInt *)ptr2));

	    /*
	     * Handle shifts within the native wide range.
	     */

	    if ((type1 != TCL_NUMBER_BIG)
		    && ((size_t)shift < CHAR_BIT*sizeof(Tcl_WideInt))) {
		TclGetWideIntFromObj(NULL, valuePtr, &w1);
		if (!((w1>0 ? w1 : ~w1)
			& -(((Tcl_WideInt)1)
			<< (CHAR_BIT*sizeof(Tcl_WideInt) - 1 - shift)))) {
		    WIDE_RESULT(w1 << shift);
		}
	    }
	} else {







|

|







7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
	    }
	    shift = (int)(*((const Tcl_WideInt *)ptr2));

	    /*
	     * Handle shifts within the native wide range.
	     */

	    if ((type1 == TCL_NUMBER_INT)
		    && ((size_t)shift < CHAR_BIT*sizeof(Tcl_WideInt))) {
		w1 = *((const Tcl_WideInt *)ptr1);
		if (!((w1>0 ? w1 : ~w1)
			& -(((Tcl_WideInt)1)
			<< (CHAR_BIT*sizeof(Tcl_WideInt) - 1 - shift)))) {
		    WIDE_RESULT(w1 << shift);
		}
	    }
	} else {
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896

	Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);

	mp_init(&bigResult);
	if (opcode == INST_LSHIFT) {
	    mp_mul_2d(&big1, shift, &bigResult);
	} else {
	    mp_init(&bigRemainder);
	    mp_div_2d(&big1, shift, &bigResult, &bigRemainder);
	    if (mp_isneg(&bigRemainder)) {
		/*
		 * Convert to Tcl's integer division rules.
		 */

		mp_sub_d(&bigResult, 1, &bigResult);
	    }
	    mp_clear(&bigRemainder);
	}
	mp_clear(&big1);
	BIG_RESULT(&bigResult);
    }

    case INST_BITOR:
    case INST_BITXOR:
    case INST_BITAND:
	if ((type1 == TCL_NUMBER_BIG) || (type2 == TCL_NUMBER_BIG)) {
	    mp_int *First, *Second;

	    Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);
	    Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);

	    /*
	     * Count how many positive arguments we have. If only one of the
	     * arguments is negative, store it in 'Second'.
	     */

	    if (!mp_isneg(&big1)) {
		numPos = 1 + !mp_isneg(&big2);
		First = &big1;
		Second = &big2;
	    } else {
		First = &big2;
		Second = &big1;
		numPos = (!mp_isneg(First));
	    }
	    mp_init(&bigResult);

	    switch (opcode) {
	    case INST_BITAND:
		switch (numPos) {
		case 2:
		    /*
		     * Both arguments positive, base case.
		     */

		    mp_and(First, Second, &bigResult);
		    break;
		case 1:
		    /*
		     * First is positive; second negative:
		     * P & N = P & ~~N = P&~(-N-1) = P & (P ^ (-N-1))
		     */

		    mp_neg(Second, Second);
		    mp_sub_d(Second, 1, Second);
		    mp_xor(First, Second, &bigResult);
		    mp_and(First, &bigResult, &bigResult);
		    break;
		case 0:
		    /*
		     * Both arguments negative:
		     * a & b = ~ (~a | ~b) = -(-a-1|-b-1)-1
		     */

		    mp_neg(First, First);
		    mp_sub_d(First, 1, First);
		    mp_neg(Second, Second);
		    mp_sub_d(Second, 1, Second);
		    mp_or(First, Second, &bigResult);
		    mp_neg(&bigResult, &bigResult);
		    mp_sub_d(&bigResult, 1, &bigResult);
		    break;
		}
		break;

	    case INST_BITOR:
		switch (numPos) {
		case 2:
		    /*
		     * Both arguments positive, base case.
		     */

		    mp_or(First, Second, &bigResult);
		    break;
		case 1:
		    /*
		     * First is positive; second negative:
		     * N|P = ~(~N&~P) = ~((-N-1)&~P) = -((-N-1)&((-N-1)^P))-1
		     */

		    mp_neg(Second, Second);
		    mp_sub_d(Second, 1, Second);
		    mp_xor(First, Second, &bigResult);
		    mp_and(Second, &bigResult, &bigResult);
		    mp_neg(&bigResult, &bigResult);
		    mp_sub_d(&bigResult, 1, &bigResult);
		    break;
		case 0:
		    /*
		     * Both arguments negative:
		     * a | b = ~ (~a & ~b) = -(-a-1&-b-1)-1
		     */

		    mp_neg(First, First);
		    mp_sub_d(First, 1, First);
		    mp_neg(Second, Second);
		    mp_sub_d(Second, 1, Second);
		    mp_and(First, Second, &bigResult);
		    mp_neg(&bigResult, &bigResult);
		    mp_sub_d(&bigResult, 1, &bigResult);
		    break;
		}
		break;

	    case INST_BITXOR:
		switch (numPos) {
		case 2:
		    /*
		     * Both arguments positive, base case.
		     */

		    mp_xor(First, Second, &bigResult);
		    break;
		case 1:
		    /*
		     * First is positive; second negative:
		     * P^N = ~(P^~N) = -(P^(-N-1))-1
		     */

		    mp_neg(Second, Second);
		    mp_sub_d(Second, 1, Second);
		    mp_xor(First, Second, &bigResult);
		    mp_neg(&bigResult, &bigResult);
		    mp_sub_d(&bigResult, 1, &bigResult);
		    break;
		case 0:
		    /*
		     * Both arguments negative:
		     * a ^ b = (~a ^ ~b) = (-a-1^-b-1)
		     */

		    mp_neg(First, First);
		    mp_sub_d(First, 1, First);
		    mp_neg(Second, Second);
		    mp_sub_d(Second, 1, Second);
		    mp_xor(First, Second, &bigResult);
		    break;
		}
		break;
	    }

	    mp_clear(&big1);
	    mp_clear(&big2);
	    BIG_RESULT(&bigResult);
	}

	if ((type1 == TCL_NUMBER_INT) || (type2 == TCL_NUMBER_INT)) {
	    TclGetWideIntFromObj(NULL, valuePtr, &w1);
	    TclGetWideIntFromObj(NULL, value2Ptr, &w2);

	    switch (opcode) {
	    case INST_BITAND:
		wResult = w1 & w2;
		break;
	    case INST_BITOR:
		wResult = w1 | w2;
		break;
	    case INST_BITXOR:
		wResult = w1 ^ w2;
		break;
	    default:
		/* Unused, here to silence compiler warning. */
		wResult = 0;
	    }
	    WIDE_RESULT(wResult);
	}
	w1 = *((const Tcl_WideInt *)ptr1);
	w2 = *((const Tcl_WideInt *)ptr2);

	switch (opcode) {
	case INST_BITAND:
	    wResult = w1 & w2;
	    break;







<
|
<
<
<
<
<
<
<
<








<
<
|



<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
|
|
<
<

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<



<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<








<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







7788
7789
7790
7791
7792
7793
7794

7795








7796
7797
7798
7799
7800
7801
7802
7803


7804
7805
7806
7807














7808
7809
7810
7811






























7812

7813
7814


7815


















7816

















7817
7818
7819

















7820















7821
7822
7823
7824
7825
7826
7827
7828




















7829
7830
7831
7832
7833
7834
7835

	Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);

	mp_init(&bigResult);
	if (opcode == INST_LSHIFT) {
	    mp_mul_2d(&big1, shift, &bigResult);
	} else {

	    mp_tc_div_2d(&big1, shift, &bigResult);








	}
	mp_clear(&big1);
	BIG_RESULT(&bigResult);
    }

    case INST_BITOR:
    case INST_BITXOR:
    case INST_BITAND:


	if ((type1 != TCL_NUMBER_INT) || (type2 != TCL_NUMBER_INT)) {
	    Tcl_TakeBignumFromObj(NULL, valuePtr, &big1);
	    Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);















	    mp_init(&bigResult);

	    switch (opcode) {
	    case INST_BITAND:






























		mp_tc_and(&big1, &big2, &bigResult);

		break;



	    case INST_BITOR:


















		mp_tc_or(&big1, &big2, &bigResult);

















		break;

	    case INST_BITXOR:

















		mp_tc_xor(&big1, &big2, &bigResult);















		break;
	    }

	    mp_clear(&big1);
	    mp_clear(&big2);
	    BIG_RESULT(&bigResult);
	}





















	w1 = *((const Tcl_WideInt *)ptr1);
	w2 = *((const Tcl_WideInt *)ptr2);

	switch (opcode) {
	case INST_BITAND:
	    wResult = w1 & w2;
	    break;
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980


7981
7982
7983
7984
7985
7986
7987
7988
7989
7990



7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026

8027

8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142

	    if (d1==0.0 && d2<0.0) {
		return EXPONENT_OF_ZERO;
	    }
	    dResult = pow(d1, d2);
	    goto doubleResult;
	}
	w2 = 0;
	if (type2 == TCL_NUMBER_INT) {
	    w2 = *((const Tcl_WideInt *) ptr2);
	    if (w2 == 0) {
		/*
		 * Anything to the zero power is 1.
		 */

		return constants[1];
	    } else if (w2 == 1) {
		/*
		 * Anything to the first power is itself
		 */

		return NULL;
	    }
	}

	switch (type2) {
	case TCL_NUMBER_INT:
	    w2 = *((const Tcl_WideInt *)ptr2);
	    negativeExponent = (w2 < 0);
	    oddExponent = (int) (w2 & (Tcl_WideInt)1);
	    break;
	case TCL_NUMBER_BIG:
	    Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
	    negativeExponent = mp_isneg(&big2);
	    mp_mod_2d(&big2, 1, &big2);
	    oddExponent = !mp_iszero(&big2);
	    mp_clear(&big2);
	    break;
	}

	if (type1 == TCL_NUMBER_INT) {
	    w1 = *((const Tcl_WideInt *)ptr1);
	}
	if (negativeExponent) {
	    if (type1 == TCL_NUMBER_INT) {
		switch (w1) {
		case 0:
		    /*
		     * Zero to a negative power is div by zero error.
		     */

		    return EXPONENT_OF_ZERO;
		case -1:
		    if (oddExponent) {
			WIDE_RESULT(-1);
		    }
		    /* fallthrough */
		case 1:
		    /*
		     * 1 to any power is 1.
		     */

		    return constants[1];
		}
	    }



	    /*
	     * Integers with magnitude greater than 1 raise to a negative
	     * power yield the answer zero (see TIP 123).
	     */

	    return constants[0];
	}

	if (type1 == TCL_NUMBER_INT) {



	    switch (w1) {
	    case 0:
		/*
		 * Zero to a positive power is zero.
		 */

		return constants[0];
	    case 1:
		/*
		 * 1 to any power is 1.
		 */

		return constants[1];
	    case -1:
		if (!oddExponent) {
		    return constants[1];
		}
		WIDE_RESULT(-1);
	    }
	}

	/*
	 * We refuse to accept exponent arguments that exceed one mp_digit
	 * which means the max exponent value is 2**28-1 = 0x0fffffff =
	 * 268435455, which fits into a signed 32 bit int which is within the
	 * range of the long int type. This means any numeric Tcl_Obj value
	 * not using TCL_NUMBER_INT type must hold a value larger than we
	 * accept.
	 */

	if (type2 != TCL_NUMBER_INT) {
	    Tcl_SetObjResult(interp, Tcl_NewStringObj(
		    "exponent too large", -1));
	    return GENERAL_ARITHMETIC_ERROR;
	}


	if (type1 == TCL_NUMBER_INT) {

	    if (w1 == 2) {
		/*
		 * Reduce small powers of 2 to shifts.
		 */

		if ((Tcl_WideUInt) w2 < (Tcl_WideUInt) CHAR_BIT*sizeof(Tcl_WideInt) - 1) {
		    WIDE_RESULT(((Tcl_WideInt) 1) << (int)w2);
		}
		goto overflowExpon;
	    }
	    if (w1 == -2) {
		int signum = oddExponent ? -1 : 1;

		/*
		 * Reduce small powers of 2 to shifts.
		 */

		if ((Tcl_WideUInt)w2 < CHAR_BIT*sizeof(Tcl_WideInt) - 1){
		    WIDE_RESULT(signum * (((Tcl_WideInt) 1) << (int) w2));
		}
		goto overflowExpon;
	    }
	}
	if (type1 == TCL_NUMBER_INT) {
	    w1 = *((const Tcl_WideInt *) ptr1);
	} else {
	    goto overflowExpon;
	}
	if (w2 - 2 < (long)MaxBase64Size
		&& w1 <=  MaxBase64[w2 - 2]
		&& w1 >= -MaxBase64[w2 - 2]) {
	    /*
	     * Small powers of integers whose result is wide.
	     */

	    wResult = w1 * w1;		/* b**2 */
	    switch (w2) {
	    case 2:
		break;
	    case 3:
		wResult *= w1;		/* b**3 */
		break;
	    case 4:
		wResult *= wResult;	/* b**4 */
		break;
	    case 5:
		wResult *= wResult;	/* b**4 */
		wResult *= w1;		/* b**5 */
		break;
	    case 6:
		wResult *= w1;		/* b**3 */
		wResult *= wResult;	/* b**6 */
		break;
	    case 7:
		wResult *= w1;		/* b**3 */
		wResult *= wResult;	/* b**6 */
		wResult *= w1;		/* b**7 */
		break;
	    case 8:
		wResult *= wResult;	/* b**4 */
		wResult *= wResult;	/* b**8 */
		break;
	    case 9:
		wResult *= wResult;	/* b**4 */
		wResult *= wResult;	/* b**8 */
		wResult *= w1;		/* b**9 */
		break;
	    case 10:
		wResult *= wResult;	/* b**4 */
		wResult *= w1;		/* b**5 */
		wResult *= wResult;	/* b**10 */
		break;
	    case 11:
		wResult *= wResult;	/* b**4 */
		wResult *= w1;		/* b**5 */
		wResult *= wResult;	/* b**10 */
		wResult *= w1;		/* b**11 */
		break;
	    case 12:
		wResult *= w1;		/* b**3 */
		wResult *= wResult;	/* b**6 */
		wResult *= wResult;	/* b**12 */
		break;
	    case 13:
		wResult *= w1;		/* b**3 */
		wResult *= wResult;	/* b**6 */
		wResult *= wResult;	/* b**12 */
		wResult *= w1;		/* b**13 */
		break;
	    case 14:
		wResult *= w1;		/* b**3 */
		wResult *= wResult;	/* b**6 */
		wResult *= w1;		/* b**7 */
		wResult *= wResult;	/* b**14 */
		break;
	    case 15:
		wResult *= w1;		/* b**3 */
		wResult *= wResult;	/* b**6 */
		wResult *= w1;		/* b**7 */
		wResult *= wResult;	/* b**14 */
		wResult *= w1;		/* b**15 */
		break;
	    case 16:
		wResult *= wResult;	/* b**4 */
		wResult *= wResult;	/* b**8 */
		wResult *= wResult;	/* b**16 */
		break;
	    }
	    WIDE_RESULT(wResult);
	}

	/*
	 * Handle cases of powers > 16 that still fit in a 64-bit word by
	 * doing table lookup.
	 */







|















|
<
<
<
<


<
|





<




|
|
<




















>
>





<



|
>
>
>
|

















<

















>
|
>
|
|
|
|

|
|
|
|
|
|
|

|
|
|

|
|
|
<
<
<
<
<
<








|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|







7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878




7879
7880

7881
7882
7883
7884
7885
7886

7887
7888
7889
7890
7891
7892

7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919

7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944

7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984






7985
7986
7987
7988
7989
7990
7991
7992
7993








































































7994
7995
7996
7997
7998
7999
8000
8001

	    if (d1==0.0 && d2<0.0) {
		return EXPONENT_OF_ZERO;
	    }
	    dResult = pow(d1, d2);
	    goto doubleResult;
	}
	w1 = w2 = 0; /* to silence compiler warning (maybe-uninitialized) */
	if (type2 == TCL_NUMBER_INT) {
	    w2 = *((const Tcl_WideInt *) ptr2);
	    if (w2 == 0) {
		/*
		 * Anything to the zero power is 1.
		 */

		return constants[1];
	    } else if (w2 == 1) {
		/*
		 * Anything to the first power is itself
		 */

		return NULL;
	    }





	    negativeExponent = (w2 < 0);
	    oddExponent = (int) (w2 & (Tcl_WideInt)1);

	} else {
	    Tcl_TakeBignumFromObj(NULL, value2Ptr, &big2);
	    negativeExponent = mp_isneg(&big2);
	    mp_mod_2d(&big2, 1, &big2);
	    oddExponent = !mp_iszero(&big2);
	    mp_clear(&big2);

	}

	if (type1 == TCL_NUMBER_INT) {
	    w1 = *((const Tcl_WideInt *)ptr1);

	    if (negativeExponent) {

		switch (w1) {
		case 0:
		    /*
		     * Zero to a negative power is div by zero error.
		     */

		    return EXPONENT_OF_ZERO;
		case -1:
		    if (oddExponent) {
			WIDE_RESULT(-1);
		    }
		    /* fallthrough */
		case 1:
		    /*
		     * 1 to any power is 1.
		     */

		    return constants[1];
		}
	    }
	}
	if (negativeExponent) {

	    /*
	     * Integers with magnitude greater than 1 raise to a negative
	     * power yield the answer zero (see TIP 123).
	     */

	    return constants[0];
	}

	if (type1 != TCL_NUMBER_INT) {
	    goto overflowExpon;
	}

	switch (w1) {
	    case 0:
		/*
		 * Zero to a positive power is zero.
		 */

		return constants[0];
	    case 1:
		/*
		 * 1 to any power is 1.
		 */

		return constants[1];
	    case -1:
		if (!oddExponent) {
		    return constants[1];
		}
		WIDE_RESULT(-1);

	}

	/*
	 * We refuse to accept exponent arguments that exceed one mp_digit
	 * which means the max exponent value is 2**28-1 = 0x0fffffff =
	 * 268435455, which fits into a signed 32 bit int which is within the
	 * range of the long int type. This means any numeric Tcl_Obj value
	 * not using TCL_NUMBER_INT type must hold a value larger than we
	 * accept.
	 */

	if (type2 != TCL_NUMBER_INT) {
	    Tcl_SetObjResult(interp, Tcl_NewStringObj(
		    "exponent too large", -1));
	    return GENERAL_ARITHMETIC_ERROR;
	}

	/* From here (up to overflowExpon) w1 and exponent w2 are wide-int's. */
	assert(type1 == TCL_NUMBER_INT && type2 == TCL_NUMBER_INT);

	if (w1 == 2) {
	    /*
	     * Reduce small powers of 2 to shifts.
	     */

	    if ((Tcl_WideUInt) w2 < (Tcl_WideUInt) CHAR_BIT*sizeof(Tcl_WideInt) - 1) {
		WIDE_RESULT(((Tcl_WideInt) 1) << (int)w2);
	    }
	    goto overflowExpon;
	}
	if (w1 == -2) {
	    int signum = oddExponent ? -1 : 1;

	    /*
	     * Reduce small powers of 2 to shifts.
	     */

	    if ((Tcl_WideUInt)w2 < CHAR_BIT*sizeof(Tcl_WideInt) - 1){
		WIDE_RESULT(signum * (((Tcl_WideInt) 1) << (int) w2));
	    }






	    goto overflowExpon;
	}
	if (w2 - 2 < (long)MaxBase64Size
		&& w1 <=  MaxBase64[w2 - 2]
		&& w1 >= -MaxBase64[w2 - 2]) {
	    /*
	     * Small powers of integers whose result is wide.
	     */
	    wResult = WidePwrSmallExpon(w1, w2);









































































	    WIDE_RESULT(wResult);
	}

	/*
	 * Handle cases of powers > 16 that still fit in a 64-bit word by
	 * doing table lookup.
	 */
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
	    if (TclIsNaN(dResult)) {
		TclExprFloatError(interp, dResult);
		return GENERAL_ARITHMETIC_ERROR;
	    }
#endif
	    DOUBLE_RESULT(dResult);
	}
	if ((type1 != TCL_NUMBER_BIG) && (type2 != TCL_NUMBER_BIG)) {
	    TclGetWideIntFromObj(NULL, valuePtr, &w1);
	    TclGetWideIntFromObj(NULL, value2Ptr, &w2);

	    switch (opcode) {
	    case INST_ADD:
		wResult = w1 + w2;
		if ((type1 == TCL_NUMBER_INT) || (type2 == TCL_NUMBER_INT))
		{
		    /*







|
|
|







8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
	    if (TclIsNaN(dResult)) {
		TclExprFloatError(interp, dResult);
		return GENERAL_ARITHMETIC_ERROR;
	    }
#endif
	    DOUBLE_RESULT(dResult);
	}
	if ((type1 == TCL_NUMBER_INT) && (type2 == TCL_NUMBER_INT)) {
	    w1 = *((const Tcl_WideInt *)ptr1);
	    w2 = *((const Tcl_WideInt *)ptr2);

	    switch (opcode) {
	    case INST_ADD:
		wResult = w1 + w2;
		if ((type1 == TCL_NUMBER_INT) || (type2 == TCL_NUMBER_INT))
		{
		    /*
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
    ByteCode *codePtr)	/* The bytecode whose summary is printed to
				 * stdout. */
{
    Proc *procPtr = codePtr->procPtr;
    Interp *iPtr = (Interp *) *codePtr->interpHandle;

    fprintf(stdout, "\nExecuting ByteCode 0x%p, refCt %" TCL_Z_MODIFIER "u, epoch %" TCL_Z_MODIFIER "u, interp 0x%p (epoch %" TCL_Z_MODIFIER "u)\n",
	    codePtr, (size_t)codePtr->refCount, codePtr->compileEpoch, iPtr,
	    iPtr->compileEpoch);
    fprintf(stdout, "  Source: ");
    TclPrintSource(stdout, codePtr->source, 60);

    fprintf(stdout, "\n  Cmds %d, src %d, inst %u, litObjs %u, aux %d, stkDepth %u, code/src %.2f\n",
	    codePtr->numCommands, codePtr->numSrcBytes,
	    codePtr->numCodeBytes, codePtr->numLitObjects,







|







8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
    ByteCode *codePtr)	/* The bytecode whose summary is printed to
				 * stdout. */
{
    Proc *procPtr = codePtr->procPtr;
    Interp *iPtr = (Interp *) *codePtr->interpHandle;

    fprintf(stdout, "\nExecuting ByteCode 0x%p, refCt %" TCL_Z_MODIFIER "u, epoch %" TCL_Z_MODIFIER "u, interp 0x%p (epoch %" TCL_Z_MODIFIER "u)\n",
	    codePtr, codePtr->refCount, codePtr->compileEpoch, iPtr,
	    iPtr->compileEpoch);
    fprintf(stdout, "  Source: ");
    TclPrintSource(stdout, codePtr->source, 60);

    fprintf(stdout, "\n  Cmds %d, src %d, inst %u, litObjs %u, aux %d, stkDepth %u, code/src %.2f\n",
	    codePtr->numCommands, codePtr->numSrcBytes,
	    codePtr->numCodeBytes, codePtr->numLitObjects,
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
    } else {
	/* TODO: No caller needs this. Eliminate? */
	description = "(big) integer";
    }

    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
	    "can't use %s \"%s\" as operand of \"%s\"", description,
	    Tcl_GetString(opndPtr), operator));
    Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", description, NULL);
}

/*
 *----------------------------------------------------------------------
 *
 * TclGetSrcInfoForPc, GetSrcInfoForPc, TclGetSourceFromFrame --







|







8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
    } else {
	/* TODO: No caller needs this. Eliminate? */
	description = "(big) integer";
    }

    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
	    "can't use %s \"%s\" as operand of \"%s\"", description,
	    TclGetString(opndPtr), operator));
    Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", description, NULL);
}

/*
 *----------------------------------------------------------------------
 *
 * TclGetSrcInfoForPc, GetSrcInfoForPc, TclGetSourceFromFrame --
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
    objBytesIfUnshared = 0.0;
    strBytesIfUnshared = 0.0;
    strBytesSharedMultX = 0.0;
    strBytesSharedOnce = 0.0;
    for (i = 0;  i < globalTablePtr->numBuckets;  i++) {
	for (entryPtr = globalTablePtr->buckets[i];  entryPtr != NULL;
		entryPtr = entryPtr->nextPtr) {
	    if (NULL != Tcl_FetchIntRep(entryPtr->objPtr, &tclByteCodeType)) {
		numByteCodeLits++;
	    }
	    (void) TclGetStringFromObj(entryPtr->objPtr, &length);
	    refCountSum += entryPtr->refCount;
	    objBytesIfUnshared += (entryPtr->refCount * sizeof(Tcl_Obj));
	    strBytesIfUnshared += (entryPtr->refCount * (length+1));
	    if (entryPtr->refCount > 1) {







|







9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
    objBytesIfUnshared = 0.0;
    strBytesIfUnshared = 0.0;
    strBytesSharedMultX = 0.0;
    strBytesSharedOnce = 0.0;
    for (i = 0;  i < globalTablePtr->numBuckets;  i++) {
	for (entryPtr = globalTablePtr->buckets[i];  entryPtr != NULL;
		entryPtr = entryPtr->nextPtr) {
	    if (entryPtr->objPtr->typePtr == &tclByteCodeType) {
		numByteCodeLits++;
	    }
	    (void) TclGetStringFromObj(entryPtr->objPtr, &length);
	    refCountSum += entryPtr->refCount;
	    objBytesIfUnshared += (entryPtr->refCount * sizeof(Tcl_Obj));
	    strBytesIfUnshared += (entryPtr->refCount * (length+1));
	    if (entryPtr->refCount > 1) {
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
	} else {
	    Tcl_AppendPrintfToObj(objPtr, "0\n");
	}
    }

#ifdef TCL_MEM_DEBUG
    Tcl_AppendPrintfToObj(objPtr, "\nHeap Statistics:\n");
    TclDumpMemoryInfo((ClientData) objPtr, 1);
#endif
    Tcl_AppendPrintfToObj(objPtr, "\n----------------------------------------------------------------\n");

    if (objc == 1) {
	Tcl_SetObjResult(interp, objPtr);
    } else {
	Tcl_Channel outChan;







|







9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
	} else {
	    Tcl_AppendPrintfToObj(objPtr, "0\n");
	}
    }

#ifdef TCL_MEM_DEBUG
    Tcl_AppendPrintfToObj(objPtr, "\nHeap Statistics:\n");
    TclDumpMemoryInfo(objPtr, 1);
#endif
    Tcl_AppendPrintfToObj(objPtr, "\n----------------------------------------------------------------\n");

    if (objc == 1) {
	Tcl_SetObjResult(interp, objPtr);
    } else {
	Tcl_Channel outChan;
Changes to generic/tclFileName.c.
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517

    /*
     * Perform platform specific splitting.
     */

    switch (tclPlatform) {
    case TCL_PLATFORM_UNIX:
	resultPtr = SplitUnixPath(Tcl_GetString(pathPtr));
	break;

    case TCL_PLATFORM_WINDOWS:
	resultPtr = SplitWinPath(Tcl_GetString(pathPtr));
	break;
    }

    /*
     * Compute the number of elements in the result.
     */








|



|







499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517

    /*
     * Perform platform specific splitting.
     */

    switch (tclPlatform) {
    case TCL_PLATFORM_UNIX:
	resultPtr = SplitUnixPath(TclGetString(pathPtr));
	break;

    case TCL_PLATFORM_WINDOWS:
	resultPtr = SplitWinPath(TclGetString(pathPtr));
	break;
    }

    /*
     * Compute the number of elements in the result.
     */

594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
     * list in, piece by piece.
     */

    p = (char *) &(*argvPtr)[(*argcPtr) + 1];
    for (i = 0; i < *argcPtr; i++) {
	Tcl_ListObjIndex(NULL, resultPtr, i, &eltPtr);
	str = TclGetStringFromObj(eltPtr, &len);
	memcpy(p, str, (size_t) len+1);
	p += len+1;
    }

    /*
     * Now set up the argv pointers.
     */








|







594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
     * list in, piece by piece.
     */

    p = (char *) &(*argvPtr)[(*argcPtr) + 1];
    for (i = 0; i < *argcPtr; i++) {
	Tcl_ListObjIndex(NULL, resultPtr, i, &eltPtr);
	str = TclGetStringFromObj(eltPtr, &len);
	memcpy(p, str, len+1);
	p += len+1;
    }

    /*
     * Now set up the argv pointers.
     */

892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955

	/*
	 * Append the element, eliminating duplicate and trailing slashes.
	 */

	Tcl_SetObjLength(prefix, length + (int) strlen(p));

	dest = Tcl_GetString(prefix) + length;
	for (; *p != '\0'; p++) {
	    if (*p == '/') {
		while (p[1] == '/') {
		    p++;
		}
		if (p[1] != '\0' && needsSep) {
		    *dest++ = '/';
		}
	    } else {
		*dest++ = *p;
		needsSep = 1;
	    }
	}
	length = dest - Tcl_GetString(prefix);
	Tcl_SetObjLength(prefix, length);
	break;

    case TCL_PLATFORM_WINDOWS:
	/*
	 * Check to see if we need to append a separator.
	 */

	if ((length > 0) &&
		(start[length-1] != '/') && (start[length-1] != ':')) {
	    Tcl_AppendToObj(prefix, "/", 1);
	    (void)TclGetStringFromObj(prefix, &length);
	}
	needsSep = 0;

	/*
	 * Append the element, eliminating duplicate and trailing slashes.
	 */

	Tcl_SetObjLength(prefix, length + (int) strlen(p));
	dest = Tcl_GetString(prefix) + length;
	for (; *p != '\0'; p++) {
	    if ((*p == '/') || (*p == '\\')) {
		while ((p[1] == '/') || (p[1] == '\\')) {
		    p++;
		}
		if ((p[1] != '\0') && needsSep) {
		    *dest++ = '/';
		}
	    } else {
		*dest++ = *p;
		needsSep = 1;
	    }
	}
	length = dest - Tcl_GetString(prefix);
	Tcl_SetObjLength(prefix, length);
	break;
    }
    return;
}

/*







|













|




















|













|







892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955

	/*
	 * Append the element, eliminating duplicate and trailing slashes.
	 */

	Tcl_SetObjLength(prefix, length + (int) strlen(p));

	dest = TclGetString(prefix) + length;
	for (; *p != '\0'; p++) {
	    if (*p == '/') {
		while (p[1] == '/') {
		    p++;
		}
		if (p[1] != '\0' && needsSep) {
		    *dest++ = '/';
		}
	    } else {
		*dest++ = *p;
		needsSep = 1;
	    }
	}
	length = dest - TclGetString(prefix);
	Tcl_SetObjLength(prefix, length);
	break;

    case TCL_PLATFORM_WINDOWS:
	/*
	 * Check to see if we need to append a separator.
	 */

	if ((length > 0) &&
		(start[length-1] != '/') && (start[length-1] != ':')) {
	    Tcl_AppendToObj(prefix, "/", 1);
	    (void)TclGetStringFromObj(prefix, &length);
	}
	needsSep = 0;

	/*
	 * Append the element, eliminating duplicate and trailing slashes.
	 */

	Tcl_SetObjLength(prefix, length + (int) strlen(p));
	dest = TclGetString(prefix) + length;
	for (; *p != '\0'; p++) {
	    if ((*p == '/') || (*p == '\\')) {
		while ((p[1] == '/') || (p[1] == '\\')) {
		    p++;
		}
		if ((p[1] != '\0') && needsSep) {
		    *dest++ = '/';
		}
	    } else {
		*dest++ = *p;
		needsSep = 1;
	    }
	}
	length = dest - TclGetString(prefix);
	Tcl_SetObjLength(prefix, length);
	break;
    }
    return;
}

/*
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
		/*
		 * We must ensure that we haven't cut off too much, and turned
		 * a valid path like '/' or 'C:/' into an incorrect path like
		 * '' or 'C:'. The way we do this is to add a separator if
		 * there are none presently in the prefix.
		 */

		if (strpbrk(Tcl_GetString(pathOrDir), "\\/") == NULL) {
		    Tcl_AppendToObj(pathOrDir, last-1, 1);
		}
	    }

	    /*
	     * Need to quote 'prefix'.
	     */







|







1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
		/*
		 * We must ensure that we haven't cut off too much, and turned
		 * a valid path like '/' or 'C:/' into an incorrect path like
		 * '' or 'C:'. The way we do this is to add a separator if
		 * there are none presently in the prefix.
		 */

		if (strpbrk(TclGetString(pathOrDir), "\\/") == NULL) {
		    Tcl_AppendToObj(pathOrDir, last-1, 1);
		}
	    }

	    /*
	     * Need to quote 'prefix'.
	     */
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
	    } else {
		Tcl_Obj *item;
		int llen;

		if ((Tcl_ListObjLength(NULL, look, &llen) == TCL_OK)
			&& (llen == 3)) {
		    Tcl_ListObjIndex(interp, look, 0, &item);
		    if (!strcmp("macintosh", Tcl_GetString(item))) {
			Tcl_ListObjIndex(interp, look, 1, &item);
			if (!strcmp("type", Tcl_GetString(item))) {
			    Tcl_ListObjIndex(interp, look, 2, &item);
			    if (globTypes->macType != NULL) {
				goto badMacTypesArg;
			    }
			    globTypes->macType = item;
			    Tcl_IncrRefCount(item);
			    continue;
			} else if (!strcmp("creator", Tcl_GetString(item))) {
			    Tcl_ListObjIndex(interp, look, 2, &item);
			    if (globTypes->macCreator != NULL) {
				goto badMacTypesArg;
			    }
			    globTypes->macCreator = item;
			    Tcl_IncrRefCount(item);
			    continue;
			}
		    }
		}

		/*
		 * Error cases. We reset the 'join' flag to zero, since we
		 * haven't yet made use of it.
		 */

	    badTypesArg:
		Tcl_SetObjResult(interp, Tcl_ObjPrintf(
			"bad argument to \"-types\": %s",
			Tcl_GetString(look)));
		Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "BAD", NULL);
		result = TCL_ERROR;
		join = 0;
		goto endOfGlob;

	    badMacTypesArg:
		Tcl_SetObjResult(interp, Tcl_NewStringObj(







|

|







|



















|







1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
	    } else {
		Tcl_Obj *item;
		int llen;

		if ((Tcl_ListObjLength(NULL, look, &llen) == TCL_OK)
			&& (llen == 3)) {
		    Tcl_ListObjIndex(interp, look, 0, &item);
		    if (!strcmp("macintosh", TclGetString(item))) {
			Tcl_ListObjIndex(interp, look, 1, &item);
			if (!strcmp("type", TclGetString(item))) {
			    Tcl_ListObjIndex(interp, look, 2, &item);
			    if (globTypes->macType != NULL) {
				goto badMacTypesArg;
			    }
			    globTypes->macType = item;
			    Tcl_IncrRefCount(item);
			    continue;
			} else if (!strcmp("creator", TclGetString(item))) {
			    Tcl_ListObjIndex(interp, look, 2, &item);
			    if (globTypes->macCreator != NULL) {
				goto badMacTypesArg;
			    }
			    globTypes->macCreator = item;
			    Tcl_IncrRefCount(item);
			    continue;
			}
		    }
		}

		/*
		 * Error cases. We reset the 'join' flag to zero, since we
		 * haven't yet made use of it.
		 */

	    badTypesArg:
		Tcl_SetObjResult(interp, Tcl_ObjPrintf(
			"bad argument to \"-types\": %s",
			TclGetString(look)));
		Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "BAD", NULL);
		result = TCL_ERROR;
		join = 0;
		goto endOfGlob;

	    badMacTypesArg:
		Tcl_SetObjResult(interp, Tcl_NewStringObj(
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
		Tcl_DStringFree(&str);
		goto endOfGlob;
	    }
	}
	Tcl_DStringFree(&str);
    } else {
	for (i = 0; i < objc; i++) {
	    string = Tcl_GetString(objv[i]);
	    if (TclGlob(interp, string, pathOrDir, globFlags,
		    globTypes) != TCL_OK) {
		result = TCL_ERROR;
		goto endOfGlob;
	    }
	}
    }







|







1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
		Tcl_DStringFree(&str);
		goto endOfGlob;
	    }
	}
	Tcl_DStringFree(&str);
    } else {
	for (i = 0; i < objc; i++) {
	    string = TclGetString(objv[i]);
	    if (TclGlob(interp, string, pathOrDir, globFlags,
		    globTypes) != TCL_OK) {
		result = TCL_ERROR;
		goto endOfGlob;
	    }
	}
    }
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
	    if (join) {
		Tcl_AppendToObj(errorMsg, Tcl_DStringValue(&prefix), -1);
	    } else {
		const char *sep = "";

		for (i = 0; i < objc; i++) {
		    Tcl_AppendPrintfToObj(errorMsg, "%s%s",
			    sep, Tcl_GetString(objv[i]));
		    sep = " ";
		}
	    }
	    Tcl_AppendToObj(errorMsg, "\"", -1);
	    Tcl_SetObjResult(interp, errorMsg);
	    Tcl_SetErrorCode(interp, "TCL", "OPERATION", "GLOB", "NOMATCH",
		    NULL);







|







1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
	    if (join) {
		Tcl_AppendToObj(errorMsg, Tcl_DStringValue(&prefix), -1);
	    } else {
		const char *sep = "";

		for (i = 0; i < objc; i++) {
		    Tcl_AppendPrintfToObj(errorMsg, "%s%s",
			    sep, TclGetString(objv[i]));
		    sep = " ";
		}
	    }
	    Tcl_AppendToObj(errorMsg, "\"", -1);
	    Tcl_SetObjResult(interp, errorMsg);
	    Tcl_SetErrorCode(interp, "TCL", "OPERATION", "GLOB", "NOMATCH",
		    NULL);
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860

		Tcl_Obj *cwd = Tcl_FSGetCwd(interp);

		if (cwd == NULL) {
		    Tcl_DecrRefCount(temp);
		    return TCL_ERROR;
		}
		pathPrefix = Tcl_NewStringObj(Tcl_GetString(cwd), 3);
		Tcl_DecrRefCount(cwd);
		if (tail[0] == '/') {
		    tail++;
		} else {
		    tail += 2;
		}
		Tcl_IncrRefCount(pathPrefix);







|







1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860

		Tcl_Obj *cwd = Tcl_FSGetCwd(interp);

		if (cwd == NULL) {
		    Tcl_DecrRefCount(temp);
		    return TCL_ERROR;
		}
		pathPrefix = Tcl_NewStringObj(TclGetString(cwd), 3);
		Tcl_DecrRefCount(cwd);
		if (tail[0] == '/') {
		    tail++;
		} else {
		    tail += 2;
		}
		Tcl_IncrRefCount(pathPrefix);
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
	    Tcl_Obj **subdirv;

	    result = Tcl_ListObjGetElements(interp, subdirsPtr,
		    &subdirc, &subdirv);
	    for (i=0; result==TCL_OK && i<subdirc; i++) {
		Tcl_Obj *copy = NULL;

		if (pathPtr == NULL && Tcl_GetString(subdirv[i])[0] == '~') {
		    Tcl_ListObjLength(NULL, matchesObj, &repair);
		    copy = subdirv[i];
		    subdirv[i] = Tcl_NewStringObj("./", 2);
		    Tcl_AppendObjToObj(subdirv[i], copy);
		    Tcl_IncrRefCount(subdirv[i]);
		}
		result = DoGlob(interp, matchesObj, separators, subdirv[i],







|







2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
	    Tcl_Obj **subdirv;

	    result = Tcl_ListObjGetElements(interp, subdirsPtr,
		    &subdirc, &subdirv);
	    for (i=0; result==TCL_OK && i<subdirc; i++) {
		Tcl_Obj *copy = NULL;

		if (pathPtr == NULL && TclGetString(subdirv[i])[0] == '~') {
		    Tcl_ListObjLength(NULL, matchesObj, &repair);
		    copy = subdirv[i];
		    subdirv[i] = Tcl_NewStringObj("./", 2);
		    Tcl_AppendObjToObj(subdirv[i], copy);
		    Tcl_IncrRefCount(subdirv[i]);
		}
		result = DoGlob(interp, matchesObj, separators, subdirv[i],
Changes to generic/tclIO.c.
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
	ir.twoPtrValue.ptr2 = NULL;					\
	Tcl_StoreIntRep((objPtr), &chanObjType, &ir);			\
    } while (0)

#define ChanGetIntRep(objPtr, resPtr)					\
    do {								\
	const Tcl_ObjIntRep *irPtr;					\
	irPtr = Tcl_FetchIntRep((objPtr), &chanObjType);		\
	(resPtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL;		\
    } while (0)

#define BUSY_STATE(st, fl) \
     ((((st)->csPtrR) && ((fl) & TCL_READABLE)) || \
      (((st)->csPtrW) && ((fl) & TCL_WRITABLE)))








|







345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
	ir.twoPtrValue.ptr2 = NULL;					\
	Tcl_StoreIntRep((objPtr), &chanObjType, &ir);			\
    } while (0)

#define ChanGetIntRep(objPtr, resPtr)					\
    do {								\
	const Tcl_ObjIntRep *irPtr;					\
	irPtr = TclFetchIntRep((objPtr), &chanObjType);		\
	(resPtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL;		\
    } while (0)

#define BUSY_STATE(st, fl) \
     ((((st)->csPtrR) && ((fl) & TCL_READABLE)) || \
      (((st)->csPtrW) && ((fl) & TCL_WRITABLE)))

1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
    }

    if (resPtr && resPtr->refCount == 1) {
	/*
         * Re-use the ResolvedCmdName struct.
         */

	Tcl_Release((ClientData) resPtr->statePtr);
    } else {
	resPtr = (ResolvedChanName *) Tcl_Alloc(sizeof(ResolvedChanName));
	resPtr->refCount = 0;
	ChanSetIntRep(objPtr, resPtr);		/* Overwrites, if needed */
    }
    statePtr = ((Channel *)chan)->state;
    resPtr->statePtr = statePtr;
    Tcl_Preserve((ClientData) statePtr);
    resPtr->interp = interp;
    resPtr->epoch = statePtr->epoch;

  valid:
    *channelPtr = (Tcl_Channel) statePtr->bottomChanPtr;

    if (modePtr != NULL) {







|







|







1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
    }

    if (resPtr && resPtr->refCount == 1) {
	/*
         * Re-use the ResolvedCmdName struct.
         */

	Tcl_Release(resPtr->statePtr);
    } else {
	resPtr = (ResolvedChanName *) Tcl_Alloc(sizeof(ResolvedChanName));
	resPtr->refCount = 0;
	ChanSetIntRep(objPtr, resPtr);		/* Overwrites, if needed */
    }
    statePtr = ((Channel *)chan)->state;
    resPtr->statePtr = statePtr;
    Tcl_Preserve(statePtr);
    resPtr->interp = interp;
    resPtr->epoch = statePtr->epoch;

  valid:
    *channelPtr = (Tcl_Channel) statePtr->bottomChanPtr;

    if (modePtr != NULL) {
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
	}
	if (saved) {
	    /*
	     * Here's some translated bytes left over from the last buffer
	     * that we need to stick at the beginning of this buffer.
	     */

	    memcpy(InsertPoint(bufPtr), safe, (size_t) saved);
	    bufPtr->nextAdded += saved;
	    saved = 0;
	}
	PreserveChannelBuffer(bufPtr);
	dst = InsertPoint(bufPtr);
	dstLen = SpaceLeft(bufPtr);








|







4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
	}
	if (saved) {
	    /*
	     * Here's some translated bytes left over from the last buffer
	     * that we need to stick at the beginning of this buffer.
	     */

	    memcpy(InsertPoint(bufPtr), safe, saved);
	    bufPtr->nextAdded += saved;
	    saved = 0;
	}
	PreserveChannelBuffer(bufPtr);
	dst = InsertPoint(bufPtr);
	dstLen = SpaceLeft(bufPtr);

4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
	     * the translation to produce a character that crossed the end of
	     * the output buffer, so that we would get a completely full
	     * buffer before flushing it. The extra bytes will be moved to the
	     * beginning of the next buffer.
	     */

	    saved = -SpaceLeft(bufPtr);
	    memcpy(safe, dst + dstLen, (size_t) saved);
	    bufPtr->nextAdded = bufPtr->bufLength;
	}

	if ((srcLen + saved == 0) && (result == TCL_OK)) {
	    endEncoding = 0;
	}








|







4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
	     * the translation to produce a character that crossed the end of
	     * the output buffer, so that we would get a completely full
	     * buffer before flushing it. The extra bytes will be moved to the
	     * beginning of the next buffer.
	     */

	    saved = -SpaceLeft(bufPtr);
	    memcpy(safe, dst + dstLen, saved);
	    bufPtr->nextAdded = bufPtr->bufLength;
	}

	if ((srcLen + saved == 0) && (result == TCL_OK)) {
	    endEncoding = 0;
	}

4520
4521
4522
4523
4524
4525
4526
4527

4528
4529
4530
4531
4532
4533
4534
				 * object as UTF-8 characters. */
{
    GetsState gs;
    Channel *chanPtr = (Channel *) chan;
    ChannelState *statePtr = chanPtr->state;
				/* State info for channel */
    ChannelBuffer *bufPtr;
    int inEofChar, skip, copiedTotal, oldLength, oldFlags, oldRemoved;

    Tcl_Encoding encoding;
    char *dst, *dstEnd, *eol, *eof;
    Tcl_EncodingState oldState;

    if (CheckChannelErrors(statePtr, TCL_READABLE) != 0) {
	return TCL_IO_FAILURE;
    }







|
>







4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
				 * object as UTF-8 characters. */
{
    GetsState gs;
    Channel *chanPtr = (Channel *) chan;
    ChannelState *statePtr = chanPtr->state;
				/* State info for channel */
    ChannelBuffer *bufPtr;
    int inEofChar, skip, copiedTotal, oldFlags, oldRemoved;
    size_t oldLength;
    Tcl_Encoding encoding;
    char *dst, *dstEnd, *eol, *eof;
    Tcl_EncodingState oldState;

    if (CheckChannelErrors(statePtr, TCL_READABLE) != 0) {
	return TCL_IO_FAILURE;
    }
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
			    gs.rawRead, statePtr->inputEncodingFlags
				| TCL_ENCODING_NO_TERMINATE, &gs.state, tmp,
			    TCL_UTF_MAX, &rawRead, NULL, NULL);
		    bufPtr->nextRemoved += rawRead;
		    gs.rawRead -= rawRead;
		    gs.bytesWrote--;
		    gs.charsWrote--;
		    memmove(dst, dst + 1, (size_t) (dstEnd - dst));
		    dstEnd--;
		}
	    }
	    for (eol = dst; eol < dstEnd; eol++) {
		if (*eol == '\r') {
		    eol++;
		    if (eol == dstEnd) {







|







4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
			    gs.rawRead, statePtr->inputEncodingFlags
				| TCL_ENCODING_NO_TERMINATE, &gs.state, tmp,
			    TCL_UTF_MAX, &rawRead, NULL, NULL);
		    bufPtr->nextRemoved += rawRead;
		    gs.rawRead -= rawRead;
		    gs.bytesWrote--;
		    gs.charsWrote--;
		    memmove(dst, dst + 1, dstEnd - dst);
		    dstEnd--;
		}
	    }
	    for (eol = dst; eol < dstEnd; eol++) {
		if (*eol == '\r') {
		    eol++;
		    if (eol == dstEnd) {
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
	/*
	 * Copy bytes from the channel buffer to the ByteArray. This may
	 * realloc space, so keep track of result.
	 */

	rawLen = dstEnd - dst;
	byteArray = Tcl_SetByteArrayLength(objPtr, byteLen + rawLen);
	memcpy(byteArray + byteLen, dst, (size_t) rawLen);
	byteLen += rawLen;
    }

    /*
     * Found EOL or EOF, but the output buffer may now contain too many bytes.
     * We need to know how many bytes correspond to the number we want, so we
     * can remove the correct number of bytes from the channel buffer.
     */

  gotEOL:
    if (bufPtr == NULL) {
	Tcl_Panic("TclGetsObjBinary: gotEOL reached with bufPtr==NULL");
    }

    rawLen = eol - dst;
    byteArray = Tcl_SetByteArrayLength(objPtr, byteLen + rawLen);
    memcpy(byteArray + byteLen, dst, (size_t) rawLen);
    byteLen += rawLen;
    bufPtr->nextRemoved += rawLen + skip;

    /*
     * Convert the buffer if there was an encoding.
     * XXX - unimplemented.
     */







|
















|







5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
	/*
	 * Copy bytes from the channel buffer to the ByteArray. This may
	 * realloc space, so keep track of result.
	 */

	rawLen = dstEnd - dst;
	byteArray = Tcl_SetByteArrayLength(objPtr, byteLen + rawLen);
	memcpy(byteArray + byteLen, dst, rawLen);
	byteLen += rawLen;
    }

    /*
     * Found EOL or EOF, but the output buffer may now contain too many bytes.
     * We need to know how many bytes correspond to the number we want, so we
     * can remove the correct number of bytes from the channel buffer.
     */

  gotEOL:
    if (bufPtr == NULL) {
	Tcl_Panic("TclGetsObjBinary: gotEOL reached with bufPtr==NULL");
    }

    rawLen = eol - dst;
    byteArray = Tcl_SetByteArrayLength(objPtr, byteLen + rawLen);
    memcpy(byteArray + byteLen, dst, rawLen);
    byteLen += rawLen;
    bufPtr->nextRemoved += rawLen + skip;

    /*
     * Convert the buffer if there was an encoding.
     * XXX - unimplemented.
     */
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
	    if (nextPtr == NULL) {
		nextPtr = AllocChannelBuffer(statePtr->bufSize);
		bufPtr->nextPtr = nextPtr;
		statePtr->inQueueTail = nextPtr;
	    }
	    extra = rawLen - gsPtr->rawRead;
	    memcpy(nextPtr->buf + (BUFFER_PADDING - extra),
		    raw + gsPtr->rawRead, (size_t) extra);
	    nextPtr->nextRemoved -= extra;
	    bufPtr->nextAdded -= extra;
	}
    }

    gsPtr->bufPtr = bufPtr;
    return 0;







|







5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
	    if (nextPtr == NULL) {
		nextPtr = AllocChannelBuffer(statePtr->bufSize);
		bufPtr->nextPtr = nextPtr;
		statePtr->inQueueTail = nextPtr;
	    }
	    extra = rawLen - gsPtr->rawRead;
	    memcpy(nextPtr->buf + (BUFFER_PADDING - extra),
		    raw + gsPtr->rawRead, extra);
	    nextPtr->nextRemoved -= extra;
	    bufPtr->nextAdded -= extra;
	}
    }

    gsPtr->bufPtr = bufPtr;
    return 0;
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
	int toCopy = (bytesInBuffer < (int)bytesToRead) ? bytesInBuffer
		: (int)bytesToRead;

	/*
         * Copy the current chunk into the read buffer.
         */

	memcpy(readBuf, RemovePoint(bufPtr), (size_t) toCopy);
	bufPtr->nextRemoved += toCopy;
	copied += toCopy;
	readBuf += toCopy;
	bytesToRead -= toCopy;

	/*
         * If the current buffer is empty recycle it.







|







5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
	int toCopy = (bytesInBuffer < (int)bytesToRead) ? bytesInBuffer
		: (int)bytesToRead;

	/*
         * Copy the current chunk into the read buffer.
         */

	memcpy(readBuf, RemovePoint(bufPtr), toCopy);
	bufPtr->nextRemoved += toCopy;
	copied += toCopy;
	readBuf += toCopy;
	bytesToRead -= toCopy;

	/*
         * If the current buffer is empty recycle it.
6081
6082
6083
6084
6085
6086
6087

6088
6089
6090
6091
6092
6093
6094
6095
    Tcl_Encoding encoding = statePtr->encoding? statePtr->encoding
	    : GetBinaryEncoding();
    Tcl_EncodingState savedState = statePtr->inputEncodingState;
    ChannelBuffer *bufPtr = statePtr->inQueueHead;
    int savedIEFlags = statePtr->inputEncodingFlags;
    int savedFlags = statePtr->flags;
    char *dst, *src = RemovePoint(bufPtr);

    int numBytes, srcLen = BytesLeft(bufPtr);

    /*
     * One src byte can yield at most one character.  So when the number of
     * src bytes we plan to read is less than the limit on character count to
     * be read, clearly we will remain within that limit, and we can use the
     * value of "srcLen" as a tighter limit for sizing receiving buffers.
     */







>
|







6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
    Tcl_Encoding encoding = statePtr->encoding? statePtr->encoding
	    : GetBinaryEncoding();
    Tcl_EncodingState savedState = statePtr->inputEncodingState;
    ChannelBuffer *bufPtr = statePtr->inQueueHead;
    int savedIEFlags = statePtr->inputEncodingFlags;
    int savedFlags = statePtr->flags;
    char *dst, *src = RemovePoint(bufPtr);
    size_t numBytes;
    int srcLen = BytesLeft(bufPtr);

    /*
     * One src byte can yield at most one character.  So when the number of
     * src bytes we plan to read is less than the limit on character count to
     * be read, clearly we will remain within that limit, and we can use the
     * value of "srcLen" as a tighter limit for sizing receiving buffers.
     */
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
	     */

	    if (nextPtr->nextRemoved - srcLen < 0) {
		Tcl_Panic("Buffer Underflow, BUFFER_PADDING not enough");
	    }

	    nextPtr->nextRemoved -= srcLen;
	    memcpy(RemovePoint(nextPtr), src, (size_t) srcLen);
	    RecycleBuffer(statePtr, bufPtr, 0);
	    statePtr->inQueueHead = nextPtr;
	    Tcl_SetObjLength(objPtr, numBytes);
	    return ReadChars(statePtr, objPtr, charsToRead, factorPtr);
	}

	statePtr->inputEncodingFlags &= ~TCL_ENCODING_START;







|







6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
	     */

	    if (nextPtr->nextRemoved - srcLen < 0) {
		Tcl_Panic("Buffer Underflow, BUFFER_PADDING not enough");
	    }

	    nextPtr->nextRemoved -= srcLen;
	    memcpy(RemovePoint(nextPtr), src, srcLen);
	    RecycleBuffer(statePtr, bufPtr, 0);
	    statePtr->inQueueHead = nextPtr;
	    Tcl_SetObjLength(objPtr, numBytes);
	    return ReadChars(statePtr, objPtr, charsToRead, factorPtr);
	}

	statePtr->inputEncodingFlags &= ~TCL_ENCODING_START;
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
	}
    }

    switch (statePtr->inputTranslation) {
    case TCL_TRANSLATE_LF:
    case TCL_TRANSLATE_CR:
	if (dstStart != srcStart) {
	    memcpy(dstStart, srcStart, (size_t) srcLen);
	}
	if (statePtr->inputTranslation == TCL_TRANSLATE_CR) {
	    char *dst = dstStart;
	    char *dstEnd = dstStart + srcLen;

	    while ((dst = memchr(dst, '\r', dstEnd - dst))) {
		*dst++ = '\n';







|







6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
	}
    }

    switch (statePtr->inputTranslation) {
    case TCL_TRANSLATE_LF:
    case TCL_TRANSLATE_CR:
	if (dstStart != srcStart) {
	    memcpy(dstStart, srcStart, srcLen);
	}
	if (statePtr->inputTranslation == TCL_TRANSLATE_CR) {
	    char *dst = dstStart;
	    char *dstEnd = dstStart + srcLen;

	    while ((dst = memchr(dst, '\r', dstEnd - dst))) {
		*dst++ = '\n';
9422
9423
9424
9425
9426
9427
9428
9429

9430
9431
9432
9433
9434
9435
9436
    CopyState *csPtr,		/* State of copy operation. */
    int mask)			/* Current channel event flags. */
{
    Tcl_Interp *interp;
    Tcl_Obj *cmdPtr, *errObj = NULL, *bufObj = NULL, *msg = NULL;
    Tcl_Channel inChan, outChan;
    ChannelState *inStatePtr, *outStatePtr;
    int result = TCL_OK, size, sizeb;

    Tcl_WideInt total;
    const char *buffer;
    int inBinary, outBinary, sameEncoding;
				/* Encoding control */
    int underflow;		/* Input underflow */

    inChan	= (Tcl_Channel) csPtr->readPtr;







|
>







9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
    CopyState *csPtr,		/* State of copy operation. */
    int mask)			/* Current channel event flags. */
{
    Tcl_Interp *interp;
    Tcl_Obj *cmdPtr, *errObj = NULL, *bufObj = NULL, *msg = NULL;
    Tcl_Channel inChan, outChan;
    ChannelState *inStatePtr, *outStatePtr;
    int result = TCL_OK, size;
    size_t sizeb;
    Tcl_WideInt total;
    const char *buffer;
    int inBinary, outBinary, sameEncoding;
				/* Encoding control */
    int underflow;		/* Input underflow */

    inChan	= (Tcl_Channel) csPtr->readPtr;
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
	     * Read up to bufSize bytes.
	     */

	    if ((csPtr->toRead == (Tcl_WideInt) -1)
                    || (csPtr->toRead > (Tcl_WideInt) csPtr->bufSize)) {
		sizeb = csPtr->bufSize;
	    } else {
		sizeb = (int) csPtr->toRead;
	    }

	    if (inBinary || sameEncoding) {
		size = DoRead(inStatePtr->topChanPtr, csPtr->buffer, sizeb,
                              !GotFlag(inStatePtr, CHANNEL_NONBLOCKING));
	    } else {
		size = DoReadChars(inStatePtr->topChanPtr, bufObj, sizeb,
			0 /* No append */);
	    }
	    underflow = (size >= 0) && (size < sizeb);	/* Input underflow */
	}

	if (size < 0) {
	readError:
	    if (interp) {
		TclNewObj(errObj);
		Tcl_AppendStringsToObj(errObj, "error reading \"",







|









|







9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
	     * Read up to bufSize bytes.
	     */

	    if ((csPtr->toRead == (Tcl_WideInt) -1)
                    || (csPtr->toRead > (Tcl_WideInt) csPtr->bufSize)) {
		sizeb = csPtr->bufSize;
	    } else {
		sizeb = csPtr->toRead;
	    }

	    if (inBinary || sameEncoding) {
		size = DoRead(inStatePtr->topChanPtr, csPtr->buffer, sizeb,
                              !GotFlag(inStatePtr, CHANNEL_NONBLOCKING));
	    } else {
		size = DoReadChars(inStatePtr->topChanPtr, bufObj, sizeb,
			0 /* No append */);
	    }
	    underflow = (size >= 0) && ((size_t)size < sizeb);	/* Input underflow */
	}

	if (size < 0) {
	readError:
	    if (interp) {
		TclNewObj(errObj);
		Tcl_AppendStringsToObj(errObj, "error reading \"",
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
	 * bytes or characters, and both EOL translation and encoding
	 * conversion may have changed this number unpredictably in relation
	 * to 'size' (It can be smaller or larger, in the latter case able to
	 * drive toRead below -1, causing infinite looping). Completely
	 * unsuitable for updating totals and toRead.
	 */

	if (sizeb < 0) {
	writeError:
	    if (interp) {
		TclNewObj(errObj);
		Tcl_AppendStringsToObj(errObj, "error writing \"",
			Tcl_GetChannelName(outChan), "\": ", NULL);
		if (msg != NULL) {
		    Tcl_AppendObjToObj(errObj, msg);







|







9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
	 * bytes or characters, and both EOL translation and encoding
	 * conversion may have changed this number unpredictably in relation
	 * to 'size' (It can be smaller or larger, in the latter case able to
	 * drive toRead below -1, causing infinite looping). Completely
	 * unsuitable for updating totals and toRead.
	 */

	if (sizeb == TCL_AUTO_LENGTH) {
	writeError:
	    if (interp) {
		TclNewObj(errObj);
		Tcl_AppendStringsToObj(errObj, "error writing \"",
			Tcl_GetChannelName(outChan), "\": ", NULL);
		if (msg != NULL) {
		    Tcl_AppendObjToObj(errObj, msg);
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
	} else if (statePtr->topChanPtr == (Channel *) tsdPtr->stderrChannel) {
	    name = "stderr";
	} else {
	    name = statePtr->channelName;
	}

	if ((*chanName == *name) &&
		(memcmp(name, chanName, (size_t) chanNameLen + 1) == 0)) {
	    return 1;
	}
    }

    return 0;
}








|







10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
	} else if (statePtr->topChanPtr == (Channel *) tsdPtr->stderrChannel) {
	    name = "stderr";
	} else {
	    name = statePtr->channelName;
	}

	if ((*chanName == *name) &&
		(memcmp(name, chanName, chanNameLen + 1) == 0)) {
	    return 1;
	}
    }

    return 0;
}

Changes to generic/tclIOCmd.c.
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
	 * messages produced by drivers during the closing of a channel,
	 * because the Tcl convention is that such error messages do not have
	 * a terminating newline.
	 */

	Tcl_Obj *resultPtr = Tcl_GetObjResult(interp);
	const char *string;
	int len;

	if (Tcl_IsShared(resultPtr)) {
	    resultPtr = Tcl_DuplicateObj(resultPtr);
	    Tcl_SetObjResult(interp, resultPtr);
	}
	string = TclGetStringFromObj(resultPtr, &len);
	if ((len > 0) && (string[len - 1] == '\n')) {







|







704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
	 * messages produced by drivers during the closing of a channel,
	 * because the Tcl convention is that such error messages do not have
	 * a terminating newline.
	 */

	Tcl_Obj *resultPtr = Tcl_GetObjResult(interp);
	const char *string;
	size_t len;

	if (Tcl_IsShared(resultPtr)) {
	    resultPtr = Tcl_DuplicateObj(resultPtr);
	    Tcl_SetObjResult(interp, resultPtr);
	}
	string = TclGetStringFromObj(resultPtr, &len);
	if ((len > 0) && (string[len - 1] == '\n')) {
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
    Tcl_Obj *const objv[])	/* Argument objects. */
{
    Tcl_Obj *resultPtr;
    const char **argv;		/* An array for the string arguments. Stored
				 * on the _Tcl_ stack. */
    const char *string;
    Tcl_Channel chan;
    int argc, background, i, index, keepNewline, result, skip, length;
    int ignoreStderr;
    static const char *const options[] = {
	"-ignorestderr", "-keepnewline", "--", NULL
    };
    enum options {
	EXEC_IGNORESTDERR, EXEC_KEEPNEWLINE, EXEC_LAST
    };








|
|







866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
    Tcl_Obj *const objv[])	/* Argument objects. */
{
    Tcl_Obj *resultPtr;
    const char **argv;		/* An array for the string arguments. Stored
				 * on the _Tcl_ stack. */
    const char *string;
    Tcl_Channel chan;
    int argc, background, i, index, keepNewline, result, skip, ignoreStderr;
    size_t length;
    static const char *const options[] = {
	"-ignorestderr", "-keepnewline", "--", NULL
    };
    enum options {
	EXEC_IGNORESTDERR, EXEC_KEEPNEWLINE, EXEC_LAST
    };

1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
    Tcl_Channel chan;

    if (TclpHasSockets(interp) != TCL_OK) {
	return TCL_ERROR;
    }

    for (a = 1; a < objc; a++) {
	const char *arg = Tcl_GetString(objv[a]);

	if (arg[0] != '-') {
	    break;
	}
	if (Tcl_GetIndexFromObj(interp, objv[a], socketOptions, "option",
		TCL_EXACT, &optionIndex) != TCL_OK) {
	    return TCL_ERROR;







|







1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
    Tcl_Channel chan;

    if (TclpHasSockets(interp) != TCL_OK) {
	return TCL_ERROR;
    }

    for (a = 1; a < objc; a++) {
	const char *arg = TclGetString(objv[a]);

	if (arg[0] != '-') {
	    break;
	}
	if (Tcl_GetIndexFromObj(interp, objv[a], socketOptions, "option",
		TCL_EXACT, &optionIndex) != TCL_OK) {
	    return TCL_ERROR;
Changes to generic/tclIORChan.c.
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
	Tcl_ResetResult(interp);
	Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		"Expected list with even number of "
		"elements, got %d element%s instead", listc,
		(listc == 1 ? "" : "s")));
        goto error;
    } else {
	int len;
	const char *str = TclGetStringFromObj(resObj, &len);

	if (len) {
	    TclDStringAppendLiteral(dsPtr, " ");
	    Tcl_DStringAppend(dsPtr, str, len);
	}
        goto ok;







|







1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
	Tcl_ResetResult(interp);
	Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		"Expected list with even number of "
		"elements, got %d element%s instead", listc,
		(listc == 1 ? "" : "s")));
        goto error;
    } else {
	size_t len;
	const char *str = TclGetStringFromObj(resObj, &len);

	if (len) {
	    TclDStringAppendLiteral(dsPtr, " ");
	    Tcl_DStringAppend(dsPtr, str, len);
	}
        goto ok;
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
	     * the full state of the result, including additional options.
	     *
	     * This is complex and ugly, and would be completely unnecessary
	     * if we only added support for a TCL_FORBID_EXCEPTIONS flag.
	     */

	    if (result != TCL_ERROR) {
		int cmdLen;
		const char *cmdString = TclGetStringFromObj(cmd, &cmdLen);

		Tcl_IncrRefCount(cmd);
		Tcl_ResetResult(rcPtr->interp);
		Tcl_SetObjResult(rcPtr->interp, Tcl_ObjPrintf(
			"chan handler returned bad code: %d", result));
		Tcl_LogCommandInfo(rcPtr->interp, cmdString, cmdString,







|







2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
	     * the full state of the result, including additional options.
	     *
	     * This is complex and ugly, and would be completely unnecessary
	     * if we only added support for a TCL_FORBID_EXCEPTIONS flag.
	     */

	    if (result != TCL_ERROR) {
		size_t cmdLen;
		const char *cmdString = TclGetStringFromObj(cmd, &cmdLen);

		Tcl_IncrRefCount(cmd);
		Tcl_ResetResult(rcPtr->interp);
		Tcl_SetObjResult(rcPtr->interp, Tcl_ObjPrintf(
			"chan handler returned bad code: %d", result));
		Tcl_LogCommandInfo(rcPtr->interp, cmdString, cmdString,
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
		char *buf = Tcl_Alloc(200);
		sprintf(buf,
			"{Expected list with even number of elements, got %d %s instead}",
			listc, (listc == 1 ? "element" : "elements"));

		ForwardSetDynamicError(paramPtr, buf);
	    } else {
		int len;
		const char *str = TclGetStringFromObj(resObj, &len);

		if (len) {
		    TclDStringAppendLiteral(paramPtr->getOpt.value, " ");
		    Tcl_DStringAppend(paramPtr->getOpt.value, str, len);
		}
	    }







|







3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
		char *buf = Tcl_Alloc(200);
		sprintf(buf,
			"{Expected list with even number of elements, got %d %s instead}",
			listc, (listc == 1 ? "element" : "elements"));

		ForwardSetDynamicError(paramPtr, buf);
	    } else {
		size_t len;
		const char *str = TclGetStringFromObj(resObj, &len);

		if (len) {
		    TclDStringAppendLiteral(paramPtr->getOpt.value, " ");
		    Tcl_DStringAppend(paramPtr->getOpt.value, str, len);
		}
	    }
Changes to generic/tclIORTrans.c.
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
    methods = 0;
    while (listc > 0) {
	if (Tcl_GetIndexFromObj(interp, listv[listc-1], methodNames,
		"method", TCL_EXACT, &methIndex) != TCL_OK) {
	    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		    "chan handler \"%s initialize\" returned %s",
		    TclGetString(cmdObj),
		    Tcl_GetString(Tcl_GetObjResult(interp))));
	    Tcl_DecrRefCount(resObj);
	    goto error;
	}

	methods |= FLAG(methIndex);
	listc--;
    }







|







616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
    methods = 0;
    while (listc > 0) {
	if (Tcl_GetIndexFromObj(interp, listv[listc-1], methodNames,
		"method", TCL_EXACT, &methIndex) != TCL_OK) {
	    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		    "chan handler \"%s initialize\" returned %s",
		    TclGetString(cmdObj),
		    Tcl_GetStringResult(interp)));
	    Tcl_DecrRefCount(resObj);
	    goto error;
	}

	methods |= FLAG(methIndex);
	listc--;
    }
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
     *
     * NOTE: The channel may have been removed from the map already via
     * the per-interp DeleteReflectedTransformMap exit-handler.
     */

    if (!rtPtr->dead) {
	rtmPtr = GetReflectedTransformMap(rtPtr->interp);
	hPtr = Tcl_FindHashEntry(&rtmPtr->map, Tcl_GetString(rtPtr->handle));
	if (hPtr) {
	    Tcl_DeleteHashEntry(hPtr);
	}

	/*
	 * In a threaded interpreter we manage a per-thread map as well,
	 * to allow us to survive if the script level pulls the rug out







|







1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
     *
     * NOTE: The channel may have been removed from the map already via
     * the per-interp DeleteReflectedTransformMap exit-handler.
     */

    if (!rtPtr->dead) {
	rtmPtr = GetReflectedTransformMap(rtPtr->interp);
	hPtr = Tcl_FindHashEntry(&rtmPtr->map, TclGetString(rtPtr->handle));
	if (hPtr) {
	    Tcl_DeleteHashEntry(hPtr);
	}

	/*
	 * In a threaded interpreter we manage a per-thread map as well,
	 * to allow us to survive if the script level pulls the rug out
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
	     * the full state of the result, including additional options.
	     *
	     * This is complex and ugly, and would be completely unnecessary
	     * if we only added support for a TCL_FORBID_EXCEPTIONS flag.
	     */
	    if (result != TCL_ERROR) {
		Tcl_Obj *cmd = Tcl_NewListObj(cmdc, rtPtr->argv);
		int cmdLen;
		const char *cmdString = TclGetStringFromObj(cmd, &cmdLen);

		Tcl_IncrRefCount(cmd);
		Tcl_ResetResult(rtPtr->interp);
		Tcl_SetObjResult(rtPtr->interp, Tcl_ObjPrintf(
			"chan handler returned bad code: %d", result));
		Tcl_LogCommandInfo(rtPtr->interp, cmdString, cmdString, cmdLen);







|







2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
	     * the full state of the result, including additional options.
	     *
	     * This is complex and ugly, and would be completely unnecessary
	     * if we only added support for a TCL_FORBID_EXCEPTIONS flag.
	     */
	    if (result != TCL_ERROR) {
		Tcl_Obj *cmd = Tcl_NewListObj(cmdc, rtPtr->argv);
		size_t cmdLen;
		const char *cmdString = TclGetStringFromObj(cmd, &cmdLen);

		Tcl_IncrRefCount(cmd);
		Tcl_ResetResult(rtPtr->interp);
		Tcl_SetObjResult(rtPtr->interp, Tcl_ObjPrintf(
			"chan handler returned bad code: %d", result));
		Tcl_LogCommandInfo(rtPtr->interp, cmdString, cmdString, cmdLen);
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617

	    bytev = TclGetByteArrayFromObj(resObj, &bytec);

	    paramPtr->transform.size = bytec;

	    if (bytec > 0) {
		paramPtr->transform.buf = Tcl_Alloc(bytec);
		memcpy(paramPtr->transform.buf, bytev, (size_t)bytec);
	    } else {
		paramPtr->transform.buf = NULL;
	    }
	}

	Tcl_DecrRefCount(bufObj);
	break;







|







2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617

	    bytev = TclGetByteArrayFromObj(resObj, &bytec);

	    paramPtr->transform.size = bytec;

	    if (bytec > 0) {
		paramPtr->transform.buf = Tcl_Alloc(bytec);
		memcpy(paramPtr->transform.buf, bytev, bytec);
	    } else {
		paramPtr->transform.buf = NULL;
	    }
	}

	Tcl_DecrRefCount(bufObj);
	break;
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651

	    bytev = TclGetByteArrayFromObj(resObj, &bytec);

	    paramPtr->transform.size = bytec;

	    if (bytec > 0) {
		paramPtr->transform.buf = Tcl_Alloc(bytec);
		memcpy(paramPtr->transform.buf, bytev, (size_t)bytec);
	    } else {
		paramPtr->transform.buf = NULL;
	    }
	}

	Tcl_DecrRefCount(bufObj);
	break;







|







2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651

	    bytev = TclGetByteArrayFromObj(resObj, &bytec);

	    paramPtr->transform.size = bytec;

	    if (bytec > 0) {
		paramPtr->transform.buf = Tcl_Alloc(bytec);
		memcpy(paramPtr->transform.buf, bytev, bytec);
	    } else {
		paramPtr->transform.buf = NULL;
	    }
	}

	Tcl_DecrRefCount(bufObj);
	break;
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680

	    bytev = TclGetByteArrayFromObj(resObj, &bytec);

	    paramPtr->transform.size = bytec;

	    if (bytec > 0) {
		paramPtr->transform.buf = Tcl_Alloc(bytec);
		memcpy(paramPtr->transform.buf, bytev, (size_t)bytec);
	    } else {
		paramPtr->transform.buf = NULL;
	    }
	}
	break;

    case ForwardedFlush:







|







2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680

	    bytev = TclGetByteArrayFromObj(resObj, &bytec);

	    paramPtr->transform.size = bytec;

	    if (bytec > 0) {
		paramPtr->transform.buf = Tcl_Alloc(bytec);
		memcpy(paramPtr->transform.buf, bytev, bytec);
	    } else {
		paramPtr->transform.buf = NULL;
	    }
	}
	break;

    case ForwardedFlush:
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707

	    bytev = TclGetByteArrayFromObj(resObj, &bytec);

	    paramPtr->transform.size = bytec;

	    if (bytec > 0) {
		paramPtr->transform.buf = Tcl_Alloc(bytec);
		memcpy(paramPtr->transform.buf, bytev, (size_t)bytec);
	    } else {
		paramPtr->transform.buf = NULL;
	    }
	}
	break;

    case ForwardedClear:







|







2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707

	    bytev = TclGetByteArrayFromObj(resObj, &bytec);

	    paramPtr->transform.size = bytec;

	    if (bytec > 0) {
		paramPtr->transform.buf = Tcl_Alloc(bytec);
		memcpy(paramPtr->transform.buf, bytev, bytec);
	    } else {
		paramPtr->transform.buf = NULL;
	    }
	}
	break;

    case ForwardedClear:
Changes to generic/tclIOUtil.c.
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
 */

static void
FsUpdateCwd(
    Tcl_Obj *cwdObj,
    ClientData clientData)
{
    int len = 0;
    const char *str = NULL;
    ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&fsDataKey);

    if (cwdObj != NULL) {
	str = TclGetStringFromObj(cwdObj, &len);
    }








|







677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
 */

static void
FsUpdateCwd(
    Tcl_Obj *cwdObj,
    ClientData clientData)
{
    size_t len = 0;
    const char *str = NULL;
    ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&fsDataKey);

    if (cwdObj != NULL) {
	str = TclGetStringFromObj(cwdObj, &len);
    }

1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
	return result;
    }

    if (Tcl_FSStat(pathPtr, &statBuf) == -1) {
	Tcl_SetErrno(errno);
	Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		"couldn't read file \"%s\": %s",
		Tcl_GetString(pathPtr), Tcl_PosixError(interp)));
	return result;
    }
    chan = Tcl_FSOpenFileChannel(interp, pathPtr, "r", 0644);
    if (chan == NULL) {
	Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		"couldn't read file \"%s\": %s",
		Tcl_GetString(pathPtr), Tcl_PosixError(interp)));
	return result;
    }

    /*
     * The eofchar is \32 (^Z). This is the usual on Windows, but we effect
     * this cross-platform to allow for scripted documents. [Bug: 2040]
     */







|






|







1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
	return result;
    }

    if (Tcl_FSStat(pathPtr, &statBuf) == -1) {
	Tcl_SetErrno(errno);
	Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		"couldn't read file \"%s\": %s",
		TclGetString(pathPtr), Tcl_PosixError(interp)));
	return result;
    }
    chan = Tcl_FSOpenFileChannel(interp, pathPtr, "r", 0644);
    if (chan == NULL) {
	Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		"couldn't read file \"%s\": %s",
		TclGetString(pathPtr), Tcl_PosixError(interp)));
	return result;
    }

    /*
     * The eofchar is \32 (^Z). This is the usual on Windows, but we effect
     * this cross-platform to allow for scripted documents. [Bug: 2040]
     */
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
     * be handled especially.
     */

    if (Tcl_ReadChars(chan, objPtr, 1, 0) == TCL_IO_FAILURE) {
	Tcl_Close(interp, chan);
	Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		"couldn't read file \"%s\": %s",
		Tcl_GetString(pathPtr), Tcl_PosixError(interp)));
	goto end;
    }
    string = Tcl_GetString(objPtr);

    /*
     * If first character is not a BOM, append the remaining characters,
     * otherwise replace them. [Bug 3466099]
     */

    if (Tcl_ReadChars(chan, objPtr, -1,
	    memcmp(string, "\xef\xbb\xbf", 3)) == TCL_IO_FAILURE) {
	Tcl_Close(interp, chan);
	Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		"couldn't read file \"%s\": %s",
		Tcl_GetString(pathPtr), Tcl_PosixError(interp)));
	goto end;
    }

    if (Tcl_Close(interp, chan) != TCL_OK) {
	goto end;
    }








|


|











|







1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
     * be handled especially.
     */

    if (Tcl_ReadChars(chan, objPtr, 1, 0) == TCL_IO_FAILURE) {
	Tcl_Close(interp, chan);
	Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		"couldn't read file \"%s\": %s",
		TclGetString(pathPtr), Tcl_PosixError(interp)));
	goto end;
    }
    string = TclGetString(objPtr);

    /*
     * If first character is not a BOM, append the remaining characters,
     * otherwise replace them. [Bug 3466099]
     */

    if (Tcl_ReadChars(chan, objPtr, -1,
	    memcmp(string, "\xef\xbb\xbf", 3)) == TCL_IO_FAILURE) {
	Tcl_Close(interp, chan);
	Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		"couldn't read file \"%s\": %s",
		TclGetString(pathPtr), Tcl_PosixError(interp)));
	goto end;
    }

    if (Tcl_Close(interp, chan) != TCL_OK) {
	goto end;
    }

1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
	return TCL_ERROR;
    }

    if (Tcl_FSStat(pathPtr, &statBuf) == -1) {
	Tcl_SetErrno(errno);
	Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		"couldn't read file \"%s\": %s",
		Tcl_GetString(pathPtr), Tcl_PosixError(interp)));
	return TCL_ERROR;
    }
    chan = Tcl_FSOpenFileChannel(interp, pathPtr, "r", 0644);
    if (chan == NULL) {
	Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		"couldn't read file \"%s\": %s",
		Tcl_GetString(pathPtr), Tcl_PosixError(interp)));
	return TCL_ERROR;
    }
    TclPkgFileSeen(interp, Tcl_GetString(pathPtr));

    /*
     * The eofchar is \32 (^Z). This is the usual on Windows, but we effect
     * this cross-platform to allow for scripted documents. [Bug: 2040]
     */

    Tcl_SetChannelOption(interp, chan, "-eofchar", "\32 {}");







|






|


|







1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
	return TCL_ERROR;
    }

    if (Tcl_FSStat(pathPtr, &statBuf) == -1) {
	Tcl_SetErrno(errno);
	Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		"couldn't read file \"%s\": %s",
		TclGetString(pathPtr), Tcl_PosixError(interp)));
	return TCL_ERROR;
    }
    chan = Tcl_FSOpenFileChannel(interp, pathPtr, "r", 0644);
    if (chan == NULL) {
	Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		"couldn't read file \"%s\": %s",
		TclGetString(pathPtr), Tcl_PosixError(interp)));
	return TCL_ERROR;
    }
    TclPkgFileSeen(interp, TclGetString(pathPtr));

    /*
     * The eofchar is \32 (^Z). This is the usual on Windows, but we effect
     * this cross-platform to allow for scripted documents. [Bug: 2040]
     */

    Tcl_SetChannelOption(interp, chan, "-eofchar", "\32 {}");
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
     * be handled especially.
     */

    if (Tcl_ReadChars(chan, objPtr, 1, 0) == TCL_IO_FAILURE) {
	Tcl_Close(interp, chan);
	Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		"couldn't read file \"%s\": %s",
		Tcl_GetString(pathPtr), Tcl_PosixError(interp)));
	Tcl_DecrRefCount(objPtr);
	return TCL_ERROR;
    }
    string = Tcl_GetString(objPtr);

    /*
     * If first character is not a BOM, append the remaining characters,
     * otherwise replace them. [Bug 3466099]
     */

    if (Tcl_ReadChars(chan, objPtr, -1,
	    memcmp(string, "\xef\xbb\xbf", 3)) == TCL_IO_FAILURE) {
	Tcl_Close(interp, chan);
	Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		"couldn't read file \"%s\": %s",
		Tcl_GetString(pathPtr), Tcl_PosixError(interp)));
	Tcl_DecrRefCount(objPtr);
	return TCL_ERROR;
    }

    if (Tcl_Close(interp, chan) != TCL_OK) {
	Tcl_DecrRefCount(objPtr);
	return TCL_ERROR;







|



|











|







1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
     * be handled especially.
     */

    if (Tcl_ReadChars(chan, objPtr, 1, 0) == TCL_IO_FAILURE) {
	Tcl_Close(interp, chan);
	Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		"couldn't read file \"%s\": %s",
		TclGetString(pathPtr), Tcl_PosixError(interp)));
	Tcl_DecrRefCount(objPtr);
	return TCL_ERROR;
    }
    string = TclGetString(objPtr);

    /*
     * If first character is not a BOM, append the remaining characters,
     * otherwise replace them. [Bug 3466099]
     */

    if (Tcl_ReadChars(chan, objPtr, -1,
	    memcmp(string, "\xef\xbb\xbf", 3)) == TCL_IO_FAILURE) {
	Tcl_Close(interp, chan);
	Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		"couldn't read file \"%s\": %s",
		TclGetString(pathPtr), Tcl_PosixError(interp)));
	Tcl_DecrRefCount(objPtr);
	return TCL_ERROR;
    }

    if (Tcl_Close(interp, chan) != TCL_OK) {
	Tcl_DecrRefCount(objPtr);
	return TCL_ERROR;
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
    if (result == TCL_RETURN) {
	result = TclUpdateReturnInfo(iPtr);
    } else if (result == TCL_ERROR) {
	/*
	 * Record information telling where the error occurred.
	 */

	int length;
	const char *pathString = TclGetStringFromObj(pathPtr, &length);
	const int limit = 150;
	int overflow = (length > limit);

	Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
		"\n    (file \"%.*s%s\" line %d)",
		(overflow ? limit : length), pathString,
		(overflow ? "..." : ""), Tcl_GetErrorLine(interp)));
    }

    Tcl_DecrRefCount(objPtr);
    return result;
}








|

|




|







2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
    if (result == TCL_RETURN) {
	result = TclUpdateReturnInfo(iPtr);
    } else if (result == TCL_ERROR) {
	/*
	 * Record information telling where the error occurred.
	 */

	size_t length;
	const char *pathString = TclGetStringFromObj(pathPtr, &length);
	const unsigned int limit = 150;
	int overflow = (length > limit);

	Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
		"\n    (file \"%.*s%s\" line %d)",
		(overflow ? limit : (unsigned int)length), pathString,
		(overflow ? "..." : ""), Tcl_GetErrorLine(interp)));
    }

    Tcl_DecrRefCount(objPtr);
    return result;
}

2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
	 */

	if (seekFlag && Tcl_Seek(retVal, (Tcl_WideInt) 0, SEEK_END)
		< (Tcl_WideInt) 0) {
	    if (interp != NULL) {
		Tcl_SetObjResult(interp, Tcl_ObjPrintf(
			"could not seek to end of file while opening \"%s\": %s",
			Tcl_GetString(pathPtr), Tcl_PosixError(interp)));
	    }
	    Tcl_Close(NULL, retVal);
	    return NULL;
	}
	if (binary) {
	    Tcl_SetChannelOption(interp, retVal, "-translation", "binary");
	}
	return retVal;
    }

    /*
     * File doesn't belong to any filesystem that can open it.
     */

    Tcl_SetErrno(ENOENT);
    if (interp != NULL) {
	Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		"couldn't open \"%s\": %s",
		Tcl_GetString(pathPtr), Tcl_PosixError(interp)));
    }
    return NULL;
}

/*
 *----------------------------------------------------------------------
 *







|


















|







2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
	 */

	if (seekFlag && Tcl_Seek(retVal, (Tcl_WideInt) 0, SEEK_END)
		< (Tcl_WideInt) 0) {
	    if (interp != NULL) {
		Tcl_SetObjResult(interp, Tcl_ObjPrintf(
			"could not seek to end of file while opening \"%s\": %s",
			TclGetString(pathPtr), Tcl_PosixError(interp)));
	    }
	    Tcl_Close(NULL, retVal);
	    return NULL;
	}
	if (binary) {
	    Tcl_SetChannelOption(interp, retVal, "-translation", "binary");
	}
	return retVal;
    }

    /*
     * File doesn't belong to any filesystem that can open it.
     */

    Tcl_SetErrno(ENOENT);
    if (interp != NULL) {
	Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		"couldn't open \"%s\": %s",
		TclGetString(pathPtr), Tcl_PosixError(interp)));
    }
    return NULL;
}

/*
 *----------------------------------------------------------------------
 *
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
	    /*
	     * Note that both 'norm' and 'tsdPtr->cwdPathPtr' are normalized
	     * paths. Therefore we can be more efficient than calling
	     * 'Tcl_FSEqualPaths', and in addition avoid a nasty infinite loop
	     * bug when trying to normalize tsdPtr->cwdPathPtr.
	     */

	    int len1, len2;
	    const char *str1, *str2;

	    str1 = TclGetStringFromObj(tsdPtr->cwdPathPtr, &len1);
	    str2 = TclGetStringFromObj(norm, &len2);
	    if ((len1 == len2) && (strcmp(str1, str2) == 0)) {
		/*
		 * If the paths were equal, we can be more efficient and







|







2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
	    /*
	     * Note that both 'norm' and 'tsdPtr->cwdPathPtr' are normalized
	     * paths. Therefore we can be more efficient than calling
	     * 'Tcl_FSEqualPaths', and in addition avoid a nasty infinite loop
	     * bug when trying to normalize tsdPtr->cwdPathPtr.
	     */

	    size_t len1, len2;
	    const char *str1, *str2;

	    str1 = TclGetStringFromObj(tsdPtr->cwdPathPtr, &len1);
	    str2 = TclGetStringFromObj(norm, &len2);
	    if ((len1 == len2) && (strcmp(str1, str2) == 0)) {
		/*
		 * If the paths were equal, we can be more efficient and
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
	 *     http://mooon.googlecode.com/svn/trunk/linux_include/linux/aufs_type.h
	 *     http://aufs.sourceforge.net/
	 * Better reference will be gladly taken.
	 */
#ifndef AUFS_SUPER_MAGIC
#define AUFS_SUPER_MAGIC ('a' << 24 | 'u' << 16 | 'f' << 8 | 's')
#endif /* AUFS_SUPER_MAGIC */
	if ((statfs(Tcl_GetString(shlibFile), &fs) == 0)
		&& (fs.f_type == AUFS_SUPER_MAGIC)) {
	    return 1;
	}
    }
#endif /* ... NO_FSTATFS */
#endif /* ... TCL_TEMPLOAD_NO_UNLINK */








|







3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
	 *     http://mooon.googlecode.com/svn/trunk/linux_include/linux/aufs_type.h
	 *     http://aufs.sourceforge.net/
	 * Better reference will be gladly taken.
	 */
#ifndef AUFS_SUPER_MAGIC
#define AUFS_SUPER_MAGIC ('a' << 24 | 'u' << 16 | 'f' << 8 | 's')
#endif /* AUFS_SUPER_MAGIC */
	if ((statfs(TclGetString(shlibFile), &fs) == 0)
		&& (fs.f_type == AUFS_SUPER_MAGIC)) {
	    return 1;
	}
    }
#endif /* ... NO_FSTATFS */
#endif /* ... TCL_TEMPLOAD_NO_UNLINK */

3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
     * First check if it is readable -- and exists!
     */

    if (Tcl_FSAccess(pathPtr, R_OK) != 0) {
	if (interp) {
	    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		    "couldn't load library \"%s\": %s",
		    Tcl_GetString(pathPtr), Tcl_PosixError(interp)));
	}
	return TCL_ERROR;
    }

#ifdef TCL_LOAD_FROM_MEMORY
    /*
     * The platform supports loading code from memory, so ask for a buffer of







|







3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
     * First check if it is readable -- and exists!
     */

    if (Tcl_FSAccess(pathPtr, R_OK) != 0) {
	if (interp) {
	    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		    "couldn't load library \"%s\": %s",
		    TclGetString(pathPtr), Tcl_PosixError(interp)));
	}
	return TCL_ERROR;
    }

#ifdef TCL_LOAD_FROM_MEMORY
    /*
     * The platform supports loading code from memory, so ask for a buffer of
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
     */

    if (fsPtr->filesystemSeparatorProc != NULL) {
	Tcl_Obj *sep = fsPtr->filesystemSeparatorProc(pathPtr);

	if (sep != NULL) {
	    Tcl_IncrRefCount(sep);
	    separator = Tcl_GetString(sep)[0];
	    Tcl_DecrRefCount(sep);
	}
    }

    /*
     * Place the drive name as first element of the result list. The drive
     * name may contain strange characters, like colons and multiple forward
     * slashes (for example 'ftp://' is a valid vfs drive name)
     */

    result = Tcl_NewObj();
    p = Tcl_GetString(pathPtr);
    Tcl_ListObjAppendElement(NULL, result,
	    Tcl_NewStringObj(p, driveNameLength));
    p += driveNameLength;

    /*
     * Add the remaining path elements to the list.
     */







|











|







4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
     */

    if (fsPtr->filesystemSeparatorProc != NULL) {
	Tcl_Obj *sep = fsPtr->filesystemSeparatorProc(pathPtr);

	if (sep != NULL) {
	    Tcl_IncrRefCount(sep);
	    separator = TclGetString(sep)[0];
	    Tcl_DecrRefCount(sep);
	}
    }

    /*
     * Place the drive name as first element of the result list. The drive
     * name may contain strange characters, like colons and multiple forward
     * slashes (for example 'ftp://' is a valid vfs drive name)
     */

    result = Tcl_NewObj();
    p = TclGetString(pathPtr);
    Tcl_ListObjAppendElement(NULL, result,
	    Tcl_NewStringObj(p, driveNameLength));
    p += driveNameLength;

    /*
     * Add the remaining path elements to the list.
     */
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
				 * driveName. */
    Tcl_Obj **driveNameRef)	/* If the path is absolute, and this is
				 * non-NULL, then set to the name of the
				 * drive, network-volume which contains the
				 * path, already with a refCount for the
				 * caller. */
{
    int pathLen;
    const char *path = TclGetStringFromObj(pathPtr, &pathLen);
    Tcl_PathType type;

    type = TclFSNonnativePathType(path, pathLen, filesystemPtrPtr,
	    driveNameLengthPtr, driveNameRef);

    if (type != TCL_PATH_ABSOLUTE) {







|







4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
				 * driveName. */
    Tcl_Obj **driveNameRef)	/* If the path is absolute, and this is
				 * non-NULL, then set to the name of the
				 * drive, network-volume which contains the
				 * path, already with a refCount for the
				 * caller. */
{
    size_t pathLen;
    const char *path = TclGetStringFromObj(pathPtr, &pathLen);
    Tcl_PathType type;

    type = TclFSNonnativePathType(path, pathLen, filesystemPtrPtr,
	    driveNameLengthPtr, driveNameRef);

    if (type != TCL_PATH_ABSOLUTE) {
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
		     * (but Tcl_Panic seems a bit excessive).
		     */

		    numVolumes = -1;
		}
		while (numVolumes > 0) {
		    Tcl_Obj *vol;
		    int len;
		    const char *strVol;

		    numVolumes--;
		    Tcl_ListObjIndex(NULL, thisFsVolumes, numVolumes, &vol);
		    strVol = TclGetStringFromObj(vol,&len);
		    if (pathLen < len) {
			continue;
		    }
		    if (strncmp(strVol, path, (size_t) len) == 0) {
			type = TCL_PATH_ABSOLUTE;
			if (filesystemPtrPtr != NULL) {
			    *filesystemPtrPtr = fsRecPtr->fsPtr;
			}
			if (driveNameLengthPtr != NULL) {
			    *driveNameLengthPtr = len;
			}







|





|


|







4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
		     * (but Tcl_Panic seems a bit excessive).
		     */

		    numVolumes = -1;
		}
		while (numVolumes > 0) {
		    Tcl_Obj *vol;
		    size_t len;
		    const char *strVol;

		    numVolumes--;
		    Tcl_ListObjIndex(NULL, thisFsVolumes, numVolumes, &vol);
		    strVol = TclGetStringFromObj(vol,&len);
		    if ((size_t) pathLen < len) {
			continue;
		    }
		    if (strncmp(strVol, path, len) == 0) {
			type = TCL_PATH_ABSOLUTE;
			if (filesystemPtrPtr != NULL) {
			    *filesystemPtrPtr = fsRecPtr->fsPtr;
			}
			if (driveNameLengthPtr != NULL) {
			    *driveNameLengthPtr = len;
			}
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
     */

    if (recursive) {
	Tcl_Obj *cwdPtr = Tcl_FSGetCwd(NULL);

	if (cwdPtr != NULL) {
	    const char *cwdStr, *normPathStr;
	    int cwdLen, normLen;
	    Tcl_Obj *normPath = Tcl_FSGetNormalizedPath(NULL, pathPtr);

	    if (normPath != NULL) {
		normPathStr = TclGetStringFromObj(normPath, &normLen);
		cwdStr = TclGetStringFromObj(cwdPtr, &cwdLen);
		if ((cwdLen >= normLen) && (strncmp(normPathStr, cwdStr,
			(size_t) normLen) == 0)) {
		    /*
		     * The cwd is inside the directory, so we perform a 'cd
		     * [file dirname $path]'.
		     */

		    Tcl_Obj *dirPtr = TclPathPart(NULL, pathPtr,
			    TCL_PATH_DIRNAME);







|






|







4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
     */

    if (recursive) {
	Tcl_Obj *cwdPtr = Tcl_FSGetCwd(NULL);

	if (cwdPtr != NULL) {
	    const char *cwdStr, *normPathStr;
	    size_t cwdLen, normLen;
	    Tcl_Obj *normPath = Tcl_FSGetNormalizedPath(NULL, pathPtr);

	    if (normPath != NULL) {
		normPathStr = TclGetStringFromObj(normPath, &normLen);
		cwdStr = TclGetStringFromObj(cwdPtr, &cwdLen);
		if ((cwdLen >= normLen) && (strncmp(normPathStr, cwdStr,
			normLen) == 0)) {
		    /*
		     * The cwd is inside the directory, so we perform a 'cd
		     * [file dirname $path]'.
		     */

		    Tcl_Obj *dirPtr = TclPathPart(NULL, pathPtr,
			    TCL_PATH_DIRNAME);
Changes to generic/tclIndexObj.c.
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
	     */

	    Tcl_Free(tablePtr);
	    *indexPtr = t;
	    return TCL_OK;
	}

	tablePtr[t] = Tcl_GetString(objv[t]);
    }
    tablePtr[objc] = NULL;

    result = Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr,
	    sizeof(char *), msg, flags | INDEX_TEMP_TABLE, indexPtr);

    Tcl_Free(tablePtr);







|







139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
	     */

	    Tcl_Free(tablePtr);
	    *indexPtr = t;
	    return TCL_OK;
	}

	tablePtr[t] = TclGetString(objv[t]);
    }
    tablePtr[objc] = NULL;

    result = Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr,
	    sizeof(char *), msg, flags | INDEX_TEMP_TABLE, indexPtr);

    Tcl_Free(tablePtr);
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
	offset = sizeof(char *);
    }
    /*
     * See if there is a valid cached result from a previous lookup.
     */

    if (!(flags & INDEX_TEMP_TABLE)) {
    irPtr = Tcl_FetchIntRep(objPtr, &indexType);
    if (irPtr) {
	indexRep = irPtr->twoPtrValue.ptr1;
	if (indexRep->tablePtr==tablePtr && indexRep->offset==offset) {
	    *indexPtr = indexRep->index;
	    return TCL_OK;
	}
    }







|







209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
	offset = sizeof(char *);
    }
    /*
     * See if there is a valid cached result from a previous lookup.
     */

    if (!(flags & INDEX_TEMP_TABLE)) {
    irPtr = TclFetchIntRep(objPtr, &indexType);
    if (irPtr) {
	indexRep = irPtr->twoPtrValue.ptr1;
	if (indexRep->tablePtr==tablePtr && indexRep->offset==offset) {
	    *indexPtr = indexRep->index;
	    return TCL_OK;
	}
    }
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
    /*
     * Cache the found representation. Note that we want to avoid allocating a
     * new internal-rep if at all possible since that is potentially a slow
     * operation.
     */

    if (!(flags & INDEX_TEMP_TABLE)) {
    irPtr = Tcl_FetchIntRep(objPtr, &indexType);
    if (irPtr) {
	indexRep = irPtr->twoPtrValue.ptr1;
    } else {
	Tcl_ObjIntRep ir;

	indexRep = Tcl_Alloc(sizeof(IndexRep));
	ir.twoPtrValue.ptr1 = indexRep;







|







273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
    /*
     * Cache the found representation. Note that we want to avoid allocating a
     * new internal-rep if at all possible since that is potentially a slow
     * operation.
     */

    if (!(flags & INDEX_TEMP_TABLE)) {
    irPtr = TclFetchIntRep(objPtr, &indexType);
    if (irPtr) {
	indexRep = irPtr->twoPtrValue.ptr1;
    } else {
	Tcl_ObjIntRep ir;

	indexRep = Tcl_Alloc(sizeof(IndexRep));
	ir.twoPtrValue.ptr1 = indexRep;
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
 *----------------------------------------------------------------------
 */

static void
UpdateStringOfIndex(
    Tcl_Obj *objPtr)
{
    IndexRep *indexRep = Tcl_FetchIntRep(objPtr, &indexType)->twoPtrValue.ptr1;
    register const char *indexStr = EXPAND_OF(indexRep);

    Tcl_InitStringRep(objPtr, indexStr, strlen(indexStr));
}

/*
 *----------------------------------------------------------------------







|







384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
 *----------------------------------------------------------------------
 */

static void
UpdateStringOfIndex(
    Tcl_Obj *objPtr)
{
    IndexRep *indexRep = TclFetchIntRep(objPtr, &indexType)->twoPtrValue.ptr1;
    register const char *indexStr = EXPAND_OF(indexRep);

    Tcl_InitStringRep(objPtr, indexStr, strlen(indexStr));
}

/*
 *----------------------------------------------------------------------
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
DupIndex(
    Tcl_Obj *srcPtr,
    Tcl_Obj *dupPtr)
{
    Tcl_ObjIntRep ir;
    IndexRep *dupIndexRep = Tcl_Alloc(sizeof(IndexRep));

    memcpy(dupIndexRep, Tcl_FetchIntRep(srcPtr, &indexType)->twoPtrValue.ptr1,
	    sizeof(IndexRep));

    ir.twoPtrValue.ptr1 = dupIndexRep;
    Tcl_StoreIntRep(dupPtr, &indexType, &ir);
}

/*







|







416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
DupIndex(
    Tcl_Obj *srcPtr,
    Tcl_Obj *dupPtr)
{
    Tcl_ObjIntRep ir;
    IndexRep *dupIndexRep = Tcl_Alloc(sizeof(IndexRep));

    memcpy(dupIndexRep, TclFetchIntRep(srcPtr, &indexType)->twoPtrValue.ptr1,
	    sizeof(IndexRep));

    ir.twoPtrValue.ptr1 = dupIndexRep;
    Tcl_StoreIntRep(dupPtr, &indexType, &ir);
}

/*
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
 *----------------------------------------------------------------------
 */

static void
FreeIndex(
    Tcl_Obj *objPtr)
{
    Tcl_Free(Tcl_FetchIntRep(objPtr, &indexType)->twoPtrValue.ptr1);
    objPtr->typePtr = NULL;
}

/*
 *----------------------------------------------------------------------
 *
 * TclInitPrefixCmd --







|







444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
 *----------------------------------------------------------------------
 */

static void
FreeIndex(
    Tcl_Obj *objPtr)
{
    Tcl_Free(TclFetchIntRep(objPtr, &indexType)->twoPtrValue.ptr1);
    objPtr->typePtr = NULL;
}

/*
 *----------------------------------------------------------------------
 *
 * TclInitPrefixCmd --
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
	    if (i > objc-4) {
		Tcl_SetObjResult(interp, Tcl_NewStringObj(
			"missing value for -message", -1));
		Tcl_SetErrorCode(interp, "TCL", "OPERATION", "NOARG", NULL);
		return TCL_ERROR;
	    }
	    i++;
	    message = Tcl_GetString(objv[i]);
	    break;
	case PRFMATCH_ERROR:
	    if (i > objc-4) {
		Tcl_SetObjResult(interp, Tcl_NewStringObj(
			"missing value for -error", -1));
		Tcl_SetErrorCode(interp, "TCL", "OPERATION", "NOARG", NULL);
		return TCL_ERROR;







|







540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
	    if (i > objc-4) {
		Tcl_SetObjResult(interp, Tcl_NewStringObj(
			"missing value for -message", -1));
		Tcl_SetErrorCode(interp, "TCL", "OPERATION", "NOARG", NULL);
		return TCL_ERROR;
	    }
	    i++;
	    message = TclGetString(objv[i]);
	    break;
	case PRFMATCH_ERROR:
	    if (i > objc-4) {
		Tcl_SetObjResult(interp, Tcl_NewStringObj(
			"missing value for -error", -1));
		Tcl_SetErrorCode(interp, "TCL", "OPERATION", "NOARG", NULL);
		return TCL_ERROR;
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887

	for (i=0 ; i<toPrint ; i++) {
	    /*
	     * Add the element, quoting it if necessary.
	     */
	    const Tcl_ObjIntRep *irPtr;

	    if ((irPtr = Tcl_FetchIntRep(origObjv[i], &indexType))) {
		register IndexRep *indexRep = irPtr->twoPtrValue.ptr1;

		elementStr = EXPAND_OF(indexRep);
		elemLen = strlen(elementStr);
	    } else {
		elementStr = TclGetStringFromObj(origObjv[i], &elemLen);
	    }







|







873
874
875
876
877
878
879
880
881
882
883
884
885
886
887

	for (i=0 ; i<toPrint ; i++) {
	    /*
	     * Add the element, quoting it if necessary.
	     */
	    const Tcl_ObjIntRep *irPtr;

	    if ((irPtr = TclFetchIntRep(origObjv[i], &indexType))) {
		register IndexRep *indexRep = irPtr->twoPtrValue.ptr1;

		elementStr = EXPAND_OF(indexRep);
		elemLen = strlen(elementStr);
	    } else {
		elementStr = TclGetStringFromObj(origObjv[i], &elemLen);
	    }
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
	/*
	 * If the object is an index type use the index table which allows for
	 * the correct error message even if the subcommand was abbreviated.
	 * Otherwise, just use the string rep.
	 */
	const Tcl_ObjIntRep *irPtr;

	if ((irPtr = Tcl_FetchIntRep(objv[i], &indexType))) {
	    register IndexRep *indexRep = irPtr->twoPtrValue.ptr1;

	    Tcl_AppendStringsToObj(objPtr, EXPAND_OF(indexRep), NULL);
	} else {
	    /*
	     * Quote the argument if it contains spaces (Bug 942757).
	     */







|







920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
	/*
	 * If the object is an index type use the index table which allows for
	 * the correct error message even if the subcommand was abbreviated.
	 * Otherwise, just use the string rep.
	 */
	const Tcl_ObjIntRep *irPtr;

	if ((irPtr = TclFetchIntRep(objv[i], &indexType))) {
	    register IndexRep *indexRep = irPtr->twoPtrValue.ptr1;

	    Tcl_AppendStringsToObj(objPtr, EXPAND_OF(indexRep), NULL);
	} else {
	    /*
	     * Quote the argument if it contains spaces (Bug 942757).
	     */
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
	    if (objc == 0) {
		goto missingArg;
	    }
	    if (Tcl_GetIntFromObj(interp, objv[srcIndex],
		    (int *) infoPtr->dstPtr) == TCL_ERROR) {
		Tcl_SetObjResult(interp, Tcl_ObjPrintf(
			"expected integer argument for \"%s\" but got \"%s\"",
			infoPtr->keyStr, Tcl_GetString(objv[srcIndex])));
		goto error;
	    }
	    srcIndex++;
	    objc--;
	    break;
	case TCL_ARGV_STRING:
	    if (objc == 0) {
		goto missingArg;
	    }
	    *((const char **) infoPtr->dstPtr) =
		    Tcl_GetString(objv[srcIndex]);
	    srcIndex++;
	    objc--;
	    break;
	case TCL_ARGV_REST:
	    /*
	     * Only store the point where we got to if it's not to be written
	     * to NULL, so that TCL_ARGV_AUTO_REST works.







|










|







1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
	    if (objc == 0) {
		goto missingArg;
	    }
	    if (Tcl_GetIntFromObj(interp, objv[srcIndex],
		    (int *) infoPtr->dstPtr) == TCL_ERROR) {
		Tcl_SetObjResult(interp, Tcl_ObjPrintf(
			"expected integer argument for \"%s\" but got \"%s\"",
			infoPtr->keyStr, TclGetString(objv[srcIndex])));
		goto error;
	    }
	    srcIndex++;
	    objc--;
	    break;
	case TCL_ARGV_STRING:
	    if (objc == 0) {
		goto missingArg;
	    }
	    *((const char **) infoPtr->dstPtr) =
		    TclGetString(objv[srcIndex]);
	    srcIndex++;
	    objc--;
	    break;
	case TCL_ARGV_REST:
	    /*
	     * Only store the point where we got to if it's not to be written
	     * to NULL, so that TCL_ARGV_AUTO_REST works.
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
	    if (objc == 0) {
		goto missingArg;
	    }
	    if (Tcl_GetDoubleFromObj(interp, objv[srcIndex],
		    (double *) infoPtr->dstPtr) == TCL_ERROR) {
		Tcl_SetObjResult(interp, Tcl_ObjPrintf(
			"expected floating-point argument for \"%s\" but got \"%s\"",
			infoPtr->keyStr, Tcl_GetString(objv[srcIndex])));
		goto error;
	    }
	    srcIndex++;
	    objc--;
	    break;
	case TCL_ARGV_FUNC: {
	    Tcl_ArgvFuncProc *handlerProc = (Tcl_ArgvFuncProc *)







|







1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
	    if (objc == 0) {
		goto missingArg;
	    }
	    if (Tcl_GetDoubleFromObj(interp, objv[srcIndex],
		    (double *) infoPtr->dstPtr) == TCL_ERROR) {
		Tcl_SetObjResult(interp, Tcl_ObjPrintf(
			"expected floating-point argument for \"%s\" but got \"%s\"",
			infoPtr->keyStr, TclGetString(objv[srcIndex])));
		goto error;
	    }
	    srcIndex++;
	    objc--;
	    break;
	case TCL_ARGV_FUNC: {
	    Tcl_ArgvFuncProc *handlerProc = (Tcl_ArgvFuncProc *)
Changes to generic/tclInt.h.
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
 */

typedef struct CompiledLocal {
    struct CompiledLocal *nextPtr;
				/* Next compiler-recognized local variable for
				 * this procedure, or NULL if this is the last
				 * local. */
    int nameLength;		/* The number of characters in local
				 * variable's name. Used to speed up variable
				 * lookups. */
    int frameIndex;		/* Index in the array of compiler-assigned
				 * variables in the procedure call frame. */
    int flags;			/* Flag bits for the local variable. Same as
				 * the flags for the Var structure above,
				 * although only VAR_ARGUMENT, VAR_TEMPORARY,
				 * and VAR_RESOLVED make sense. */
    Tcl_Obj *defValuePtr;	/* Pointer to the default value of an







|
|
<







917
918
919
920
921
922
923
924
925

926
927
928
929
930
931
932
 */

typedef struct CompiledLocal {
    struct CompiledLocal *nextPtr;
				/* Next compiler-recognized local variable for
				 * this procedure, or NULL if this is the last
				 * local. */
    size_t nameLength;		/* The number of bytes in local variable's name.
				 * Among others used to speed up var lookups. */

    int frameIndex;		/* Index in the array of compiler-assigned
				 * variables in the procedure call frame. */
    int flags;			/* Flag bits for the local variable. Same as
				 * the flags for the Var structure above,
				 * although only VAR_ARGUMENT, VAR_TEMPORARY,
				 * and VAR_RESOLVED make sense. */
    Tcl_Obj *defValuePtr;	/* Pointer to the default value of an
2676
2677
2678
2679
2680
2681
2682

2683
2684
2685
2686
2687
2688
2689
/*
 * Variables denoting the Tcl object types defined in the core.
 */

MODULE_SCOPE const Tcl_ObjType tclBignumType;
MODULE_SCOPE const Tcl_ObjType tclBooleanType;
MODULE_SCOPE const Tcl_ObjType tclByteArrayType;

MODULE_SCOPE const Tcl_ObjType tclByteCodeType;
MODULE_SCOPE const Tcl_ObjType tclDoubleType;
MODULE_SCOPE const Tcl_ObjType tclIntType;
MODULE_SCOPE const Tcl_ObjType tclListType;
MODULE_SCOPE const Tcl_ObjType tclDictType;
MODULE_SCOPE const Tcl_ObjType tclProcBodyType;
MODULE_SCOPE const Tcl_ObjType tclStringType;







>







2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
/*
 * Variables denoting the Tcl object types defined in the core.
 */

MODULE_SCOPE const Tcl_ObjType tclBignumType;
MODULE_SCOPE const Tcl_ObjType tclBooleanType;
MODULE_SCOPE const Tcl_ObjType tclByteArrayType;
MODULE_SCOPE const Tcl_ObjType tclPureByteArrayType;
MODULE_SCOPE const Tcl_ObjType tclByteCodeType;
MODULE_SCOPE const Tcl_ObjType tclDoubleType;
MODULE_SCOPE const Tcl_ObjType tclIntType;
MODULE_SCOPE const Tcl_ObjType tclListType;
MODULE_SCOPE const Tcl_ObjType tclDictType;
MODULE_SCOPE const Tcl_ObjType tclProcBodyType;
MODULE_SCOPE const Tcl_ObjType tclStringType;
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
MODULE_SCOPE void	TclInitIOSubsystem(void);
MODULE_SCOPE void	TclInitLimitSupport(Tcl_Interp *interp);
MODULE_SCOPE void	TclInitNamespaceSubsystem(void);
MODULE_SCOPE void	TclInitNotifier(void);
MODULE_SCOPE void	TclInitObjSubsystem(void);
MODULE_SCOPE void	TclInitSubsystems(void);
MODULE_SCOPE int	TclInterpReady(Tcl_Interp *interp);
MODULE_SCOPE int	TclIsSpaceProc(char byte);
MODULE_SCOPE int	TclIsBareword(char byte);
MODULE_SCOPE Tcl_Obj *	TclJoinPath(int elements, Tcl_Obj * const objv[],
			    int forceRelative);
MODULE_SCOPE int	TclJoinThread(Tcl_ThreadId id, int *result);
MODULE_SCOPE void	TclLimitRemoveAllHandlers(Tcl_Interp *interp);
MODULE_SCOPE Tcl_Obj *	TclLindexList(Tcl_Interp *interp,
			    Tcl_Obj *listPtr, Tcl_Obj *argPtr);
MODULE_SCOPE Tcl_Obj *	TclLindexFlat(Tcl_Interp *interp, Tcl_Obj *listPtr,







|
|







3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
MODULE_SCOPE void	TclInitIOSubsystem(void);
MODULE_SCOPE void	TclInitLimitSupport(Tcl_Interp *interp);
MODULE_SCOPE void	TclInitNamespaceSubsystem(void);
MODULE_SCOPE void	TclInitNotifier(void);
MODULE_SCOPE void	TclInitObjSubsystem(void);
MODULE_SCOPE void	TclInitSubsystems(void);
MODULE_SCOPE int	TclInterpReady(Tcl_Interp *interp);
MODULE_SCOPE int	TclIsSpaceProc(int byte);
MODULE_SCOPE int	TclIsBareword(int byte);
MODULE_SCOPE Tcl_Obj *	TclJoinPath(int elements, Tcl_Obj * const objv[],
			    int forceRelative);
MODULE_SCOPE int	TclJoinThread(Tcl_ThreadId id, int *result);
MODULE_SCOPE void	TclLimitRemoveAllHandlers(Tcl_Interp *interp);
MODULE_SCOPE Tcl_Obj *	TclLindexList(Tcl_Interp *interp,
			    Tcl_Obj *listPtr, Tcl_Obj *argPtr);
MODULE_SCOPE Tcl_Obj *	TclLindexFlat(Tcl_Interp *interp, Tcl_Obj *listPtr,
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
			    const char *trim, size_t numTrim);
MODULE_SCOPE const char*TclGetCommandTypeName(Tcl_Command command);
MODULE_SCOPE void	TclRegisterCommandTypeName(
			    Tcl_ObjCmdProc *implementationProc,
			    const char *nameStr);
MODULE_SCOPE int	TclUtfCmp(const char *cs, const char *ct);
MODULE_SCOPE int	TclUtfCasecmp(const char *cs, const char *ct);
MODULE_SCOPE int	TclUtfCount(int ch);
MODULE_SCOPE Tcl_Obj *	TclpNativeToNormalized(void *clientData);
MODULE_SCOPE Tcl_Obj *	TclpFilesystemPathType(Tcl_Obj *pathPtr);
MODULE_SCOPE int	TclpDlopen(Tcl_Interp *interp, Tcl_Obj *pathPtr,
			    Tcl_LoadHandle *loadHandle,
			    Tcl_FSUnloadFileProc **unloadProcPtr, int flags);
MODULE_SCOPE int	TclpUtime(Tcl_Obj *pathPtr, struct utimbuf *tval);
#ifdef TCL_LOAD_FROM_MEMORY







|







3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
			    const char *trim, size_t numTrim);
MODULE_SCOPE const char*TclGetCommandTypeName(Tcl_Command command);
MODULE_SCOPE void	TclRegisterCommandTypeName(
			    Tcl_ObjCmdProc *implementationProc,
			    const char *nameStr);
MODULE_SCOPE int	TclUtfCmp(const char *cs, const char *ct);
MODULE_SCOPE int	TclUtfCasecmp(const char *cs, const char *ct);
MODULE_SCOPE size_t TclUtfCount(int ch);
MODULE_SCOPE Tcl_Obj *	TclpNativeToNormalized(void *clientData);
MODULE_SCOPE Tcl_Obj *	TclpFilesystemPathType(Tcl_Obj *pathPtr);
MODULE_SCOPE int	TclpDlopen(Tcl_Interp *interp, Tcl_Obj *pathPtr,
			    Tcl_LoadHandle *loadHandle,
			    Tcl_FSUnloadFileProc **unloadProcPtr, int flags);
MODULE_SCOPE int	TclpUtime(Tcl_Obj *pathPtr, struct utimbuf *tval);
#ifdef TCL_LOAD_FROM_MEMORY
4380
4381
4382
4383
4384
4385
4386

4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
   static inline unsigned char *TclGetByteArrayFromObj(Tcl_Obj *objPtr, size_t *lenPtr) {
      unsigned char *response = Tcl_GetByteArrayFromObj(objPtr, NULL);
      *(lenPtr) = *((size_t *) (objPtr)->internalRep.twoPtrValue.ptr1);
      return response;
   }

#else

#define TclGetStringFromObj(objPtr, lenPtr) \
    (((objPtr)->bytes \
	    ? 0 : Tcl_GetString((objPtr)), \
	    *(lenPtr) = (objPtr)->length, (objPtr)->bytes))
#define TclGetUnicodeFromObj(objPtr, lenPtr) \
    (Tcl_GetUnicodeFromObj(objPtr, NULL), \
	    *(lenPtr) = *((size_t *) (objPtr)->internalRep.twoPtrValue.ptr1), \
	    Tcl_GetUnicodeFromObj(objPtr, NULL))
#define TclGetByteArrayFromObj(objPtr, lenPtr) \
    (Tcl_GetByteArrayFromObj(objPtr, NULL), \
	    *(lenPtr) = *((size_t *) (objPtr)->internalRep.twoPtrValue.ptr1), \
	    Tcl_GetByteArrayFromObj(objPtr, NULL))
#endif

/*
 *----------------------------------------------------------------
 * Macro used by the Tcl core to clean out an object's internal
 * representation. Does not actually reset the rep's bytes. The ANSI C
 * "prototype" for this macro is:







>







|



|







4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
   static inline unsigned char *TclGetByteArrayFromObj(Tcl_Obj *objPtr, size_t *lenPtr) {
      unsigned char *response = Tcl_GetByteArrayFromObj(objPtr, NULL);
      *(lenPtr) = *((size_t *) (objPtr)->internalRep.twoPtrValue.ptr1);
      return response;
   }

#else
#include "tclStringRep.h"
#define TclGetStringFromObj(objPtr, lenPtr) \
    (((objPtr)->bytes \
	    ? 0 : Tcl_GetString((objPtr)), \
	    *(lenPtr) = (objPtr)->length, (objPtr)->bytes))
#define TclGetUnicodeFromObj(objPtr, lenPtr) \
    (Tcl_GetUnicodeFromObj(objPtr, NULL), \
	    *(lenPtr) = *((size_t *) (objPtr)->internalRep.twoPtrValue.ptr1), \
	    ((String *)(objPtr)->internalRep.twoPtrValue.ptr1)->unicode)
#define TclGetByteArrayFromObj(objPtr, lenPtr) \
    (Tcl_GetByteArrayFromObj(objPtr, NULL), \
	    *(lenPtr) = *((size_t *) (objPtr)->internalRep.twoPtrValue.ptr1), \
	    (unsigned char *)(((size_t *) (objPtr)->internalRep.twoPtrValue.ptr1) + 2))
#endif

/*
 *----------------------------------------------------------------
 * Macro used by the Tcl core to clean out an object's internal
 * representation. Does not actually reset the rep's bytes. The ANSI C
 * "prototype" for this macro is:
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
	    if (oldPtr == (staticPtr)) {				\
		oldPtr = NULL;						\
	    }								\
	    if (allocated > TCL_MAX_TOKENS) {				\
		allocated = TCL_MAX_TOKENS;				\
	    }								\
	    newPtr = (Tcl_Token *) Tcl_AttemptRealloc((char *) oldPtr,	\
		    (unsigned int) (allocated * sizeof(Tcl_Token)));	\
	    if (newPtr == NULL) {					\
		allocated = _needed + (append) + TCL_MIN_TOKEN_GROWTH;	\
		if (allocated > TCL_MAX_TOKENS) {			\
		    allocated = TCL_MAX_TOKENS;				\
		}							\
		newPtr = (Tcl_Token *) Tcl_Realloc((char *) oldPtr,	\
			(unsigned int) (allocated * sizeof(Tcl_Token))); \
	    }								\
	    (available) = allocated;					\
	    if (oldPtr == NULL) {					\
		memcpy(newPtr, staticPtr,				\
			(size_t) ((used) * sizeof(Tcl_Token)));		\
	    }								\
	    (tokenPtr) = newPtr;					\
	}								\
    } while (0)

#define TclGrowParseTokenArray(parsePtr, append)			\
    TclGrowTokenArray((parsePtr)->tokenPtr, (parsePtr)->numTokens,	\







|






|




|







4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
	    if (oldPtr == (staticPtr)) {				\
		oldPtr = NULL;						\
	    }								\
	    if (allocated > TCL_MAX_TOKENS) {				\
		allocated = TCL_MAX_TOKENS;				\
	    }								\
	    newPtr = (Tcl_Token *) Tcl_AttemptRealloc((char *) oldPtr,	\
		    (allocated * sizeof(Tcl_Token)));	\
	    if (newPtr == NULL) {					\
		allocated = _needed + (append) + TCL_MIN_TOKEN_GROWTH;	\
		if (allocated > TCL_MAX_TOKENS) {			\
		    allocated = TCL_MAX_TOKENS;				\
		}							\
		newPtr = (Tcl_Token *) Tcl_Realloc((char *) oldPtr,	\
			(allocated * sizeof(Tcl_Token))); \
	    }								\
	    (available) = allocated;					\
	    if (oldPtr == NULL) {					\
		memcpy(newPtr, staticPtr,				\
			((used) * sizeof(Tcl_Token)));		\
	    }								\
	    (tokenPtr) = newPtr;					\
	}								\
    } while (0)

#define TclGrowParseTokenArray(parsePtr, append)			\
    TclGrowTokenArray((parsePtr)->tokenPtr, (parsePtr)->numTokens,	\
4568
4569
4570
4571
4572
4573
4574
4575

4576
4577


4578
4579
4580
4581
4582
4583
4584
 * but we don't do that at the moment since this is purely about efficiency.
 * The ANSI C "prototype" for this macro is:
 *
 * MODULE_SCOPE int	TclIsPureByteArray(Tcl_Obj *objPtr);
 *----------------------------------------------------------------
 */

MODULE_SCOPE int	TclIsPureByteArray(Tcl_Obj *objPtr);

#define TclIsPureDict(objPtr) \
	(((objPtr)->bytes==NULL) && ((objPtr)->typePtr==&tclDictType))




/*
 *----------------------------------------------------------------
 * Macro used by the Tcl core to compare Unicode strings. On big-endian
 * systems we can use the more efficient memcmp, but this would not be
 * lexically correct on little-endian systems. The ANSI C "prototype" for







|
>


>
>







4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
 * but we don't do that at the moment since this is purely about efficiency.
 * The ANSI C "prototype" for this macro is:
 *
 * MODULE_SCOPE int	TclIsPureByteArray(Tcl_Obj *objPtr);
 *----------------------------------------------------------------
 */

#define TclIsPureByteArray(objPtr) \
	((objPtr)->typePtr==&tclPureByteArrayType)
#define TclIsPureDict(objPtr) \
	(((objPtr)->bytes==NULL) && ((objPtr)->typePtr==&tclDictType))
#define TclFetchIntRep(objPtr, type) \
	(((objPtr)->typePtr == type) ? &((objPtr)->internalRep) : NULL)


/*
 *----------------------------------------------------------------
 * Macro used by the Tcl core to compare Unicode strings. On big-endian
 * systems we can use the more efficient memcmp, but this would not be
 * lexically correct on little-endian systems. The ANSI C "prototype" for
Changes to generic/tclIntDecls.h.
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 */

#ifndef _TCLINTDECLS
#define _TCLINTDECLS

#include "tclPort.h"

#undef TCL_STORAGE_CLASS
#ifdef BUILD_tcl
#   define TCL_STORAGE_CLASS DLLEXPORT
#else
#   ifdef USE_TCL_STUBS
#      define TCL_STORAGE_CLASS







<







11
12
13
14
15
16
17

18
19
20
21
22
23
24
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 */

#ifndef _TCLINTDECLS
#define _TCLINTDECLS



#undef TCL_STORAGE_CLASS
#ifdef BUILD_tcl
#   define TCL_STORAGE_CLASS DLLEXPORT
#else
#   ifdef USE_TCL_STUBS
#      define TCL_STORAGE_CLASS
Changes to generic/tclInterp.c.
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
	/*
	 * Weird historical rules: "-safe" is accepted at the end, too.
	 */

	slavePtr = NULL;
	last = 0;
	for (i = 2; i < objc; i++) {
	    if ((last == 0) && (Tcl_GetString(objv[i])[0] == '-')) {
		if (Tcl_GetIndexFromObj(interp, objv[i], createOptions,
			"option", 0, &index) != TCL_OK) {
		    return TCL_ERROR;
		}
		if (index == OPT_SAFE) {
		    safe = 1;
		    continue;







|







782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
	/*
	 * Weird historical rules: "-safe" is accepted at the end, too.
	 */

	slavePtr = NULL;
	last = 0;
	for (i = 2; i < objc; i++) {
	    if ((last == 0) && (TclGetString(objv[i])[0] == '-')) {
		if (Tcl_GetIndexFromObj(interp, objv[i], createOptions,
			"option", 0, &index) != TCL_OK) {
		    return TCL_ERROR;
		}
		if (index == OPT_SAFE) {
		    safe = 1;
		    continue;
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
	aliasName = TclGetString(objv[3]);

	iiPtr = (InterpInfo *) ((Interp *) slaveInterp)->interpInfo;
	hPtr = Tcl_FindHashEntry(&iiPtr->slave.aliasTable, aliasName);
	if (hPtr == NULL) {
	    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		    "alias \"%s\" in path \"%s\" not found",
		    aliasName, Tcl_GetString(objv[2])));
	    Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ALIAS", aliasName,
		    NULL);
	    return TCL_ERROR;
	}
	aliasPtr = Tcl_GetHashValue(hPtr);
	if (Tcl_GetInterpPath(interp, aliasPtr->targetInterp) != TCL_OK) {
	    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		    "target interpreter for alias \"%s\" in path \"%s\" is "
		    "not my descendant", aliasName, Tcl_GetString(objv[2])));
	    Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP",
		    "TARGETSHROUDED", NULL);
	    return TCL_ERROR;
	}
	return TCL_OK;
    }
    }







|








|







1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
	aliasName = TclGetString(objv[3]);

	iiPtr = (InterpInfo *) ((Interp *) slaveInterp)->interpInfo;
	hPtr = Tcl_FindHashEntry(&iiPtr->slave.aliasTable, aliasName);
	if (hPtr == NULL) {
	    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		    "alias \"%s\" in path \"%s\" not found",
		    aliasName, TclGetString(objv[2])));
	    Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ALIAS", aliasName,
		    NULL);
	    return TCL_ERROR;
	}
	aliasPtr = Tcl_GetHashValue(hPtr);
	if (Tcl_GetInterpPath(interp, aliasPtr->targetInterp) != TCL_OK) {
	    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		    "target interpreter for alias \"%s\" in path \"%s\" is "
		    "not my descendant", aliasName, TclGetString(objv[2])));
	    Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP",
		    "TARGETSHROUDED", NULL);
	    return TCL_ERROR;
	}
	return TCL_OK;
    }
    }
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
    /*
     * If the alias has been renamed in the slave, the master can still use
     * the original name (with which it was created) to find the alias to
     * describe it.
     */

    slavePtr = &((InterpInfo *) ((Interp *) slaveInterp)->interpInfo)->slave;
    hPtr = Tcl_FindHashEntry(&slavePtr->aliasTable, Tcl_GetString(namePtr));
    if (hPtr == NULL) {
	return TCL_OK;
    }
    aliasPtr = Tcl_GetHashValue(hPtr);
    prefixPtr = Tcl_NewListObj(aliasPtr->objc, &aliasPtr->objPtr);
    Tcl_SetObjResult(interp, prefixPtr);
    return TCL_OK;







|







1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
    /*
     * If the alias has been renamed in the slave, the master can still use
     * the original name (with which it was created) to find the alias to
     * describe it.
     */

    slavePtr = &((InterpInfo *) ((Interp *) slaveInterp)->interpInfo)->slave;
    hPtr = Tcl_FindHashEntry(&slavePtr->aliasTable, TclGetString(namePtr));
    if (hPtr == NULL) {
	return TCL_OK;
    }
    aliasPtr = Tcl_GetHashValue(hPtr);
    prefixPtr = Tcl_NewListObj(aliasPtr->objc, &aliasPtr->objPtr);
    Tcl_SetObjResult(interp, prefixPtr);
    return TCL_OK;
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842

    listPtr = Tcl_NewListObj(cmdc, NULL);
    listRep = ListRepPtr(listPtr);
    listRep->elemCount = cmdc;
    cmdv = &listRep->elements;

    prefv = &aliasPtr->objPtr;
    memcpy(cmdv, prefv, (size_t) (prefc * sizeof(Tcl_Obj *)));
    memcpy(cmdv+prefc, objv+1, (size_t) ((objc-1) * sizeof(Tcl_Obj *)));

    for (i=0; i<cmdc; i++) {
	Tcl_IncrRefCount(cmdv[i]);
    }

    /*
     * Use the ensemble rewriting machinery to ensure correct error messages:







|
|







1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842

    listPtr = Tcl_NewListObj(cmdc, NULL);
    listRep = ListRepPtr(listPtr);
    listRep->elemCount = cmdc;
    cmdv = &listRep->elements;

    prefv = &aliasPtr->objPtr;
    memcpy(cmdv, prefv, (prefc * sizeof(Tcl_Obj *)));
    memcpy(cmdv+prefc, objv+1, ((objc-1) * sizeof(Tcl_Obj *)));

    for (i=0; i<cmdc; i++) {
	Tcl_IncrRefCount(cmdv[i]);
    }

    /*
     * Use the ensemble rewriting machinery to ensure correct error messages:
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
    cmdc = prefc + objc - 1;
    if (cmdc <= ALIAS_CMDV_PREALLOC) {
	cmdv = cmdArr;
    } else {
	cmdv = TclStackAlloc(interp, cmdc * sizeof(Tcl_Obj *));
    }

    memcpy(cmdv, prefv, (size_t) (prefc * sizeof(Tcl_Obj *)));
    memcpy(cmdv+prefc, objv+1, (size_t) ((objc-1) * sizeof(Tcl_Obj *)));

    Tcl_ResetResult(targetInterp);

    for (i=0; i<cmdc; i++) {
	Tcl_IncrRefCount(cmdv[i]);
    }








|
|







1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
    cmdc = prefc + objc - 1;
    if (cmdc <= ALIAS_CMDV_PREALLOC) {
	cmdv = cmdArr;
    } else {
	cmdv = TclStackAlloc(interp, cmdc * sizeof(Tcl_Obj *));
    }

    memcpy(cmdv, prefv, prefc * sizeof(Tcl_Obj *));
    memcpy(cmdv+prefc, objv+1, (objc-1) * sizeof(Tcl_Obj *));

    Tcl_ResetResult(targetInterp);

    for (i=0; i<cmdc; i++) {
	Tcl_IncrRefCount(cmdv[i]);
    }

1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
    cmdc = prefc + objc - 1;
    if (cmdc <= ALIAS_CMDV_PREALLOC) {
	cmdv = cmdArr;
    } else {
	cmdv = TclStackAlloc(interp, cmdc * sizeof(Tcl_Obj *));
    }

    memcpy(cmdv, prefv, (size_t) (prefc * sizeof(Tcl_Obj *)));
    memcpy(cmdv+prefc, objv+1, (size_t) ((objc-1) * sizeof(Tcl_Obj *)));

    for (i=0; i<cmdc; i++) {
	Tcl_IncrRefCount(cmdv[i]);
    }

    /*
     * Use the ensemble rewriting machinery to ensure correct error messages:







|
|







1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
    cmdc = prefc + objc - 1;
    if (cmdc <= ALIAS_CMDV_PREALLOC) {
	cmdv = cmdArr;
    } else {
	cmdv = TclStackAlloc(interp, cmdc * sizeof(Tcl_Obj *));
    }

    memcpy(cmdv, prefv, prefc * sizeof(Tcl_Obj *));
    memcpy(cmdv+prefc, objv+1, (objc-1) * sizeof(Tcl_Obj *));

    for (i=0; i<cmdc; i++) {
	Tcl_IncrRefCount(cmdv[i]);
    }

    /*
     * Use the ensemble rewriting machinery to ensure correct error messages:
Changes to generic/tclLink.c.
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
    if (flags & TCL_TRACE_UNSETS) {
	if (Tcl_InterpDeleted(interp)) {
	    Tcl_DecrRefCount(linkPtr->varName);
	    Tcl_Free(linkPtr);
	} else if (flags & TCL_TRACE_DESTROYED) {
	    Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
		    TCL_GLOBAL_ONLY);
	    Tcl_TraceVar2(interp, Tcl_GetString(linkPtr->varName), NULL,
		    TCL_GLOBAL_ONLY|TCL_TRACE_READS|TCL_TRACE_WRITES
		    |TCL_TRACE_UNSETS, LinkTraceProc, linkPtr);
	}
	return NULL;
    }

    /*







|







289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
    if (flags & TCL_TRACE_UNSETS) {
	if (Tcl_InterpDeleted(interp)) {
	    Tcl_DecrRefCount(linkPtr->varName);
	    Tcl_Free(linkPtr);
	} else if (flags & TCL_TRACE_DESTROYED) {
	    Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
		    TCL_GLOBAL_ONLY);
	    Tcl_TraceVar2(interp, TclGetString(linkPtr->varName), NULL,
		    TCL_GLOBAL_ONLY|TCL_TRACE_READS|TCL_TRACE_WRITES
		    |TCL_TRACE_UNSETS, LinkTraceProc, linkPtr);
	}
	return NULL;
    }

    /*
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
	}
	LinkedVar(Tcl_WideInt) = linkPtr->lastValue.w;
	break;

    case TCL_LINK_DOUBLE:
	if (Tcl_GetDoubleFromObj(NULL, valueObj, &linkPtr->lastValue.d) != TCL_OK) {
#ifdef ACCEPT_NAN
	    Tcl_ObjIntRep *irPtr = Tcl_FetchIntRep(valueObj, &tclDoubleType);
	    if (irPtr == NULL) {
#endif
		if (GetInvalidDoubleFromObj(valueObj, &linkPtr->lastValue.d) != TCL_OK) {
		    Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
			TCL_GLOBAL_ONLY);
		    return (char *) "variable must have real value";
		}







|







412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
	}
	LinkedVar(Tcl_WideInt) = linkPtr->lastValue.w;
	break;

    case TCL_LINK_DOUBLE:
	if (Tcl_GetDoubleFromObj(NULL, valueObj, &linkPtr->lastValue.d) != TCL_OK) {
#ifdef ACCEPT_NAN
	    Tcl_ObjIntRep *irPtr = TclFetchIntRep(valueObj, &tclDoubleType);
	    if (irPtr == NULL) {
#endif
		if (GetInvalidDoubleFromObj(valueObj, &linkPtr->lastValue.d) != TCL_OK) {
		    Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
			TCL_GLOBAL_ONLY);
		    return (char *) "variable must have real value";
		}
Changes to generic/tclListObj.c.
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
	(listRepPtr)->refCount++;					\
	Tcl_StoreIntRep((objPtr), &tclListType, &ir);			\
    } while (0)

#define ListGetIntRep(objPtr, listRepPtr)				\
    do {								\
	const Tcl_ObjIntRep *irPtr;					\
	irPtr = Tcl_FetchIntRep((objPtr), &tclListType);		\
	(listRepPtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL;		\
    } while (0)

#define ListResetIntRep(objPtr, listRepPtr) \
    Tcl_FetchIntRep((objPtr), &tclListType)->twoPtrValue.ptr1 = (listRepPtr)

#ifndef TCL_MIN_ELEMENT_GROWTH
#define TCL_MIN_ELEMENT_GROWTH TCL_MIN_GROWTH/sizeof(Tcl_Obj *)
#endif

/*
 *----------------------------------------------------------------------







|




|







57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
	(listRepPtr)->refCount++;					\
	Tcl_StoreIntRep((objPtr), &tclListType, &ir);			\
    } while (0)

#define ListGetIntRep(objPtr, listRepPtr)				\
    do {								\
	const Tcl_ObjIntRep *irPtr;					\
	irPtr = TclFetchIntRep((objPtr), &tclListType);		\
	(listRepPtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL;		\
    } while (0)

#define ListResetIntRep(objPtr, listRepPtr) \
    TclFetchIntRep((objPtr), &tclListType)->twoPtrValue.ptr1 = (listRepPtr)

#ifndef TCL_MIN_ELEMENT_GROWTH
#define TCL_MIN_ELEMENT_GROWTH TCL_MIN_GROWTH/sizeof(Tcl_Obj *)
#endif

/*
 *----------------------------------------------------------------------
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
	    }
	    listRepPtr->refCount--;
	} else {
	    /*
	     * Old intrep to be freed, re-use refCounts.
	     */

	    memcpy(dst, src, (size_t) numElems * sizeof(Tcl_Obj *));
	    Tcl_Free(listRepPtr);
	}
	listRepPtr = newPtr;
    }
    ListResetIntRep(listPtr, listRepPtr);
    listRepPtr->refCount++;
    TclFreeIntRep(listPtr);







|







761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
	    }
	    listRepPtr->refCount--;
	} else {
	    /*
	     * Old intrep to be freed, re-use refCounts.
	     */

	    memcpy(dst, src, numElems * sizeof(Tcl_Obj *));
	    Tcl_Free(listRepPtr);
	}
	listRepPtr = newPtr;
    }
    ListResetIntRep(listPtr, listRepPtr);
    listRepPtr->refCount++;
    TclFreeIntRep(listPtr);
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090

	start = first + count;
	numAfterLast = numElems - start;
	shift = objc - count;	/* numNewElems - numDeleted */
	if ((numAfterLast > 0) && (shift != 0)) {
	    Tcl_Obj **src = elemPtrs + start;

	    memmove(src+shift, src, (size_t) numAfterLast * sizeof(Tcl_Obj*));
	}
    } else {
	/*
	 * Cannot use the current List struct; it is shared, too small, or
	 * both. Allocate a new struct and insert elements into it.
	 */








|







1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090

	start = first + count;
	numAfterLast = numElems - start;
	shift = objc - count;	/* numNewElems - numDeleted */
	if ((numAfterLast > 0) && (shift != 0)) {
	    Tcl_Obj **src = elemPtrs + start;

	    memmove(src+shift, src, numAfterLast * sizeof(Tcl_Obj*));
	}
    } else {
	/*
	 * Cannot use the current List struct; it is shared, too small, or
	 * both. Allocate a new struct and insert elements into it.
	 */

1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
	    oldListRepPtr->refCount--;
	} else {
	    /*
	     * The old struct will be removed; use its inherited refCounts.
	     */

	    if (first > 0) {
		memcpy(elemPtrs, oldPtrs, (size_t) first * sizeof(Tcl_Obj *));
	    }

	    /*
	     * "Delete" count elements starting at first.
	     */

	    for (j = first;  j < first + count;  j++) {







|







1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
	    oldListRepPtr->refCount--;
	} else {
	    /*
	     * The old struct will be removed; use its inherited refCounts.
	     */

	    if (first > 0) {
		memcpy(elemPtrs, oldPtrs, first * sizeof(Tcl_Obj *));
	    }

	    /*
	     * "Delete" count elements starting at first.
	     */

	    for (j = first;  j < first + count;  j++) {
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
	     * variable.  Later on, when we set valuePtr in its proper place,
	     * then all containing lists will have their values changed, and
	     * will need their string reps spoiled.  We maintain a list of all
	     * those Tcl_Obj's (via a little intrep surgery) so we can spoil
	     * them at that time.
	     */

	    irPtr = Tcl_FetchIntRep(parentList, &tclListType);
	    irPtr->twoPtrValue.ptr2 = chainPtr;
	    chainPtr = parentList;
	}
    } while (indexCount > 0);

    /*
     * Either we've detected and error condition, and exited the loop with
     * result == TCL_ERROR, or we've successfully reached the last index, and
     * we're ready to store valuePtr.  In either case, we need to clean up our
     * string spoiling list of Tcl_Obj's.
     */

    while (chainPtr) {
	Tcl_Obj *objPtr = chainPtr;
	List *listRepPtr;

	/*
	 * Clear away our intrep surgery mess.
	 */

	irPtr = Tcl_FetchIntRep(objPtr, &tclListType);
	listRepPtr = irPtr->twoPtrValue.ptr1;
	chainPtr = irPtr->twoPtrValue.ptr2;

	if (result == TCL_OK) {

	    /*
	     * We're going to store valuePtr, so spoil string reps of all







|




















|







1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
	     * variable.  Later on, when we set valuePtr in its proper place,
	     * then all containing lists will have their values changed, and
	     * will need their string reps spoiled.  We maintain a list of all
	     * those Tcl_Obj's (via a little intrep surgery) so we can spoil
	     * them at that time.
	     */

	    irPtr = TclFetchIntRep(parentList, &tclListType);
	    irPtr->twoPtrValue.ptr2 = chainPtr;
	    chainPtr = parentList;
	}
    } while (indexCount > 0);

    /*
     * Either we've detected and error condition, and exited the loop with
     * result == TCL_ERROR, or we've successfully reached the last index, and
     * we're ready to store valuePtr.  In either case, we need to clean up our
     * string spoiling list of Tcl_Obj's.
     */

    while (chainPtr) {
	Tcl_Obj *objPtr = chainPtr;
	List *listRepPtr;

	/*
	 * Clear away our intrep surgery mess.
	 */

	irPtr = TclFetchIntRep(objPtr, &tclListType);
	listRepPtr = irPtr->twoPtrValue.ptr1;
	chainPtr = irPtr->twoPtrValue.ptr2;

	if (result == TCL_OK) {

	    /*
	     * We're going to store valuePtr, so spoil string reps of all
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
     * Dictionaries are a special case; they have a string representation such
     * that *all* valid dictionaries are valid lists. Hence we can convert
     * more directly. Only do this when there's no existing string rep; if
     * there is, it is the string rep that's authoritative (because it could
     * describe duplicate keys).
     */

    if (!TclHasStringRep(objPtr) && Tcl_FetchIntRep(objPtr, &tclDictType)) {
	Tcl_Obj *keyPtr, *valuePtr;
	Tcl_DictSearch search;
	int done, size;

	/*
	 * Create the new list representation. Note that we do not need to do
	 * anything with the string representation as the transformation (and







|







1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
     * Dictionaries are a special case; they have a string representation such
     * that *all* valid dictionaries are valid lists. Hence we can convert
     * more directly. Only do this when there's no existing string rep; if
     * there is, it is the string rep that's authoritative (because it could
     * describe duplicate keys).
     */

    if (!TclHasStringRep(objPtr) && (objPtr->typePtr == &tclDictType)) {
	Tcl_Obj *keyPtr, *valuePtr;
	Tcl_DictSearch search;
	int done, size;

	/*
	 * Create the new list representation. Note that we do not need to do
	 * anything with the string representation as the transformation (and
Changes to generic/tclLiteral.c.
196
197
198
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
    if (hash == TCL_AUTO_LENGTH) {
	hash = HashString(bytes, length);
    }
    globalHash = (hash & globalTablePtr->mask);
    for (globalPtr=globalTablePtr->buckets[globalHash] ; globalPtr!=NULL;
	    globalPtr = globalPtr->nextPtr) {
	objPtr = globalPtr->objPtr;
	if ((globalPtr->nsPtr == nsPtr)










		&& ((size_t)objPtr->length == length) && ((length == 0)
		|| ((objPtr->bytes[0] == bytes[0])
		&& (memcmp(objPtr->bytes, bytes, length) == 0)))) {
	    /*
	     * A literal was found: return it
	     */

	    if (newPtr) {
		*newPtr = 0;
	    }
	    if (globalPtrPtr) {
		*globalPtrPtr = globalPtr;
	    }
	    if ((flags & LITERAL_ON_HEAP)) {
		Tcl_Free((void *)bytes);
	    }
	    globalPtr->refCount++;
	    return objPtr;

	}
    }
    if (!newPtr) {
	if ((flags & LITERAL_ON_HEAP)) {
	    Tcl_Free((void *)bytes);
	}
	return NULL;







|
>
>
>
>
>
>
>
>
>
>
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
|
>







196
197
198
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
    if (hash == TCL_AUTO_LENGTH) {
	hash = HashString(bytes, length);
    }
    globalHash = (hash & globalTablePtr->mask);
    for (globalPtr=globalTablePtr->buckets[globalHash] ; globalPtr!=NULL;
	    globalPtr = globalPtr->nextPtr) {
	objPtr = globalPtr->objPtr;
	if (globalPtr->nsPtr == nsPtr) {
	    /*
	     * Literals should always have UTF-8 representations... but this
	     * is not guaranteed so we need to be careful anyway.
	     *
	     * https://stackoverflow.com/q/54337750/301832
	     */

	    size_t objLength;
	    char *objBytes = TclGetStringFromObj(objPtr, &objLength);

	    if ((objLength == length) && ((length == 0)
		    || ((objBytes[0] == bytes[0])
		    && (memcmp(objBytes, bytes, (unsigned) length) == 0)))) {
		/*
		 * A literal was found: return it
		 */

		if (newPtr) {
		    *newPtr = 0;
		}
		if (globalPtrPtr) {
		    *globalPtrPtr = globalPtr;
		}
		if (flags & LITERAL_ON_HEAP) {
		    Tcl_Free((void *)bytes);
		}
		globalPtr->refCount++;
		return objPtr;
	    }
	}
    }
    if (!newPtr) {
	if ((flags & LITERAL_ON_HEAP)) {
	    Tcl_Free((void *)bytes);
	}
	return NULL;
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
    register CompileEnv *envPtr,/* Points to CompileEnv whose literal array
				 * contains the entry being hidden. */
    int index)			/* The index of the entry in the literal
				 * array. */
{
    LiteralEntry **nextPtrPtr, *entryPtr, *lPtr;
    LiteralTable *localTablePtr = &envPtr->localLitTable;
    size_t localHash;
    size_t length;
    const char *bytes;
    Tcl_Obj *newObjPtr;

    lPtr = &envPtr->literalArrayPtr[index];

    /*
     * To avoid unwanted sharing we need to copy the object and remove it from
     * the local and global literal tables. It still has a slot in the literal
     * array so it can be referred to by byte codes, but it will not be
     * matched by literal searches.
     */

    newObjPtr = Tcl_DuplicateObj(lPtr->objPtr);
    Tcl_IncrRefCount(newObjPtr);
    TclReleaseLiteral(interp, lPtr->objPtr);
    lPtr->objPtr = newObjPtr;

    bytes = TclGetString(newObjPtr);
    length = newObjPtr->length;
    localHash = HashString(bytes, length) & localTablePtr->mask;
    nextPtrPtr = &localTablePtr->buckets[localHash];

    for (entryPtr=*nextPtrPtr ; entryPtr!=NULL ; entryPtr=*nextPtrPtr) {
	if (entryPtr == lPtr) {
	    *nextPtrPtr = lPtr->nextPtr;
	    lPtr->nextPtr = NULL;







|
<

















|
<







545
546
547
548
549
550
551
552

553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570

571
572
573
574
575
576
577
    register CompileEnv *envPtr,/* Points to CompileEnv whose literal array
				 * contains the entry being hidden. */
    int index)			/* The index of the entry in the literal
				 * array. */
{
    LiteralEntry **nextPtrPtr, *entryPtr, *lPtr;
    LiteralTable *localTablePtr = &envPtr->localLitTable;
    size_t localHash, length;

    const char *bytes;
    Tcl_Obj *newObjPtr;

    lPtr = &envPtr->literalArrayPtr[index];

    /*
     * To avoid unwanted sharing we need to copy the object and remove it from
     * the local and global literal tables. It still has a slot in the literal
     * array so it can be referred to by byte codes, but it will not be
     * matched by literal searches.
     */

    newObjPtr = Tcl_DuplicateObj(lPtr->objPtr);
    Tcl_IncrRefCount(newObjPtr);
    TclReleaseLiteral(interp, lPtr->objPtr);
    lPtr->objPtr = newObjPtr;

    bytes = TclGetStringFromObj(newObjPtr, &length);

    localHash = HashString(bytes, length) & localTablePtr->mask;
    nextPtrPtr = &localTablePtr->buckets[localHash];

    for (entryPtr=*nextPtrPtr ; entryPtr!=NULL ; entryPtr=*nextPtrPtr) {
	if (entryPtr == lPtr) {
	    *nextPtrPtr = lPtr->nextPtr;
	    lPtr->nextPtr = NULL;
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
		if (localPtr->objPtr == objPtr) {
		    found = 1;
		}
	    }
	}

	if (!found) {
	    bytes = TclGetString(objPtr);
	    length = objPtr->length;
	    Tcl_Panic("%s: literal \"%.*s\" wasn't found locally",
		    "AddLocalLiteralEntry", (length>60? 60 : (int)length), bytes);
	}
    }
#endif /*TCL_COMPILE_DEBUG*/

    return objIndex;







|
<







696
697
698
699
700
701
702
703

704
705
706
707
708
709
710
		if (localPtr->objPtr == objPtr) {
		    found = 1;
		}
	    }
	}

	if (!found) {
	    bytes = TclGetStringFromObj(objPtr, &length);

	    Tcl_Panic("%s: literal \"%.*s\" wasn't found locally",
		    "AddLocalLiteralEntry", (length>60? 60 : (int)length), bytes);
	}
    }
#endif /*TCL_COMPILE_DEBUG*/

    return objIndex;
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
    size_t length, index;

    if (iPtr == NULL) {
	goto done;
    }

    globalTablePtr = &iPtr->literalTable;
    bytes = TclGetString(objPtr);
    length = objPtr->length;
    index = HashString(bytes, length) & globalTablePtr->mask;

    /*
     * Check to see if the object is in the global literal table and remove
     * this reference. The object may not be in the table if it is a hidden
     * local literal.
     */







|
<







825
826
827
828
829
830
831
832

833
834
835
836
837
838
839
    size_t length, index;

    if (iPtr == NULL) {
	goto done;
    }

    globalTablePtr = &iPtr->literalTable;
    bytes = TclGetStringFromObj(objPtr, &length);

    index = HashString(bytes, length) & globalTablePtr->mask;

    /*
     * Check to see if the object is in the global literal table and remove
     * this reference. The object may not be in the table if it is a hidden
     * local literal.
     */
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004

    /*
     * Rehash all of the existing entries into the new bucket array.
     */

    for (oldChainPtr=oldBuckets ; oldSize>0 ; oldSize--,oldChainPtr++) {
	for (entryPtr=*oldChainPtr ; entryPtr!=NULL ; entryPtr=*oldChainPtr) {
	    bytes = TclGetString(entryPtr->objPtr);
	    length = entryPtr->objPtr->length;
	    index = (HashString(bytes, length) & tablePtr->mask);

	    *oldChainPtr = entryPtr->nextPtr;
	    bucketPtr = &tablePtr->buckets[index];
	    entryPtr->nextPtr = *bucketPtr;
	    *bucketPtr = entryPtr;
	}







|
<







996
997
998
999
1000
1001
1002
1003

1004
1005
1006
1007
1008
1009
1010

    /*
     * Rehash all of the existing entries into the new bucket array.
     */

    for (oldChainPtr=oldBuckets ; oldSize>0 ; oldSize--,oldChainPtr++) {
	for (entryPtr=*oldChainPtr ; entryPtr!=NULL ; entryPtr=*oldChainPtr) {
	    bytes = TclGetStringFromObj(entryPtr->objPtr, &length);

	    index = (HashString(bytes, length) & tablePtr->mask);

	    *oldChainPtr = entryPtr->nextPtr;
	    bucketPtr = &tablePtr->buckets[index];
	    entryPtr->nextPtr = *bucketPtr;
	    *bucketPtr = entryPtr;
	}
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
    size_t i, length, count = 0;

    for (i=0 ; i<localTablePtr->numBuckets ; i++) {
	for (localPtr=localTablePtr->buckets[i] ; localPtr!=NULL;
		localPtr=localPtr->nextPtr) {
	    count++;
	    if (localPtr->refCount != TCL_AUTO_LENGTH) {
		bytes = TclGetString(localPtr->objPtr);
		length = localPtr->objPtr->length;
		Tcl_Panic("%s: local literal \"%.*s\" had bad refCount %" TCL_Z_MODIFIER "u",
			"TclVerifyLocalLiteralTable",
			(length>60? 60 : (int) length), bytes, localPtr->refCount);
	    }
	    if (localPtr->objPtr->bytes == NULL) {
		Tcl_Panic("%s: literal has NULL string rep",
			"TclVerifyLocalLiteralTable");







|
<







1167
1168
1169
1170
1171
1172
1173
1174

1175
1176
1177
1178
1179
1180
1181
    size_t i, length, count = 0;

    for (i=0 ; i<localTablePtr->numBuckets ; i++) {
	for (localPtr=localTablePtr->buckets[i] ; localPtr!=NULL;
		localPtr=localPtr->nextPtr) {
	    count++;
	    if (localPtr->refCount != TCL_AUTO_LENGTH) {
		bytes = TclGetStringFromObj(localPtr->objPtr, &length);

		Tcl_Panic("%s: local literal \"%.*s\" had bad refCount %" TCL_Z_MODIFIER "u",
			"TclVerifyLocalLiteralTable",
			(length>60? 60 : (int) length), bytes, localPtr->refCount);
	    }
	    if (localPtr->objPtr->bytes == NULL) {
		Tcl_Panic("%s: literal has NULL string rep",
			"TclVerifyLocalLiteralTable");
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
    size_t i, length, count = 0;

    for (i=0 ; i<globalTablePtr->numBuckets ; i++) {
	for (globalPtr=globalTablePtr->buckets[i] ; globalPtr!=NULL;
		globalPtr=globalPtr->nextPtr) {
	    count++;
	    if (globalPtr->refCount + 1 < 2) {
		bytes = TclGetString(globalPtr->objPtr);
		length = globalPtr->objPtr->length;
		Tcl_Panic("%s: global literal \"%.*s\" had bad refCount %" TCL_Z_MODIFIER "d",
			"TclVerifyGlobalLiteralTable",
			(length>60? 60 : (int)length), bytes, globalPtr->refCount);
	    }
	    if (globalPtr->objPtr->bytes == NULL) {
		Tcl_Panic("%s: literal has NULL string rep",
			"TclVerifyGlobalLiteralTable");







|
<







1216
1217
1218
1219
1220
1221
1222
1223

1224
1225
1226
1227
1228
1229
1230
    size_t i, length, count = 0;

    for (i=0 ; i<globalTablePtr->numBuckets ; i++) {
	for (globalPtr=globalTablePtr->buckets[i] ; globalPtr!=NULL;
		globalPtr=globalPtr->nextPtr) {
	    count++;
	    if (globalPtr->refCount + 1 < 2) {
		bytes = TclGetStringFromObj(globalPtr->objPtr, &length);

		Tcl_Panic("%s: global literal \"%.*s\" had bad refCount %" TCL_Z_MODIFIER "d",
			"TclVerifyGlobalLiteralTable",
			(length>60? 60 : (int)length), bytes, globalPtr->refCount);
	    }
	    if (globalPtr->objPtr->bytes == NULL) {
		Tcl_Panic("%s: literal has NULL string rep",
			"TclVerifyGlobalLiteralTable");
Changes to generic/tclLoad.c.
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
    if ((objc < 2) || (objc > 4)) {
	Tcl_WrongNumArgs(interp, 1, savedobjv, "?-global? ?-lazy? ?--? fileName ?packageName? ?interp?");
	return TCL_ERROR;
    }
    if (Tcl_FSConvertToPathType(interp, objv[1]) != TCL_OK) {
	return TCL_ERROR;
    }
    fullFileName = Tcl_GetString(objv[1]);

    Tcl_DStringInit(&pkgName);
    Tcl_DStringInit(&initName);
    Tcl_DStringInit(&safeInitName);
    Tcl_DStringInit(&unloadName);
    Tcl_DStringInit(&safeUnloadName);
    Tcl_DStringInit(&tmp);

    packageName = NULL;
    if (objc >= 3) {
	packageName = Tcl_GetString(objv[2]);
	if (packageName[0] == '\0') {
	    packageName = NULL;
	}
    }
    if ((fullFileName[0] == 0) && (packageName == NULL)) {
	Tcl_SetObjResult(interp, Tcl_NewStringObj(
		"must specify either file name or package name", -1));
	Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LOAD", "NOLIBRARY",
		NULL);
	code = TCL_ERROR;
	goto done;
    }

    /*
     * Figure out which interpreter we're going to load the package into.
     */

    target = interp;
    if (objc == 4) {
	const char *slaveIntName = Tcl_GetString(objv[3]);

	target = Tcl_GetSlave(interp, slaveIntName);
	if (target == NULL) {
	    code = TCL_ERROR;
	    goto done;
	}
    }







|










|



















|







161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
    if ((objc < 2) || (objc > 4)) {
	Tcl_WrongNumArgs(interp, 1, savedobjv, "?-global? ?-lazy? ?--? fileName ?packageName? ?interp?");
	return TCL_ERROR;
    }
    if (Tcl_FSConvertToPathType(interp, objv[1]) != TCL_OK) {
	return TCL_ERROR;
    }
    fullFileName = TclGetString(objv[1]);

    Tcl_DStringInit(&pkgName);
    Tcl_DStringInit(&initName);
    Tcl_DStringInit(&safeInitName);
    Tcl_DStringInit(&unloadName);
    Tcl_DStringInit(&safeUnloadName);
    Tcl_DStringInit(&tmp);

    packageName = NULL;
    if (objc >= 3) {
	packageName = TclGetString(objv[2]);
	if (packageName[0] == '\0') {
	    packageName = NULL;
	}
    }
    if ((fullFileName[0] == 0) && (packageName == NULL)) {
	Tcl_SetObjResult(interp, Tcl_NewStringObj(
		"must specify either file name or package name", -1));
	Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LOAD", "NOLIBRARY",
		NULL);
	code = TCL_ERROR;
	goto done;
    }

    /*
     * Figure out which interpreter we're going to load the package into.
     */

    target = interp;
    if (objc == 4) {
	const char *slaveIntName = TclGetString(objv[3]);

	target = Tcl_GetSlave(interp, slaveIntName);
	if (target == NULL) {
	    code = TCL_ERROR;
	    goto done;
	}
    }
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
		 * name, stripping off any leading "lib", and then using all
		 * of the alphabetic and underline characters that follow
		 * that.
		 */

		splitPtr = Tcl_FSSplitPath(objv[1], &pElements);
		Tcl_ListObjIndex(NULL, splitPtr, pElements -1, &pkgGuessPtr);
		pkgGuess = Tcl_GetString(pkgGuessPtr);
		if ((pkgGuess[0] == 'l') && (pkgGuess[1] == 'i')
			&& (pkgGuess[2] == 'b')) {
		    pkgGuess += 3;
		}
#ifdef __CYGWIN__
		if ((pkgGuess[0] == 'c') && (pkgGuess[1] == 'y')
			&& (pkgGuess[2] == 'g')) {







|







320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
		 * name, stripping off any leading "lib", and then using all
		 * of the alphabetic and underline characters that follow
		 * that.
		 */

		splitPtr = Tcl_FSSplitPath(objv[1], &pElements);
		Tcl_ListObjIndex(NULL, splitPtr, pElements -1, &pkgGuessPtr);
		pkgGuess = TclGetString(pkgGuessPtr);
		if ((pkgGuess[0] == 'l') && (pkgGuess[1] == 'i')
			&& (pkgGuess[2] == 'b')) {
		    pkgGuess += 3;
		}
#ifdef __CYGWIN__
		if ((pkgGuess[0] == 'c') && (pkgGuess[1] == 'y')
			&& (pkgGuess[2] == 'g')) {
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
    enum options {
	UNLOAD_NOCOMPLAIN, UNLOAD_KEEPLIB, UNLOAD_LAST
    };

    for (i = 1; i < objc; i++) {
	if (Tcl_GetIndexFromObj(interp, objv[i], options, "option", 0,
		&index) != TCL_OK) {
	    fullFileName = Tcl_GetString(objv[i]);
	    if (fullFileName[0] == '-') {
		/*
		 * It looks like the command contains an option so signal an
		 * error
		 */

		return TCL_ERROR;







|







560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
    enum options {
	UNLOAD_NOCOMPLAIN, UNLOAD_KEEPLIB, UNLOAD_LAST
    };

    for (i = 1; i < objc; i++) {
	if (Tcl_GetIndexFromObj(interp, objv[i], options, "option", 0,
		&index) != TCL_OK) {
	    fullFileName = TclGetString(objv[i]);
	    if (fullFileName[0] == '-') {
		/*
		 * It looks like the command contains an option so signal an
		 * error
		 */

		return TCL_ERROR;
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
		"?-switch ...? fileName ?packageName? ?interp?");
	return TCL_ERROR;
    }
    if (Tcl_FSConvertToPathType(interp, objv[i]) != TCL_OK) {
	return TCL_ERROR;
    }

    fullFileName = Tcl_GetString(objv[i]);
    Tcl_DStringInit(&pkgName);
    Tcl_DStringInit(&tmp);

    packageName = NULL;
    if (objc - i >= 2) {
	packageName = Tcl_GetString(objv[i+1]);
	if (packageName[0] == '\0') {
	    packageName = NULL;
	}
    }
    if ((fullFileName[0] == 0) && (packageName == NULL)) {
	Tcl_SetObjResult(interp, Tcl_NewStringObj(
		"must specify either file name or package name", -1));
	Tcl_SetErrorCode(interp, "TCL", "OPERATION", "UNLOAD", "NOLIBRARY",
		NULL);
	code = TCL_ERROR;
	goto done;
    }

    /*
     * Figure out which interpreter we're going to load the package into.
     */

    target = interp;
    if (objc - i == 3) {
	const char *slaveIntName = Tcl_GetString(objv[i + 2]);

	target = Tcl_GetSlave(interp, slaveIntName);
	if (target == NULL) {
	    return TCL_ERROR;
	}
    }








|





|



















|







600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
		"?-switch ...? fileName ?packageName? ?interp?");
	return TCL_ERROR;
    }
    if (Tcl_FSConvertToPathType(interp, objv[i]) != TCL_OK) {
	return TCL_ERROR;
    }

    fullFileName = TclGetString(objv[i]);
    Tcl_DStringInit(&pkgName);
    Tcl_DStringInit(&tmp);

    packageName = NULL;
    if (objc - i >= 2) {
	packageName = TclGetString(objv[i+1]);
	if (packageName[0] == '\0') {
	    packageName = NULL;
	}
    }
    if ((fullFileName[0] == 0) && (packageName == NULL)) {
	Tcl_SetObjResult(interp, Tcl_NewStringObj(
		"must specify either file name or package name", -1));
	Tcl_SetErrorCode(interp, "TCL", "OPERATION", "UNLOAD", "NOLIBRARY",
		NULL);
	code = TCL_ERROR;
	goto done;
    }

    /*
     * Figure out which interpreter we're going to load the package into.
     */

    target = interp;
    if (objc - i == 3) {
	const char *slaveIntName = TclGetString(objv[i + 2]);

	target = Tcl_GetSlave(interp, slaveIntName);
	if (target == NULL) {
	    return TCL_ERROR;
	}
    }

Changes to generic/tclMain.c.
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
{
    ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);

    if (encodingPtr != NULL) {
	if (tsdPtr->encoding == NULL) {
	    *encodingPtr = NULL;
	} else {
	    *encodingPtr = Tcl_GetString(tsdPtr->encoding);
	}
    }
    return tsdPtr->path;
}

/*----------------------------------------------------------------------
 *







|







211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
{
    ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);

    if (encodingPtr != NULL) {
	if (tsdPtr->encoding == NULL) {
	    *encodingPtr = NULL;
	} else {
	    *encodingPtr = TclGetString(tsdPtr->encoding);
	}
    }
    return tsdPtr->path;
}

/*----------------------------------------------------------------------
 *
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
	 *  FILENAME
	 */

	if ((argc > 3) && (0 == _tcscmp(TEXT("-encoding"), argv[1]))
		&& ('-' != argv[3][0])) {
	    Tcl_Obj *value = NewNativeObj(argv[2], -1);
	    Tcl_SetStartupScript(NewNativeObj(argv[3], -1),
		    Tcl_GetString(value));
	    Tcl_DecrRefCount(value);
	    argc -= 3;
	    argv += 3;
	} else if ((argc > 1) && ('-' != argv[1][0])) {
	    Tcl_SetStartupScript(NewNativeObj(argv[1], -1), NULL);
	    argc--;
	    argv++;







|







339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
	 *  FILENAME
	 */

	if ((argc > 3) && (0 == _tcscmp(TEXT("-encoding"), argv[1]))
		&& ('-' != argv[3][0])) {
	    Tcl_Obj *value = NewNativeObj(argv[2], -1);
	    Tcl_SetStartupScript(NewNativeObj(argv[3], -1),
		    TclGetString(value));
	    Tcl_DecrRefCount(value);
	    argc -= 3;
	    argv += 3;
	} else if ((argc > 1) && ('-' != argv[1][0])) {
	    Tcl_SetStartupScript(NewNativeObj(argv[1], -1), NULL);
	    argc--;
	    argv++;
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
	    }
	    if (Tcl_IsShared(is.commandPtr)) {
		Tcl_DecrRefCount(is.commandPtr);
		is.commandPtr = Tcl_DuplicateObj(is.commandPtr);
		Tcl_IncrRefCount(is.commandPtr);
	    }
	    length = Tcl_GetsObj(is.input, is.commandPtr);
	    if (length == (size_t)-1) {
		if (Tcl_InputBlocked(is.input)) {
		    /*
		     * This can only happen if stdin has been set to
		     * non-blocking. In that case cycle back and try again.
		     * This sets up a tight polling loop (since we have no
		     * event loop running). If this causes bad CPU hogging, we
		     * might try toggling the blocking on stdin instead.







|







484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
	    }
	    if (Tcl_IsShared(is.commandPtr)) {
		Tcl_DecrRefCount(is.commandPtr);
		is.commandPtr = Tcl_DuplicateObj(is.commandPtr);
		Tcl_IncrRefCount(is.commandPtr);
	    }
	    length = Tcl_GetsObj(is.input, is.commandPtr);
	    if (length == TCL_AUTO_LENGTH) {
		if (Tcl_InputBlocked(is.input)) {
		    /*
		     * This can only happen if stdin has been set to
		     * non-blocking. In that case cycle back and try again.
		     * This sets up a tight polling loop (since we have no
		     * event loop running). If this causes bad CPU hogging, we
		     * might try toggling the blocking on stdin instead.
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776

    if (Tcl_IsShared(commandPtr)) {
	Tcl_DecrRefCount(commandPtr);
	commandPtr = Tcl_DuplicateObj(commandPtr);
	Tcl_IncrRefCount(commandPtr);
    }
    length = Tcl_GetsObj(chan, commandPtr);
    if (length == (size_t)-1) {
	if (Tcl_InputBlocked(chan)) {
	    return;
	}
	if (isPtr->tty) {
	    /*
	     * Would be better to find a way to exit the mainLoop? Or perhaps
	     * evaluate [exit]? Leaving as is for now due to compatibility







|







762
763
764
765
766
767
768
769
770
771
772
773
774
775
776

    if (Tcl_IsShared(commandPtr)) {
	Tcl_DecrRefCount(commandPtr);
	commandPtr = Tcl_DuplicateObj(commandPtr);
	Tcl_IncrRefCount(commandPtr);
    }
    length = Tcl_GetsObj(chan, commandPtr);
    if (length == TCL_AUTO_LENGTH) {
	if (Tcl_InputBlocked(chan)) {
	    return;
	}
	if (isPtr->tty) {
	    /*
	     * Would be better to find a way to exit the mainLoop? Or perhaps
	     * evaluate [exit]? Leaving as is for now due to compatibility
Changes to generic/tclNamesp.c.
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
	ir.twoPtrValue.ptr2 = NULL;					\
	Tcl_StoreIntRep((objPtr), &nsNameType, &ir);			\
    } while (0)

#define NsNameGetIntRep(objPtr, nnPtr)					\
    do {								\
	const Tcl_ObjIntRep *irPtr;					\
	irPtr = Tcl_FetchIntRep((objPtr), &nsNameType);			\
	(nnPtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL;		\
    } while (0)

/*
 * Array of values describing how to implement each standard subcommand of the
 * "namespace" command.
 */







|







161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
	ir.twoPtrValue.ptr2 = NULL;					\
	Tcl_StoreIntRep((objPtr), &nsNameType, &ir);			\
    } while (0)

#define NsNameGetIntRep(objPtr, nnPtr)					\
    do {								\
	const Tcl_ObjIntRep *irPtr;					\
	irPtr = TclFetchIntRep((objPtr), &nsNameType);			\
	(nnPtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL;		\
    } while (0)

/*
 * Array of values describing how to implement each standard subcommand of the
 * "namespace" command.
 */
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
    }

    /*
     * Process the optional "-clear" argument.
     */

    firstArg = 1;
    if (strcmp("-clear", Tcl_GetString(objv[firstArg])) == 0) {
	Tcl_Export(interp, NULL, "::", 1);
	Tcl_ResetResult(interp);
	firstArg++;
    }

    /*
     * Add each pattern to the namespace's export pattern list.
     */

    for (i = firstArg;  i < objc;  i++) {
	int result = Tcl_Export(interp, NULL, Tcl_GetString(objv[i]), 0);
	if (result != TCL_OK) {
	    return result;
	}
    }
    return TCL_OK;
}








|










|







3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
    }

    /*
     * Process the optional "-clear" argument.
     */

    firstArg = 1;
    if (strcmp("-clear", TclGetString(objv[firstArg])) == 0) {
	Tcl_Export(interp, NULL, "::", 1);
	Tcl_ResetResult(interp);
	firstArg++;
    }

    /*
     * Add each pattern to the namespace's export pattern list.
     */

    for (i = firstArg;  i < objc;  i++) {
	int result = Tcl_Export(interp, NULL, TclGetString(objv[i]), 0);
	if (result != TCL_OK) {
	    return result;
	}
    }
    return TCL_OK;
}

Changes to generic/tclOOBasic.c.
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754

    if (Tcl_ObjectContextSkippedArgs(context)+1 != objc) {
	Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv,
		"varName");
	return TCL_ERROR;
    }
    argPtr = objv[objc-1];
    arg = Tcl_GetString(argPtr);

    /*
     * Convert the variable name to fully-qualified form if it wasn't already.
     * This has to be done prior to lookup because we can run into problems
     * with resolvers otherwise. [Bug 3603695]
     *
     * We still need to do the lookup; the variable could be linked to another







|







740
741
742
743
744
745
746
747
748
749
750
751
752
753
754

    if (Tcl_ObjectContextSkippedArgs(context)+1 != objc) {
	Tcl_WrongNumArgs(interp, Tcl_ObjectContextSkippedArgs(context), objv,
		"varName");
	return TCL_ERROR;
    }
    argPtr = objv[objc-1];
    arg = TclGetString(argPtr);

    /*
     * Convert the variable name to fully-qualified form if it wasn't already.
     * This has to be done prior to lookup because we can run into problems
     * with resolvers otherwise. [Bug 3603695]
     *
     * We still need to do the lookup; the variable could be linked to another
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
	    Method *mPtr = callerContext->callPtr->chain[
		    callerContext->index].mPtr;
	    PrivateVariableMapping *pvPtr;
	    int i;

	    if (mPtr->declaringObjectPtr == oPtr) {
		FOREACH_STRUCT(pvPtr, oPtr->privateVariables) {
		    if (!strcmp(Tcl_GetString(pvPtr->variableObj),
			    Tcl_GetString(argPtr))) {
			argPtr = pvPtr->fullNameObj;
			break;
		    }
		}
	    } else if (mPtr->declaringClassPtr &&
		    mPtr->declaringClassPtr->privateVariables.num) {
		Class *clsPtr = mPtr->declaringClassPtr;
		int isInstance = TclOOIsReachable(clsPtr, oPtr->selfCls);
		Class *mixinCls;

		if (!isInstance) {
		    FOREACH(mixinCls, oPtr->mixins) {
			if (TclOOIsReachable(clsPtr, mixinCls)) {
			    isInstance = 1;
			    break;
			}
		    }
		}
		if (isInstance) {
		    FOREACH_STRUCT(pvPtr, clsPtr->privateVariables) {
			if (!strcmp(Tcl_GetString(pvPtr->variableObj),
				Tcl_GetString(argPtr))) {
			    argPtr = pvPtr->fullNameObj;
			    break;
			}
		    }
		}
	    }
	}







|
|




















|
|







777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
	    Method *mPtr = callerContext->callPtr->chain[
		    callerContext->index].mPtr;
	    PrivateVariableMapping *pvPtr;
	    int i;

	    if (mPtr->declaringObjectPtr == oPtr) {
		FOREACH_STRUCT(pvPtr, oPtr->privateVariables) {
		    if (!strcmp(TclGetString(pvPtr->variableObj),
			    TclGetString(argPtr))) {
			argPtr = pvPtr->fullNameObj;
			break;
		    }
		}
	    } else if (mPtr->declaringClassPtr &&
		    mPtr->declaringClassPtr->privateVariables.num) {
		Class *clsPtr = mPtr->declaringClassPtr;
		int isInstance = TclOOIsReachable(clsPtr, oPtr->selfCls);
		Class *mixinCls;

		if (!isInstance) {
		    FOREACH(mixinCls, oPtr->mixins) {
			if (TclOOIsReachable(clsPtr, mixinCls)) {
			    isInstance = 1;
			    break;
			}
		    }
		}
		if (isInstance) {
		    FOREACH_STRUCT(pvPtr, clsPtr->privateVariables) {
			if (!strcmp(TclGetString(pvPtr->variableObj),
				TclGetString(argPtr))) {
			    argPtr = pvPtr->fullNameObj;
			    break;
			}
		    }
		}
	    }
	}
Changes to generic/tclOOCall.c.
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298

static void
DupMethodNameRep(
    Tcl_Obj *srcPtr,
    Tcl_Obj *dstPtr)
{
    StashCallChain(dstPtr,
	    Tcl_FetchIntRep(srcPtr, &methodNameType)->twoPtrValue.ptr1);
}

static void
FreeMethodNameRep(
    Tcl_Obj *objPtr)
{
    TclOODeleteChain(
	    Tcl_FetchIntRep(objPtr, &methodNameType)->twoPtrValue.ptr1);
}

/*
 * ----------------------------------------------------------------------
 *
 * TclOOInvokeContext --
 *







|







|







276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298

static void
DupMethodNameRep(
    Tcl_Obj *srcPtr,
    Tcl_Obj *dstPtr)
{
    StashCallChain(dstPtr,
	    TclFetchIntRep(srcPtr, &methodNameType)->twoPtrValue.ptr1);
}

static void
FreeMethodNameRep(
    Tcl_Obj *objPtr)
{
    TclOODeleteChain(
	    TclFetchIntRep(objPtr, &methodNameType)->twoPtrValue.ptr1);
}

/*
 * ----------------------------------------------------------------------
 *
 * TclOOInvokeContext --
 *
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
	 * there are multiple different layers of cache (in the Tcl_Obj, in
	 * the object, and in the class).
	 */

	const Tcl_ObjIntRep *irPtr;
	const int reuseMask = (WANT_PUBLIC(flags) ? ~0 : ~PUBLIC_METHOD);

	if ((irPtr = Tcl_FetchIntRep(cacheInThisObj, &methodNameType))) {
	    callPtr = irPtr->twoPtrValue.ptr1;
	    if (IsStillValid(callPtr, oPtr, flags, reuseMask)) {
		callPtr->refCount++;
		goto returnContext;
	    }
	    Tcl_StoreIntRep(cacheInThisObj, &methodNameType, NULL);
	}







|







1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
	 * there are multiple different layers of cache (in the Tcl_Obj, in
	 * the object, and in the class).
	 */

	const Tcl_ObjIntRep *irPtr;
	const int reuseMask = (WANT_PUBLIC(flags) ? ~0 : ~PUBLIC_METHOD);

	if ((irPtr = TclFetchIntRep(cacheInThisObj, &methodNameType))) {
	    callPtr = irPtr->twoPtrValue.ptr1;
	    if (IsStillValid(callPtr, oPtr, flags, reuseMask)) {
		callPtr->refCount++;
		goto returnContext;
	    }
	    Tcl_StoreIntRep(cacheInThisObj, &methodNameType, NULL);
	}
Changes to generic/tclOODefineCmds.c.
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
	for (i=n=0 ; i<varc ; i++) {
	    Tcl_CreateHashEntry(&uniqueTable, varv[i], &created);
	    if (created) {
		privatePtr = &(pvlPtr->list[n++]);
		privatePtr->variableObj = varv[i];
		privatePtr->fullNameObj = Tcl_ObjPrintf(
			PRIVATE_VARIABLE_PATTERN,
			creationEpoch, Tcl_GetString(varv[i]));
		Tcl_IncrRefCount(privatePtr->fullNameObj);
	    } else {
		Tcl_DecrRefCount(varv[i]);
	    }
	}
	pvlPtr->num = n;








|







552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
	for (i=n=0 ; i<varc ; i++) {
	    Tcl_CreateHashEntry(&uniqueTable, varv[i], &created);
	    if (created) {
		privatePtr = &(pvlPtr->list[n++]);
		privatePtr->variableObj = varv[i];
		privatePtr->fullNameObj = Tcl_ObjPrintf(
			PRIVATE_VARIABLE_PATTERN,
			creationEpoch, TclGetString(varv[i]));
		Tcl_IncrRefCount(privatePtr->fullNameObj);
	    } else {
		Tcl_DecrRefCount(varv[i]);
	    }
	}
	pvlPtr->num = n;

1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
	Tcl_WrongNumArgs(interp, 1, objv, "?kind? namespace");
	return TCL_ERROR;
    }
    if (objc == 3 && Tcl_GetIndexFromObj(interp, objv[1], kindList, "kind", 0,
	    &kind) != TCL_OK) {
	return TCL_ERROR;
    }
    if (!Tcl_GetString(objv[objc - 1])[0]) {
	nsNamePtr = NULL;
    } else {
	nsPtr = GetNamespaceInOuterContext(interp, objv[objc - 1]);
	if (nsPtr == NULL) {
	    return TCL_ERROR;
	}
	nsNamePtr = Tcl_NewStringObj(nsPtr->fullName, -1);







|







1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
	Tcl_WrongNumArgs(interp, 1, objv, "?kind? namespace");
	return TCL_ERROR;
    }
    if (objc == 3 && Tcl_GetIndexFromObj(interp, objv[1], kindList, "kind", 0,
	    &kind) != TCL_OK) {
	return TCL_ERROR;
    }
    if (!TclGetString(objv[objc - 1])[0]) {
	nsNamePtr = NULL;
    } else {
	nsPtr = GetNamespaceInOuterContext(interp, objv[objc - 1]);
	if (nsPtr == NULL) {
	    return TCL_ERROR;
	}
	nsNamePtr = Tcl_NewStringObj(nsPtr->fullName, -1);
Changes to generic/tclOOInfo.c.
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
    int i, private = 0;

    if (objc != 2 && objc != 3) {
	Tcl_WrongNumArgs(interp, 1, objv, "objName ?-private?");
	return TCL_ERROR;
    }
    if (objc == 3) {
	if (strcmp("-private", Tcl_GetString(objv[2])) != 0) {
	    return TCL_ERROR;
	}
	private = 1;
    }
    oPtr = (Object *) Tcl_GetObjectFromObj(interp, objv[1]);
    if (oPtr == NULL) {
	return TCL_ERROR;







|







812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
    int i, private = 0;

    if (objc != 2 && objc != 3) {
	Tcl_WrongNumArgs(interp, 1, objv, "objName ?-private?");
	return TCL_ERROR;
    }
    if (objc == 3) {
	if (strcmp("-private", TclGetString(objv[2])) != 0) {
	    return TCL_ERROR;
	}
	private = 1;
    }
    oPtr = (Object *) Tcl_GetObjectFromObj(interp, objv[1]);
    if (oPtr == NULL) {
	return TCL_ERROR;
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
    int i, private = 0;

    if (objc != 2 && objc != 3) {
	Tcl_WrongNumArgs(interp, 1, objv, "className ?-private?");
	return TCL_ERROR;
    }
    if (objc == 3) {
	if (strcmp("-private", Tcl_GetString(objv[2])) != 0) {
	    return TCL_ERROR;
	}
	private = 1;
    }
    clsPtr = GetClassFromObj(interp, objv[1]);
    if (clsPtr == NULL) {
	return TCL_ERROR;







|







1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
    int i, private = 0;

    if (objc != 2 && objc != 3) {
	Tcl_WrongNumArgs(interp, 1, objv, "className ?-private?");
	return TCL_ERROR;
    }
    if (objc == 3) {
	if (strcmp("-private", TclGetString(objv[2])) != 0) {
	    return TCL_ERROR;
	}
	private = 1;
    }
    clsPtr = GetClassFromObj(interp, objv[1]);
    if (clsPtr == NULL) {
	return TCL_ERROR;
Changes to generic/tclOOMethod.c.
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
    Tcl_Obj *variableObj = Tcl_NewStringObj(varName, length);

    /*
     * Do not create resolvers for cases that contain namespace separators or
     * which look like array accesses. Both will lead us astray.
     */

    if (strstr(Tcl_GetString(variableObj), "::") != NULL ||
	    Tcl_StringMatch(Tcl_GetString(variableObj), "*(*)")) {
	Tcl_DecrRefCount(variableObj);
	return TCL_CONTINUE;
    }

    infoPtr = Tcl_Alloc(sizeof(OOResVarInfo));
    infoPtr->info.fetchProc = ProcedureMethodCompiledVarConnect;
    infoPtr->info.deleteProc = ProcedureMethodCompiledVarDelete;







|
|







1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
    Tcl_Obj *variableObj = Tcl_NewStringObj(varName, length);

    /*
     * Do not create resolvers for cases that contain namespace separators or
     * which look like array accesses. Both will lead us astray.
     */

    if (strstr(TclGetString(variableObj), "::") != NULL ||
	    Tcl_StringMatch(TclGetString(variableObj), "*(*)")) {
	Tcl_DecrRefCount(variableObj);
	return TCL_CONTINUE;
    }

    infoPtr = Tcl_Alloc(sizeof(OOResVarInfo));
    infoPtr->info.fetchProc = ProcedureMethodCompiledVarConnect;
    infoPtr->info.deleteProc = ProcedureMethodCompiledVarDelete;
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348

    /*
     * Must strip the internal representation in order to ensure that any
     * bound references to instance variables are removed. [Bug 3609693]
     */

    bodyObj = Tcl_DuplicateObj(pmPtr->procPtr->bodyPtr);
    Tcl_GetString(bodyObj);
    Tcl_StoreIntRep(pmPtr->procPtr->bodyPtr, &tclByteCodeType, NULL);

    /*
     * Create the actual copy of the method record, manufacturing a new proc
     * record.
     */








|







1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348

    /*
     * Must strip the internal representation in order to ensure that any
     * bound references to instance variables are removed. [Bug 3609693]
     */

    bodyObj = Tcl_DuplicateObj(pmPtr->procPtr->bodyPtr);
    TclGetString(bodyObj);
    Tcl_StoreIntRep(pmPtr->procPtr->bodyPtr, &tclByteCodeType, NULL);

    /*
     * Create the actual copy of the method record, manufacturing a new proc
     * record.
     */

Changes to generic/tclObj.c.
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
    /*
     * Invalidate the string rep first so we can use the bytes value for our
     * pointer chain, and signal an obj deletion (as opposed to shimmering)
     * with 'length == -1'.
     */

    TclInvalidateStringRep(objPtr);
    objPtr->length = -1;

    if (!objPtr->typePtr || !objPtr->typePtr->freeIntRepProc) {
	/*
	 * objPtr can be freed safely, as it will not attempt to free any
	 * other objects: it will not cause recursive calls to this function.
	 */








|







1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
    /*
     * Invalidate the string rep first so we can use the bytes value for our
     * pointer chain, and signal an obj deletion (as opposed to shimmering)
     * with 'length == -1'.
     */

    TclInvalidateStringRep(objPtr);
    objPtr->length = TCL_AUTO_LENGTH;

    if (!objPtr->typePtr || !objPtr->typePtr->freeIntRepProc) {
	/*
	 * objPtr can be freed safely, as it will not attempt to free any
	 * other objects: it will not cause recursive calls to this function.
	 */

1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
 *	This function is called in several configurations to provide all
 *	the tools needed to set an object's string representation. The
 *	function is determined by the arguments.
 *
 *	(objPtr->bytes != NULL && bytes != NULL) || (numBytes == -1)
 *	    Invalid call -- panic!
 *
 *	objPtr->bytes == NULL && bytes == NULL && numBytes >= 0
 *	    Allocation only - allocate space for (numBytes+1) chars.
 *	    store in objPtr->bytes and return. Also sets
 *	    objPtr->length to 0 and objPtr->bytes[0] to NUL.
 *
 *	objPtr->bytes == NULL && bytes != NULL && numBytes >= 0
 *	    Allocate and copy. bytes is assumed to point to chars to
 *	    copy into the string rep. objPtr->length = numBytes. Allocate
 *	    array of (numBytes + 1) chars. store in objPtr->bytes. Copy
 *	    numBytes chars from bytes to objPtr->bytes; Set
 *	    objPtr->bytes[numBytes] to NUL and return objPtr->bytes.
 *	    Caller must guarantee there are numBytes chars at bytes to
 *	    be copied.
 *
 *	objPtr->bytes != NULL && bytes == NULL && numBytes >= 0
 *	    Truncate.  Set objPtr->length to numBytes and
 *	    objPr->bytes[numBytes] to NUL.  Caller has to guarantee
 *	    that a prior allocating call allocated enough bytes for
 *	    this to be valid. Return objPtr->bytes.
 *
 *	Caller is expected to ascertain that the bytes copied into
 *	the string rep make up complete valid UTF-8 characters.







|




|








|







1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
 *	This function is called in several configurations to provide all
 *	the tools needed to set an object's string representation. The
 *	function is determined by the arguments.
 *
 *	(objPtr->bytes != NULL && bytes != NULL) || (numBytes == -1)
 *	    Invalid call -- panic!
 *
 *	objPtr->bytes == NULL && bytes == NULL && numBytes != -1
 *	    Allocation only - allocate space for (numBytes+1) chars.
 *	    store in objPtr->bytes and return. Also sets
 *	    objPtr->length to 0 and objPtr->bytes[0] to NUL.
 *
 *	objPtr->bytes == NULL && bytes != NULL && numBytes != -1
 *	    Allocate and copy. bytes is assumed to point to chars to
 *	    copy into the string rep. objPtr->length = numBytes. Allocate
 *	    array of (numBytes + 1) chars. store in objPtr->bytes. Copy
 *	    numBytes chars from bytes to objPtr->bytes; Set
 *	    objPtr->bytes[numBytes] to NUL and return objPtr->bytes.
 *	    Caller must guarantee there are numBytes chars at bytes to
 *	    be copied.
 *
 *	objPtr->bytes != NULL && bytes == NULL && numBytes != -1
 *	    Truncate.  Set objPtr->length to numBytes and
 *	    objPr->bytes[numBytes] to NUL.  Caller has to guarantee
 *	    that a prior allocating call allocated enough bytes for
 *	    this to be valid. Return objPtr->bytes.
 *
 *	Caller is expected to ascertain that the bytes copied into
 *	the string rep make up complete valid UTF-8 characters.
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
 */

Tcl_ObjIntRep *
Tcl_FetchIntRep(
    Tcl_Obj *objPtr,		/* Object to fetch from. */
    const Tcl_ObjType *typePtr)	/* Requested type */
{
    /* If objPtr type doesn't match request, nothing can be fetched */
    if (objPtr->typePtr != typePtr) {
	return NULL;
    }

    /* Type match! objPtr IntRep is the one sought. */
    return &(objPtr->internalRep);
}

/*
 *----------------------------------------------------------------------
 *
 * Tcl_FreeIntRep --
 *







<
<
|
<
<
<
<







1876
1877
1878
1879
1880
1881
1882


1883




1884
1885
1886
1887
1888
1889
1890
 */

Tcl_ObjIntRep *
Tcl_FetchIntRep(
    Tcl_Obj *objPtr,		/* Object to fetch from. */
    const Tcl_ObjType *typePtr)	/* Requested type */
{


    return TclFetchIntRep(objPtr, typePtr);




}

/*
 *----------------------------------------------------------------------
 *
 * Tcl_FreeIntRep --
 *
Changes to generic/tclParse.c.
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89

#include "tclInt.h"
#include "tclParse.h"
#include <assert.h>

/*
 * The following table provides parsing information about each possible 8-bit
 * character. The table is designed to be referenced with either signed or
 * unsigned characters, so it has 384 entries. The first 128 entries
 * correspond to negative character values, the next 256 correspond to
 * positive character values. The last 128 entries are identical to the first
 * 128. The table is always indexed with a 128-byte offset (the 128th entry
 * corresponds to a character value of 0).
 *
 * The macro CHAR_TYPE is used to index into the table and return information
 * about its character argument. The following return values are defined.
 *
 * TYPE_NORMAL -	All characters that don't have special significance to
 *			the Tcl parser.
 * TYPE_SPACE -		The character is a whitespace character other than
 *			newline.
 * TYPE_COMMAND_END -	Character is newline or semicolon.
 * TYPE_SUBS -		Character begins a substitution or has other special
 *			meaning in ParseTokens: backslash, dollar sign, or
 *			open bracket.
 * TYPE_QUOTE -		Character is a double quote.
 * TYPE_CLOSE_PAREN -	Character is a right parenthesis.
 * TYPE_CLOSE_BRACK -	Character is a right square bracket.
 * TYPE_BRACE -		Character is a curly brace (either left or right).
 */

const char tclCharTypeTable[] = {
    /*
     * Negative character values, from -128 to -1:
     */

    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,

    /*
     * Positive character values, from 0-127:
     */

    TYPE_SUBS,        TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,







|
<
<
<
<
<



















<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







15
16
17
18
19
20
21
22





23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41




































42
43
44
45
46
47
48

#include "tclInt.h"
#include "tclParse.h"
#include <assert.h>

/*
 * The following table provides parsing information about each possible 8-bit
 * character. The table is designed to be referenced with unsigned characters.





 *
 * The macro CHAR_TYPE is used to index into the table and return information
 * about its character argument. The following return values are defined.
 *
 * TYPE_NORMAL -	All characters that don't have special significance to
 *			the Tcl parser.
 * TYPE_SPACE -		The character is a whitespace character other than
 *			newline.
 * TYPE_COMMAND_END -	Character is newline or semicolon.
 * TYPE_SUBS -		Character begins a substitution or has other special
 *			meaning in ParseTokens: backslash, dollar sign, or
 *			open bracket.
 * TYPE_QUOTE -		Character is a double quote.
 * TYPE_CLOSE_PAREN -	Character is a right parenthesis.
 * TYPE_CLOSE_BRACK -	Character is a right square bracket.
 * TYPE_BRACE -		Character is a curly brace (either left or right).
 */

const char tclCharTypeTable[] = {





































    /*
     * Positive character values, from 0-127:
     */

    TYPE_SUBS,        TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
    TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,      TYPE_NORMAL,
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
 *	None.
 *
 *----------------------------------------------------------------------
 */

int
TclIsSpaceProc(
    char byte)
{
    return CHAR_TYPE(byte) & (TYPE_SPACE) || byte == '\n';
}

/*
 *----------------------------------------------------------------------
 *







|







548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
 *	None.
 *
 *----------------------------------------------------------------------
 */

int
TclIsSpaceProc(
    int byte)
{
    return CHAR_TYPE(byte) & (TYPE_SPACE) || byte == '\n';
}

/*
 *----------------------------------------------------------------------
 *
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
 *	None.
 *
 *----------------------------------------------------------------------
 */

int
TclIsBareword(
    char byte)
{
    if (byte < '0' || byte > 'z') {
	return 0;
    }
    if (byte <= '9' || byte >= 'a') {
	return 1;
    }







|







577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
 *	None.
 *
 *----------------------------------------------------------------------
 */

int
TclIsBareword(
    int byte)
{
    if (byte < '0' || byte > 'z') {
	return 0;
    }
    if (byte <= '9' || byte >= 'a') {
	return 1;
    }
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
	 */

	if (Tcl_UtfCharComplete(p, numBytes - 1)) {
	    count = TclUtfToUniChar(p, &unichar) + 1;	/* +1 for '\' */
	} else {
	    char utfBytes[TCL_UTF_MAX];

	    memcpy(utfBytes, p, (size_t) (numBytes - 1));
	    utfBytes[numBytes - 1] = '\0';
	    count = TclUtfToUniChar(utfBytes, &unichar) + 1;
	}
	result = unichar;
	break;
    }








|







923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
	 */

	if (Tcl_UtfCharComplete(p, numBytes - 1)) {
	    count = TclUtfToUniChar(p, &unichar) + 1;	/* +1 for '\' */
	} else {
	    char utfBytes[TCL_UTF_MAX];

	    memcpy(utfBytes, p, numBytes - 1);
	    utfBytes[numBytes - 1] = '\0';
	    count = TclUtfToUniChar(utfBytes, &unichar) + 1;
	}
	result = unichar;
	break;
    }

Changes to generic/tclParse.h.
8
9
10
11
12
13
14
15
16
17
#define TYPE_COMMAND_END	0x2
#define TYPE_SUBS		0x4
#define TYPE_QUOTE		0x8
#define TYPE_CLOSE_PAREN	0x10
#define TYPE_CLOSE_BRACK	0x20
#define TYPE_BRACE		0x40

#define CHAR_TYPE(c) (tclCharTypeTable+128)[(int)(c)]

MODULE_SCOPE const char tclCharTypeTable[];







|


8
9
10
11
12
13
14
15
16
17
#define TYPE_COMMAND_END	0x2
#define TYPE_SUBS		0x4
#define TYPE_QUOTE		0x8
#define TYPE_CLOSE_PAREN	0x10
#define TYPE_CLOSE_BRACK	0x20
#define TYPE_BRACE		0x40

#define CHAR_TYPE(c) tclCharTypeTable[(unsigned char)(c)]

MODULE_SCOPE const char tclCharTypeTable[];
Changes to generic/tclPathObj.c.
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#define TCLPATH_NEEDNORM 4

/*
 * Define some macros to give us convenient access to path-object specific
 * fields.
 */

#define PATHOBJ(pathPtr) ((FsPath *) (Tcl_FetchIntRep((pathPtr), &fsPathType)->twoPtrValue.ptr1))
#define SETPATHOBJ(pathPtr,fsPathPtr) \
	do {							\
		Tcl_ObjIntRep ir;				\
		ir.twoPtrValue.ptr1 = (void *) (fsPathPtr);	\
		ir.twoPtrValue.ptr2 = NULL;			\
		Tcl_StoreIntRep((pathPtr), &fsPathType, &ir);	\
	} while (0)







|







97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#define TCLPATH_NEEDNORM 4

/*
 * Define some macros to give us convenient access to path-object specific
 * fields.
 */

#define PATHOBJ(pathPtr) ((FsPath *) (TclFetchIntRep((pathPtr), &fsPathType)->twoPtrValue.ptr1))
#define SETPATHOBJ(pathPtr,fsPathPtr) \
	do {							\
		Tcl_ObjIntRep ir;				\
		ir.twoPtrValue.ptr1 = (void *) (fsPathPtr);	\
		ir.twoPtrValue.ptr2 = NULL;			\
		Tcl_StoreIntRep((pathPtr), &fsPathType, &ir);	\
	} while (0)
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578

579
580
581
582
583
584
585
586
587

Tcl_Obj *
TclPathPart(
    Tcl_Interp *interp,		/* Used for error reporting */
    Tcl_Obj *pathPtr,		/* Path to take dirname of */
    Tcl_PathPart portion)	/* Requested portion of name */
{
    Tcl_ObjIntRep *irPtr = Tcl_FetchIntRep(pathPtr, &fsPathType);

    if (irPtr) {
	FsPath *fsPathPtr = PATHOBJ(pathPtr);

	if (PATHFLAGS(pathPtr) != 0) {
	    switch (portion) {
	    case TCL_PATH_DIRNAME: {
		/*
		 * Check if the joined-on bit has any directory delimiters in
		 * it. If so, the 'dirname' would be a joining of the main
		 * part with the dirname of the joined-on bit. We could handle
		 * that special case here, but we don't, and instead just use
		 * the standardPath code.
		 */


		const char *rest = TclGetString(fsPathPtr->normPathPtr);
		size_t numBytes = fsPathPtr->normPathPtr->length;

		if (strchr(rest, '/') != NULL) {
		    goto standardPath;
		}
		/*
		 * If the joined-on bit is empty, then [file dirname] is
		 * documented to return all but the last non-empty element







|















>
|
<







556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580

581
582
583
584
585
586
587

Tcl_Obj *
TclPathPart(
    Tcl_Interp *interp,		/* Used for error reporting */
    Tcl_Obj *pathPtr,		/* Path to take dirname of */
    Tcl_PathPart portion)	/* Requested portion of name */
{
    Tcl_ObjIntRep *irPtr = TclFetchIntRep(pathPtr, &fsPathType);

    if (irPtr) {
	FsPath *fsPathPtr = PATHOBJ(pathPtr);

	if (PATHFLAGS(pathPtr) != 0) {
	    switch (portion) {
	    case TCL_PATH_DIRNAME: {
		/*
		 * Check if the joined-on bit has any directory delimiters in
		 * it. If so, the 'dirname' would be a joining of the main
		 * part with the dirname of the joined-on bit. We could handle
		 * that special case here, but we don't, and instead just use
		 * the standardPath code.
		 */

		size_t numBytes;
		const char *rest = TclGetStringFromObj(fsPathPtr->normPathPtr, &numBytes);


		if (strchr(rest, '/') != NULL) {
		    goto standardPath;
		}
		/*
		 * If the joined-on bit is empty, then [file dirname] is
		 * documented to return all but the last non-empty element
609
610
611
612
613
614
615

616
617
618
619
620
621
622
623
624
		/*
		 * Check if the joined-on bit has any directory delimiters in
		 * it. If so, the 'tail' would be only the part following the
		 * last delimiter. We could handle that special case here, but
		 * we don't, and instead just use the standardPath code.
		 */


		const char *rest = TclGetString(fsPathPtr->normPathPtr);
		size_t numBytes = fsPathPtr->normPathPtr->length;

		if (strchr(rest, '/') != NULL) {
		    goto standardPath;
		}
		/*
		 * If the joined-on bit is empty, then [file tail] is
		 * documented to return the last non-empty element







>
|
<







609
610
611
612
613
614
615
616
617

618
619
620
621
622
623
624
		/*
		 * Check if the joined-on bit has any directory delimiters in
		 * it. If so, the 'tail' would be only the part following the
		 * last delimiter. We could handle that special case here, but
		 * we don't, and instead just use the standardPath code.
		 */

		size_t numBytes;
		const char *rest = TclGetStringFromObj(fsPathPtr->normPathPtr, &numBytes);


		if (strchr(rest, '/') != NULL) {
		    goto standardPath;
		}
		/*
		 * If the joined-on bit is empty, then [file tail] is
		 * documented to return the last non-empty element
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
	return Tcl_NewObj();
    }

    assert ( elements > 0 );

    if (elements == 2) {
	Tcl_Obj *elt = objv[0];
	Tcl_ObjIntRep *eltIr = Tcl_FetchIntRep(elt, &fsPathType);

	/*
	 * This is a special case where we can be much more efficient, where
	 * we are joining a single relative path onto an object that is
	 * already of path type. The 'TclNewFSPathObj' call below creates an
	 * object which can be normalized more efficiently. Currently we only
	 * use the special case when we have exactly two elements, but we







|







856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
	return Tcl_NewObj();
    }

    assert ( elements > 0 );

    if (elements == 2) {
	Tcl_Obj *elt = objv[0];
	Tcl_ObjIntRep *eltIr = TclFetchIntRep(elt, &fsPathType);

	/*
	 * This is a special case where we can be much more efficient, where
	 * we are joining a single relative path onto an object that is
	 * already of path type. The 'TclNewFSPathObj' call below creates an
	 * object which can be normalized more efficiently. Currently we only
	 * use the special case when we have exactly two elements, but we
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
		    /*
		     * Finally, on Windows, 'file join' is defined to convert
		     * all backslashes to forward slashes, so the base part
		     * cannot have backslashes either.
		     */

		    if ((tclPlatform != TCL_PLATFORM_WINDOWS)
			    || (strchr(Tcl_GetString(elt), '\\') == NULL)) {

			if (PATHFLAGS(elt)) {
			    return TclNewFSPathObj(elt, str, len);
			}
			if (TCL_PATH_ABSOLUTE != Tcl_FSGetPathType(elt)) {
			    return TclNewFSPathObj(elt, str, len);
			}







|







912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
		    /*
		     * Finally, on Windows, 'file join' is defined to convert
		     * all backslashes to forward slashes, so the base part
		     * cannot have backslashes either.
		     */

		    if ((tclPlatform != TCL_PLATFORM_WINDOWS)
			    || (strchr(TclGetString(elt), '\\') == NULL)) {

			if (PATHFLAGS(elt)) {
			    return TclNewFSPathObj(elt, str, len);
			}
			if (TCL_PATH_ABSOLUTE != Tcl_FSGetPathType(elt)) {
			    return TclNewFSPathObj(elt, str, len);
			}
948
949
950
951
952
953
954
955

956
957
958
959
960
961
962
	    }
	}
    }

    assert ( res == NULL );

    for (i = 0; i < elements; i++) {
	int driveNameLength, strEltLen, length;

	Tcl_PathType type;
	char *strElt, *ptr;
	Tcl_Obj *driveName = NULL;
	Tcl_Obj *elt = objv[i];

	strElt = TclGetStringFromObj(elt, &strEltLen);
	driveNameLength = 0;







|
>







948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
	    }
	}
    }

    assert ( res == NULL );

    for (i = 0; i < elements; i++) {
	int driveNameLength;
	size_t strEltLen, length;
	Tcl_PathType type;
	char *strElt, *ptr;
	Tcl_Obj *driveName = NULL;
	Tcl_Obj *elt = objv[i];

	strElt = TclGetStringFromObj(elt, &strEltLen);
	driveNameLength = 0;
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
int
Tcl_FSConvertToPathType(
    Tcl_Interp *interp,		/* Interpreter in which to store error message
				 * (if necessary). */
    Tcl_Obj *pathPtr)		/* Object to convert to a valid, current path
				 * type. */
{
    Tcl_ObjIntRep *irPtr = Tcl_FetchIntRep(pathPtr, &fsPathType);

    /*
     * While it is bad practice to examine an object's type directly, this is
     * actually the best thing to do here. The reason is that if we are
     * converting this object to FsPath type for the first time, we don't need
     * to worry whether the 'cwd' has changed. On the other hand, if this
     * object is already of FsPath type, and is a relative path, we do have to







|







1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
int
Tcl_FSConvertToPathType(
    Tcl_Interp *interp,		/* Interpreter in which to store error message
				 * (if necessary). */
    Tcl_Obj *pathPtr)		/* Object to convert to a valid, current path
				 * type. */
{
    Tcl_ObjIntRep *irPtr = TclFetchIntRep(pathPtr, &fsPathType);

    /*
     * While it is bad practice to examine an object's type directly, this is
     * actually the best thing to do here. The reason is that if we are
     * converting this object to FsPath type for the first time, we don't need
     * to worry whether the 'cwd' has changed. On the other hand, if this
     * object is already of FsPath type, and is a relative path, we do have to
1357
1358
1359
1360
1361
1362
1363

1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
static Tcl_Obj *
AppendPath(
    Tcl_Obj *head,
    Tcl_Obj *tail)
{
    const char *bytes;
    Tcl_Obj *copy = Tcl_DuplicateObj(head);


    /*
     * This is likely buggy when dealing with virtual filesystem drivers
     * that use some character other than "/" as a path separator.  I know
     * of no evidence that such a foolish thing exists.  This solution was
     * chosen so that "JoinPath" operations that pass through either path
     * intrep produce the same results; that is, bugward compatibility.  If
     * we need to fix that bug here, it needs fixing in TclJoinPath() too.
     */
    bytes = TclGetString(tail);
    if (tail->length == 0) {
	Tcl_AppendToObj(copy, "/", 1);
    } else {
	TclpNativeJoinPath(copy, bytes);
    }
    return copy;
}








>









|
|







1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
static Tcl_Obj *
AppendPath(
    Tcl_Obj *head,
    Tcl_Obj *tail)
{
    const char *bytes;
    Tcl_Obj *copy = Tcl_DuplicateObj(head);
    size_t length;

    /*
     * This is likely buggy when dealing with virtual filesystem drivers
     * that use some character other than "/" as a path separator.  I know
     * of no evidence that such a foolish thing exists.  This solution was
     * chosen so that "JoinPath" operations that pass through either path
     * intrep produce the same results; that is, bugward compatibility.  If
     * we need to fix that bug here, it needs fixing in TclJoinPath() too.
     */
    bytes = TclGetStringFromObj(tail, &length);
    if (length == 0) {
	Tcl_AppendToObj(copy, "/", 1);
    } else {
	TclpNativeJoinPath(copy, bytes);
    }
    return copy;
}

1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419

Tcl_Obj *
TclFSMakePathRelative(
    Tcl_Interp *interp,		/* Used for error reporting if not NULL. */
    Tcl_Obj *pathPtr,		/* The path we have. */
    Tcl_Obj *cwdPtr)		/* Make it relative to this. */
{
    int cwdLen, len;
    const char *tempStr;
    Tcl_ObjIntRep *irPtr = Tcl_FetchIntRep(pathPtr, &fsPathType);

    if (irPtr) {
	FsPath *fsPathPtr = PATHOBJ(pathPtr);

	if (PATHFLAGS(pathPtr) != 0 && fsPathPtr->cwdPtr == cwdPtr) {
	    return fsPathPtr->normPathPtr;
	}







|

|







1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421

Tcl_Obj *
TclFSMakePathRelative(
    Tcl_Interp *interp,		/* Used for error reporting if not NULL. */
    Tcl_Obj *pathPtr,		/* The path we have. */
    Tcl_Obj *cwdPtr)		/* Make it relative to this. */
{
    size_t cwdLen, len;
    const char *tempStr;
    Tcl_ObjIntRep *irPtr = TclFetchIntRep(pathPtr, &fsPathType);

    if (irPtr) {
	FsPath *fsPathPtr = PATHOBJ(pathPtr);

	if (PATHFLAGS(pathPtr) != 0 && fsPathPtr->cwdPtr == cwdPtr) {
	    return fsPathPtr->normPathPtr;
	}
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488

static int
MakePathFromNormalized(
    Tcl_Interp *interp,		/* Used for error reporting if not NULL. */
    Tcl_Obj *pathPtr)		/* The object to convert. */
{
    FsPath *fsPathPtr;
    Tcl_ObjIntRep *irPtr = Tcl_FetchIntRep(pathPtr, &fsPathType);

    if (irPtr) {
	return TCL_OK;
    }

    fsPathPtr = Tcl_Alloc(sizeof(FsPath));








|







1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490

static int
MakePathFromNormalized(
    Tcl_Interp *interp,		/* Used for error reporting if not NULL. */
    Tcl_Obj *pathPtr)		/* The object to convert. */
{
    FsPath *fsPathPtr;
    Tcl_ObjIntRep *irPtr = TclFetchIntRep(pathPtr, &fsPathType);

    if (irPtr) {
	return TCL_OK;
    }

    fsPathPtr = Tcl_Alloc(sizeof(FsPath));

1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
	    if (translatedCwdPtr == NULL) {
		return NULL;
	    }

	    retObj = Tcl_FSJoinToPath(translatedCwdPtr, 1,
		    &srcFsPathPtr->normPathPtr);
	    Tcl_IncrRefCount(srcFsPathPtr->translatedPathPtr = retObj);
	    translatedCwdIrPtr = Tcl_FetchIntRep(translatedCwdPtr, &fsPathType);
	    if (translatedCwdIrPtr) {
		srcFsPathPtr->filesystemEpoch
			= PATHOBJ(translatedCwdPtr)->filesystemEpoch;
	    } else {
		srcFsPathPtr->filesystemEpoch = 0;
	    }
	    Tcl_DecrRefCount(translatedCwdPtr);







|







1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
	    if (translatedCwdPtr == NULL) {
		return NULL;
	    }

	    retObj = Tcl_FSJoinToPath(translatedCwdPtr, 1,
		    &srcFsPathPtr->normPathPtr);
	    Tcl_IncrRefCount(srcFsPathPtr->translatedPathPtr = retObj);
	    translatedCwdIrPtr = TclFetchIntRep(translatedCwdPtr, &fsPathType);
	    if (translatedCwdIrPtr) {
		srcFsPathPtr->filesystemEpoch
			= PATHOBJ(translatedCwdPtr)->filesystemEpoch;
	    } else {
		srcFsPathPtr->filesystemEpoch = 0;
	    }
	    Tcl_DecrRefCount(translatedCwdPtr);
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
Tcl_FSGetTranslatedStringPath(
    Tcl_Interp *interp,
    Tcl_Obj *pathPtr)
{
    Tcl_Obj *transPtr = Tcl_FSGetTranslatedPath(interp, pathPtr);

    if (transPtr != NULL) {
	int len;
	const char *orig = TclGetStringFromObj(transPtr, &len);
	char *result = Tcl_Alloc(len+1);

	memcpy(result, orig, (size_t) len+1);
	TclDecrRefCount(transPtr);
	return result;
    }

    return NULL;
}








|



|







1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
Tcl_FSGetTranslatedStringPath(
    Tcl_Interp *interp,
    Tcl_Obj *pathPtr)
{
    Tcl_Obj *transPtr = Tcl_FSGetTranslatedPath(interp, pathPtr);

    if (transPtr != NULL) {
	size_t len;
	const char *orig = TclGetStringFromObj(transPtr, &len);
	char *result = Tcl_Alloc(len+1);

	memcpy(result, orig, len+1);
	TclDecrRefCount(transPtr);
	return result;
    }

    return NULL;
}

1723
1724
1725
1726
1727
1728
1729
1730

1731
1732
1733
1734
1735
1736
1737
    if (PATHFLAGS(pathPtr) != 0) {
	/*
	 * This is a special path object which is the result of something like
	 * 'file join'
	 */

	Tcl_Obj *dir, *copy;
	int tailLen, cwdLen, pathType;


	pathType = Tcl_FSGetPathType(fsPathPtr->cwdPtr);
	dir = Tcl_FSGetNormalizedPath(interp, fsPathPtr->cwdPtr);
	if (dir == NULL) {
	    return NULL;
	}
	/* TODO: Figure out why this is needed. */







|
>







1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
    if (PATHFLAGS(pathPtr) != 0) {
	/*
	 * This is a special path object which is the result of something like
	 * 'file join'
	 */

	Tcl_Obj *dir, *copy;
	size_t tailLen, cwdLen;
	int pathType;

	pathType = Tcl_FSGetPathType(fsPathPtr->cwdPtr);
	dir = Tcl_FSGetNormalizedPath(interp, fsPathPtr->cwdPtr);
	if (dir == NULL) {
	    return NULL;
	}
	/* TODO: Figure out why this is needed. */
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
	} else if (fsPathPtr->normPathPtr == NULL) {
	    size_t cwdLen;
	    Tcl_Obj *copy;

	    copy = AppendPath(fsPathPtr->cwdPtr, pathPtr);

	    (void) TclGetStringFromObj(fsPathPtr->cwdPtr, &cwdLen);
	    cwdLen += (Tcl_GetString(copy)[cwdLen] == '/');

	    /*
	     * Normalize the combined string, but only starting after the end
	     * of the previously normalized 'dir'. This should be much faster!
	     */

	    TclFSNormalizeToUniquePath(interp, copy, cwdLen-1);







|







1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
	} else if (fsPathPtr->normPathPtr == NULL) {
	    size_t cwdLen;
	    Tcl_Obj *copy;

	    copy = AppendPath(fsPathPtr->cwdPtr, pathPtr);

	    (void) TclGetStringFromObj(fsPathPtr->cwdPtr, &cwdLen);
	    cwdLen += (TclGetString(copy)[cwdLen] == '/');

	    /*
	     * Normalize the combined string, but only starting after the end
	     * of the previously normalized 'dir'. This should be much faster!
	     */

	    TclFSNormalizeToUniquePath(interp, copy, cwdLen-1);
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094

int
TclFSEnsureEpochOk(
    Tcl_Obj *pathPtr,
    const Tcl_Filesystem **fsPtrPtr)
{
    FsPath *srcFsPathPtr;
    Tcl_ObjIntRep *irPtr = Tcl_FetchIntRep(pathPtr, &fsPathType);

    if (irPtr == NULL) {
	return TCL_OK;
    }

    srcFsPathPtr = PATHOBJ(pathPtr);








|







2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097

int
TclFSEnsureEpochOk(
    Tcl_Obj *pathPtr,
    const Tcl_Filesystem **fsPtrPtr)
{
    FsPath *srcFsPathPtr;
    Tcl_ObjIntRep *irPtr = TclFetchIntRep(pathPtr, &fsPathType);

    if (irPtr == NULL) {
	return TCL_OK;
    }

    srcFsPathPtr = PATHOBJ(pathPtr);

2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
void
TclFSSetPathDetails(
    Tcl_Obj *pathPtr,
    const Tcl_Filesystem *fsPtr,
    ClientData clientData)
{
    FsPath *srcFsPathPtr;
    Tcl_ObjIntRep *irPtr = Tcl_FetchIntRep(pathPtr, &fsPathType);;

    /*
     * Make sure pathPtr is of the correct type.
     */

    if (irPtr == NULL) {
	if (SetFsPathFromAny(NULL, pathPtr) != TCL_OK) {







|







2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
void
TclFSSetPathDetails(
    Tcl_Obj *pathPtr,
    const Tcl_Filesystem *fsPtr,
    ClientData clientData)
{
    FsPath *srcFsPathPtr;
    Tcl_ObjIntRep *irPtr = TclFetchIntRep(pathPtr, &fsPathType);;

    /*
     * Make sure pathPtr is of the correct type.
     */

    if (irPtr == NULL) {
	if (SetFsPathFromAny(NULL, pathPtr) != TCL_OK) {
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
    Tcl_Interp *interp,		/* Used for error reporting if not NULL. */
    Tcl_Obj *pathPtr)		/* The object to convert. */
{
    size_t len;
    FsPath *fsPathPtr;
    Tcl_Obj *transPtr;
    char *name;
    Tcl_ObjIntRep *irPtr = Tcl_FetchIntRep(pathPtr, &fsPathType);

    if (irPtr) {
	return TCL_OK;
    }

    /*
     * First step is to translate the filename. This is similar to







|







2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
    Tcl_Interp *interp,		/* Used for error reporting if not NULL. */
    Tcl_Obj *pathPtr)		/* The object to convert. */
{
    size_t len;
    FsPath *fsPathPtr;
    Tcl_Obj *transPtr;
    char *name;
    Tcl_ObjIntRep *irPtr = TclFetchIntRep(pathPtr, &fsPathType);

    if (irPtr) {
	return TCL_OK;
    }

    /*
     * First step is to translate the filename. This is similar to
2360
2361
2362
2363
2364
2365
2366
2367

2368
2369
2370
2371
2372
2373
2374

		/*
		 * Skip '~'. It's replaced by its expansion.
		 */

		objc--; objv++;
		while (objc--) {
		    TclpNativeJoinPath(transPtr, Tcl_GetString(*objv++));

		}
		TclDecrRefCount(parts);
	    } else {
		Tcl_Obj *pair[2];

		pair[0] = transPtr;
		pair[1] = Tcl_NewStringObj(name+split+1, -1);







|
>







2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378

		/*
		 * Skip '~'. It's replaced by its expansion.
		 */

		objc--; objv++;
		while (objc--) {
		    TclpNativeJoinPath(transPtr, TclGetString(*objv));
		    objv++;
		}
		TclDecrRefCount(parts);
	    } else {
		Tcl_Obj *pair[2];

		pair[0] = transPtr;
		pair[1] = Tcl_NewStringObj(name+split+1, -1);
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
 */

int
TclNativePathInFilesystem(
    Tcl_Obj *pathPtr,
    ClientData *clientDataPtr)
{
    Tcl_ObjIntRep *irPtr = Tcl_FetchIntRep(pathPtr, &fsPathType);

    /*
     * A special case is required to handle the empty path "". This is a valid
     * path (i.e. the user should be able to do 'file exists ""' without
     * throwing an error), but equally the path doesn't exist. Those are the
     * semantics of Tcl (at present anyway), so we have to abide by them here.
     */







|







2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
 */

int
TclNativePathInFilesystem(
    Tcl_Obj *pathPtr,
    ClientData *clientDataPtr)
{
    Tcl_ObjIntRep *irPtr = TclFetchIntRep(pathPtr, &fsPathType);

    /*
     * A special case is required to handle the empty path "". This is a valid
     * path (i.e. the user should be able to do 'file exists ""' without
     * throwing an error), but equally the path doesn't exist. Those are the
     * semantics of Tcl (at present anyway), so we have to abide by them here.
     */
Changes to generic/tclPkg.c.
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017

	if (objc != 3) {
	    Tcl_WrongNumArgs(interp, 2, objv, "package");
	    return TCL_ERROR;
	}
	pkgFiles = (PkgFiles *) Tcl_GetAssocData(interp, "tclPkgFiles", NULL);
	if (pkgFiles) {
	    Tcl_HashEntry *entry = Tcl_FindHashEntry(&pkgFiles->table, Tcl_GetString(objv[2]));
	    if (entry) {
		Tcl_SetObjResult(interp, (Tcl_Obj *)Tcl_GetHashValue(entry));
	    }
	}
	break;
    }
    case PKG_FORGET: {







|







1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017

	if (objc != 3) {
	    Tcl_WrongNumArgs(interp, 2, objv, "package");
	    return TCL_ERROR;
	}
	pkgFiles = (PkgFiles *) Tcl_GetAssocData(interp, "tclPkgFiles", NULL);
	if (pkgFiles) {
	    Tcl_HashEntry *entry = Tcl_FindHashEntry(&pkgFiles->table, TclGetString(objv[2]));
	    if (entry) {
		Tcl_SetObjResult(interp, (Tcl_Obj *)Tcl_GetHashValue(entry));
	    }
	}
	break;
    }
    case PKG_FORGET: {
Changes to generic/tclProc.c.
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
	ir.twoPtrValue.ptr2 = NULL;					\
	Tcl_StoreIntRep((objPtr), &tclProcBodyType, &ir);		\
    } while (0)

#define ProcGetIntRep(objPtr, procPtr)					\
    do {								\
	const Tcl_ObjIntRep *irPtr;					\
	irPtr = Tcl_FetchIntRep((objPtr), &tclProcBodyType);		\
	(procPtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL;		\
    } while (0)

/*
 * The [upvar]/[uplevel] level reference type. Uses the longValue field
 * to remember the integer value of a parsed #<integer> format.
 *







|







76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
	ir.twoPtrValue.ptr2 = NULL;					\
	Tcl_StoreIntRep((objPtr), &tclProcBodyType, &ir);		\
    } while (0)

#define ProcGetIntRep(objPtr, procPtr)					\
    do {								\
	const Tcl_ObjIntRep *irPtr;					\
	irPtr = TclFetchIntRep((objPtr), &tclProcBodyType);		\
	(procPtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL;		\
    } while (0)

/*
 * The [upvar]/[uplevel] level reference type. Uses the longValue field
 * to remember the integer value of a parsed #<integer> format.
 *
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
	Tcl_IncrRefCount((nsObjPtr));					\
	Tcl_StoreIntRep((objPtr), &lambdaType, &ir);			\
    } while (0)

#define LambdaGetIntRep(objPtr, procPtr, nsObjPtr)			\
    do {								\
	const Tcl_ObjIntRep *irPtr;					\
	irPtr = Tcl_FetchIntRep((objPtr), &lambdaType);			\
	(procPtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL;		\
	(nsObjPtr) = irPtr ? irPtr->twoPtrValue.ptr2 : NULL;		\
    } while (0)


/*
 *----------------------------------------------------------------------







|







122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
	Tcl_IncrRefCount((nsObjPtr));					\
	Tcl_StoreIntRep((objPtr), &lambdaType, &ir);			\
    } while (0)

#define LambdaGetIntRep(objPtr, procPtr, nsObjPtr)			\
    do {								\
	const Tcl_ObjIntRep *irPtr;					\
	irPtr = TclFetchIntRep((objPtr), &lambdaType);			\
	(procPtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL;		\
	(nsObjPtr) = irPtr ? irPtr->twoPtrValue.ptr2 : NULL;		\
    } while (0)


/*
 *----------------------------------------------------------------------
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
     *	   seem to make a lot of sense to verify the number of arguments we
     *	   are about to ignore ...
     *	 - could be enhanced to handle also non-empty bodies that contain only
     *	   comments; however, parsing the body will slow down the compilation
     *	   of all procs whose argument list is just _args_
     */

    if (Tcl_FetchIntRep(objv[3], &tclProcBodyType)) {
	goto done;
    }

    procArgs = TclGetString(objv[2]);

    while (*procArgs == ' ') {
	procArgs++;







|







325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
     *	   seem to make a lot of sense to verify the number of arguments we
     *	   are about to ignore ...
     *	 - could be enhanced to handle also non-empty bodies that contain only
     *	   comments; however, parsing the body will slow down the compilation
     *	   of all procs whose argument list is just _args_
     */

    if (objv[3]->typePtr == &tclProcBodyType) {
	goto done;
    }

    procArgs = TclGetString(objv[2]);

    while (*procArgs == ' ') {
	procArgs++;
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
	    procArgs++;
	}

	/*
	 * The argument list is just "args"; check the body
	 */

	procBody = TclGetString(objv[3]);
	numBytes = objv[3]->length;
	if (TclParseAllWhiteSpace(procBody, numBytes) < numBytes) {
	    goto done;
	}

	/*
	 * The body is just spaces: link the compileProc
	 */







|
<







350
351
352
353
354
355
356
357

358
359
360
361
362
363
364
	    procArgs++;
	}

	/*
	 * The argument list is just "args"; check the body
	 */

	procBody = TclGetStringFromObj(objv[3], &numBytes);

	if (TclParseAllWhiteSpace(procBody, numBytes) < numBytes) {
	    goto done;
	}

	/*
	 * The body is just spaces: link the compileProc
	 */
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
    Tcl_Obj *bodyPtr,		/* Command body. */
    Proc **procPtrPtr)		/* Returns: pointer to proc data. */
{
    Interp *iPtr = (Interp *) interp;

    register Proc *procPtr = NULL;
    int i, result, numArgs;
    size_t plen;
    const char *bytes, *argname, *argnamei;
    char argnamelast;
    register CompiledLocal *localPtr = NULL;
    Tcl_Obj *defPtr, *errorObj, **argArray;
    int precompiled = 0;

    ProcGetIntRep(bodyPtr, procPtr);
    if (procPtr != NULL) {
	/*
	 * Because the body is a TclProProcBody, the actual body is already
	 * compiled, and it is not shared with anyone else, so it's OK not to







<
<
<

|







403
404
405
406
407
408
409



410
411
412
413
414
415
416
417
418
    Tcl_Obj *bodyPtr,		/* Command body. */
    Proc **procPtrPtr)		/* Returns: pointer to proc data. */
{
    Interp *iPtr = (Interp *) interp;

    register Proc *procPtr = NULL;
    int i, result, numArgs;



    register CompiledLocal *localPtr = NULL;
    Tcl_Obj **argArray;
    int precompiled = 0;

    ProcGetIntRep(bodyPtr, procPtr);
    if (procPtr != NULL) {
	/*
	 * Because the body is a TclProProcBody, the actual body is already
	 * compiled, and it is not shared with anyone else, so it's OK not to
445
446
447
448
449
450
451

452
453
454
455
456
457
458
	 * means that the same code can not be shared by two procedures that
	 * have a different number of arguments, even if their bodies are
	 * identical. Note that we don't use Tcl_DuplicateObj since we would
	 * not want any bytecode internal representation.
	 */

	if (Tcl_IsShared(bodyPtr)) {

	    size_t length;
	    Tcl_Obj *sharedBodyPtr = bodyPtr;

	    bytes = TclGetStringFromObj(bodyPtr, &length);
	    bodyPtr = Tcl_NewStringObj(bytes, length);

	    /*







>







441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
	 * means that the same code can not be shared by two procedures that
	 * have a different number of arguments, even if their bodies are
	 * identical. Note that we don't use Tcl_DuplicateObj since we would
	 * not want any bytecode internal representation.
	 */

	if (Tcl_IsShared(bodyPtr)) {
	    const char *bytes;
	    size_t length;
	    Tcl_Obj *sharedBodyPtr = bodyPtr;

	    bytes = TclGetStringFromObj(bodyPtr, &length);
	    bodyPtr = Tcl_NewStringObj(bytes, length);

	    /*
507
508
509
510
511
512
513

514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570

571
572
573
574
575
576
577
578
	localPtr = procPtr->firstLocalPtr;
    } else {
	procPtr->numArgs = numArgs;
	procPtr->numCompiledLocals = numArgs;
    }

    for (i = 0; i < numArgs; i++) {

	int fieldCount, nameLength;
	size_t valueLength;
	Tcl_Obj **fieldValues;

	/*
	 * Now divide the specifier up into name and default.
	 */

	result = Tcl_ListObjGetElements(interp, argArray[i], &fieldCount,
		&fieldValues);
	if (result != TCL_OK) {
	    goto procError;
	}
	if (fieldCount > 2) {
	    errorObj = Tcl_NewStringObj(
		"too many fields in argument specifier \"", -1);
	    Tcl_AppendObjToObj(errorObj, argArray[i]);
	    Tcl_AppendToObj(errorObj, "\"", -1);
	    Tcl_SetObjResult(interp, errorObj);
	    Tcl_SetErrorCode(interp, "TCL", "OPERATION", "PROC",
		    "FORMALARGUMENTFORMAT", NULL);
	    goto procError;
	}
	if ((fieldCount == 0) || (fieldValues[0]->length == 0)) {
	    Tcl_SetObjResult(interp, Tcl_NewStringObj(
		    "argument with no name", -1));
	    Tcl_SetErrorCode(interp, "TCL", "OPERATION", "PROC",
		    "FORMALARGUMENTFORMAT", NULL);
	    goto procError;
	}

	argname = TclGetStringFromObj(fieldValues[0], &plen);
	nameLength = Tcl_NumUtfChars(argname, plen);
	if (fieldCount == 2) {
	    const char * value = TclGetString(fieldValues[1]);
	    valueLength = Tcl_NumUtfChars(value, fieldValues[1]->length);
	} else {
	    valueLength = 0;
	}

	/*
	 * Check that the formal parameter name is a scalar.
	 */

	argnamei = argname;
	argnamelast = argname[plen-1];
	while (plen--) {
	    if (argnamei[0] == '(') {
		if (argnamelast == ')') {	/* We have an array element. */
		    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
			    "formal parameter \"%s\" is an array element",
			    Tcl_GetString(fieldValues[0])));
		    Tcl_SetErrorCode(interp, "TCL", "OPERATION", "PROC",
			    "FORMALARGUMENTFORMAT", NULL);
		    goto procError;
		}
	    } else if ((argnamei[0] == ':') && (argnamei[1] == ':')) {

		errorObj = Tcl_NewStringObj("formal parameter \"", -1);
		Tcl_AppendObjToObj(errorObj, fieldValues[0]);
		Tcl_AppendToObj(errorObj, "\" is not a simple name", -1);
		Tcl_SetObjResult(interp, errorObj);
		Tcl_SetErrorCode(interp, "TCL", "OPERATION", "PROC",
			"FORMALARGUMENTFORMAT", NULL);
		goto procError;
	    }







>
|
|












|
















|
<
<
<
<
<
<
<






|
|
|
|


|




|
>
|







504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543







544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
	localPtr = procPtr->firstLocalPtr;
    } else {
	procPtr->numArgs = numArgs;
	procPtr->numCompiledLocals = numArgs;
    }

    for (i = 0; i < numArgs; i++) {
	const char *argname, *argnamei, *argnamelast;
	int fieldCount;
	size_t nameLength;
	Tcl_Obj **fieldValues;

	/*
	 * Now divide the specifier up into name and default.
	 */

	result = Tcl_ListObjGetElements(interp, argArray[i], &fieldCount,
		&fieldValues);
	if (result != TCL_OK) {
	    goto procError;
	}
	if (fieldCount > 2) {
	    Tcl_Obj *errorObj = Tcl_NewStringObj(
		"too many fields in argument specifier \"", -1);
	    Tcl_AppendObjToObj(errorObj, argArray[i]);
	    Tcl_AppendToObj(errorObj, "\"", -1);
	    Tcl_SetObjResult(interp, errorObj);
	    Tcl_SetErrorCode(interp, "TCL", "OPERATION", "PROC",
		    "FORMALARGUMENTFORMAT", NULL);
	    goto procError;
	}
	if ((fieldCount == 0) || (fieldValues[0]->length == 0)) {
	    Tcl_SetObjResult(interp, Tcl_NewStringObj(
		    "argument with no name", -1));
	    Tcl_SetErrorCode(interp, "TCL", "OPERATION", "PROC",
		    "FORMALARGUMENTFORMAT", NULL);
	    goto procError;
	}

	argname = TclGetStringFromObj(fieldValues[0], &nameLength);








	/*
	 * Check that the formal parameter name is a scalar.
	 */

	argnamei = argname;
	argnamelast = Tcl_UtfPrev(argname + nameLength, argname);
	while (argnamei < argnamelast) {
	    if (*argnamei == '(') {
		if (*argnamelast == ')') { /* We have an array element. */
		    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
			    "formal parameter \"%s\" is an array element",
			    TclGetString(fieldValues[0])));
		    Tcl_SetErrorCode(interp, "TCL", "OPERATION", "PROC",
			    "FORMALARGUMENTFORMAT", NULL);
		    goto procError;
		}
	    } else if (*argnamei == ':' && *(argnamei+1) == ':') {
		Tcl_Obj *errorObj = Tcl_NewStringObj(
		    "formal parameter \"", -1);
		Tcl_AppendObjToObj(errorObj, fieldValues[0]);
		Tcl_AppendToObj(errorObj, "\" is not a simple name", -1);
		Tcl_SetObjResult(interp, errorObj);
		Tcl_SetErrorCode(interp, "TCL", "OPERATION", "PROC",
			"FORMALARGUMENTFORMAT", NULL);
		goto procError;
	    }
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612

613
614
615
616
617

618
619
620
621
622
623
624
625
626
	     *
	     * The only other flag vlaue that is important to retrieve from
	     * precompiled procs is VAR_TEMPORARY (also unchanged). It is
	     * needed later when retrieving the variable names.
	     */

	    if ((localPtr->nameLength != nameLength)
		    || (Tcl_UtfNcmp(localPtr->name, argname, nameLength))
		    || (localPtr->frameIndex != i)
		    || !(localPtr->flags & VAR_ARGUMENT)
		    || (localPtr->defValuePtr == NULL && fieldCount == 2)
		    || (localPtr->defValuePtr != NULL && fieldCount != 2)) {
		Tcl_SetObjResult(interp, Tcl_ObjPrintf(
			"procedure \"%s\": formal parameter %d is "
			"inconsistent with precompiled body", procName, i));
		Tcl_SetErrorCode(interp, "TCL", "OPERATION", "PROC",
			"BYTECODELIES", NULL);
		goto procError;
	    }

	    /*
	     * Compare the default value if any.
	     */

	    if (localPtr->defValuePtr != NULL) {

		const char *tmpPtr = TclGetString(localPtr->defValuePtr);
		size_t tmpLength = localPtr->defValuePtr->length;

		if ((valueLength != tmpLength) ||
			Tcl_UtfNcmp(Tcl_GetString(fieldValues[1]), tmpPtr, tmpLength)) {

		    errorObj = Tcl_ObjPrintf(
			    "procedure \"%s\": formal parameter \"" ,procName);
		    Tcl_AppendObjToObj(errorObj, fieldValues[0]);
		    Tcl_AppendToObj(errorObj, "\" has "
			"default value inconsistent with precompiled body", -1);
		    Tcl_SetObjResult(interp, errorObj);
		    Tcl_SetErrorCode(interp, "TCL", "OPERATION", "PROC",
			    "BYTECODELIES", NULL);
		    goto procError;







|

















>
|
|

|
|
>
|
|







580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
	     *
	     * The only other flag vlaue that is important to retrieve from
	     * precompiled procs is VAR_TEMPORARY (also unchanged). It is
	     * needed later when retrieving the variable names.
	     */

	    if ((localPtr->nameLength != nameLength)
		    || (memcmp(localPtr->name, argname, nameLength) != 0)
		    || (localPtr->frameIndex != i)
		    || !(localPtr->flags & VAR_ARGUMENT)
		    || (localPtr->defValuePtr == NULL && fieldCount == 2)
		    || (localPtr->defValuePtr != NULL && fieldCount != 2)) {
		Tcl_SetObjResult(interp, Tcl_ObjPrintf(
			"procedure \"%s\": formal parameter %d is "
			"inconsistent with precompiled body", procName, i));
		Tcl_SetErrorCode(interp, "TCL", "OPERATION", "PROC",
			"BYTECODELIES", NULL);
		goto procError;
	    }

	    /*
	     * Compare the default value if any.
	     */

	    if (localPtr->defValuePtr != NULL) {
		size_t tmpLength, valueLength;
		const char *tmpPtr = TclGetStringFromObj(localPtr->defValuePtr, &tmpLength);
		const char *value = TclGetStringFromObj(fieldValues[1], &valueLength);

		if ((valueLength != tmpLength)
		     || memcmp(value, tmpPtr, tmpLength) != 0
		) {
		    Tcl_Obj *errorObj = Tcl_ObjPrintf(
			    "procedure \"%s\": formal parameter \"", procName);
		    Tcl_AppendObjToObj(errorObj, fieldValues[0]);
		    Tcl_AppendToObj(errorObj, "\" has "
			"default value inconsistent with precompiled body", -1);
		    Tcl_SetObjResult(interp, errorObj);
		    Tcl_SetErrorCode(interp, "TCL", "OPERATION", "PROC",
			    "BYTECODELIES", NULL);
		    goto procError;
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
	    } else {
		localPtr->defValuePtr = NULL;
	    }
	    memcpy(localPtr->name, argname, fieldValues[0]->length + 1);
	    if ((i == numArgs - 1)
		    && (localPtr->nameLength == 4)
		    && (localPtr->name[0] == 'a')
		    && (strcmp(localPtr->name, "args") == 0)) {
		localPtr->flags |= VAR_IS_ARGS;
	    }
	}
    }

    *procPtrPtr = procPtr;
    return TCL_OK;

  procError:
    if (precompiled) {
	procPtr->refCount--;
    } else {
	Tcl_DecrRefCount(bodyPtr);
	while (procPtr->firstLocalPtr != NULL) {
	    localPtr = procPtr->firstLocalPtr;
	    procPtr->firstLocalPtr = localPtr->nextPtr;

	    defPtr = localPtr->defValuePtr;
	    if (defPtr != NULL) {
		Tcl_DecrRefCount(defPtr);
	    }

	    Tcl_Free(localPtr);
	}
	Tcl_Free(procPtr);
    }
    return TCL_ERROR;







|

















|
<
|







653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678

679
680
681
682
683
684
685
686
	    } else {
		localPtr->defValuePtr = NULL;
	    }
	    memcpy(localPtr->name, argname, fieldValues[0]->length + 1);
	    if ((i == numArgs - 1)
		    && (localPtr->nameLength == 4)
		    && (localPtr->name[0] == 'a')
		    && (memcmp(localPtr->name, "args", 4) == 0)) {
		localPtr->flags |= VAR_IS_ARGS;
	    }
	}
    }

    *procPtrPtr = procPtr;
    return TCL_OK;

  procError:
    if (precompiled) {
	procPtr->refCount--;
    } else {
	Tcl_DecrRefCount(bodyPtr);
	while (procPtr->firstLocalPtr != NULL) {
	    localPtr = procPtr->firstLocalPtr;
	    procPtr->firstLocalPtr = localPtr->nextPtr;

	    if (localPtr->defValuePtr != NULL) {

		Tcl_DecrRefCount(localPtr->defValuePtr);
	    }

	    Tcl_Free(localPtr);
	}
	Tcl_Free(procPtr);
    }
    return TCL_ERROR;
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
	Tcl_GetWideIntFromObj(NULL, objPtr, &w);
	if (w < 0 || w > INT_MAX || curLevel > w + INT_MAX) {
	    result = -1;
	} else {
	    level = curLevel - level;
	    result = 1;
	}
    } else if ((irPtr = Tcl_FetchIntRep(objPtr, &levelReferenceType))) {
	level = irPtr->wideValue;
	result = 1;
    } else {
	name = TclGetString(objPtr);
	if (name[0] == '#') {
	    if (TCL_OK == Tcl_GetInt(NULL, name+1, &level)) {
		if (level < 0 || (level > 0 && name[1] == '-')) {







|







785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
	Tcl_GetWideIntFromObj(NULL, objPtr, &w);
	if (w < 0 || w > INT_MAX || curLevel > w + INT_MAX) {
	    result = -1;
	} else {
	    level = curLevel - level;
	    result = 1;
	}
    } else if ((irPtr = TclFetchIntRep(objPtr, &levelReferenceType))) {
	level = irPtr->wideValue;
	result = 1;
    } else {
	name = TclGetString(objPtr);
	if (name[0] == '#') {
	    if (TCL_OK == Tcl_GetInt(NULL, name+1, &level)) {
		if (level < 0 || (level > 0 && name[1] == '-')) {
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
     * length is not 2, then it cannot be converted to lambdaType.
     */

    result = TclListObjGetElements(NULL, objPtr, &objc, &objv);
    if ((result != TCL_OK) || ((objc != 2) && (objc != 3))) {
	Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		"can't interpret \"%s\" as a lambda expression",
		Tcl_GetString(objPtr)));
	Tcl_SetErrorCode(interp, "TCL", "VALUE", "LAMBDA", NULL);
	return TCL_ERROR;
    }

    argsPtr = objv[0];
    bodyPtr = objv[1];








|







2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
     * length is not 2, then it cannot be converted to lambdaType.
     */

    result = TclListObjGetElements(NULL, objPtr, &objc, &objv);
    if ((result != TCL_OK) || ((objc != 2) && (objc != 3))) {
	Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		"can't interpret \"%s\" as a lambda expression",
		TclGetString(objPtr)));
	Tcl_SetErrorCode(interp, "TCL", "VALUE", "LAMBDA", NULL);
	return TCL_ERROR;
    }

    argsPtr = objv[0];
    bodyPtr = objv[1];

Changes to generic/tclRegexp.c.
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
	ir.twoPtrValue.ptr2 = NULL;					\
	Tcl_StoreIntRep((objPtr), &tclRegexpType, &ir);			\
    } while (0)

#define RegexpGetIntRep(objPtr, rePtr)					\
    do {								\
	const Tcl_ObjIntRep *irPtr;					\
	irPtr = Tcl_FetchIntRep((objPtr), &tclRegexpType);		\
	(rePtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL;		\
    } while (0)


/*
 *----------------------------------------------------------------------
 *







|







117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
	ir.twoPtrValue.ptr2 = NULL;					\
	Tcl_StoreIntRep((objPtr), &tclRegexpType, &ir);			\
    } while (0)

#define RegexpGetIntRep(objPtr, rePtr)					\
    do {								\
	const Tcl_ObjIntRep *irPtr;					\
	irPtr = TclFetchIntRep((objPtr), &tclRegexpType);		\
	(rePtr) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL;		\
    } while (0)


/*
 *----------------------------------------------------------------------
 *
Changes to generic/tclResult.c.
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240

const char *
Tcl_GetStringResult(
    register Tcl_Interp *interp)/* Interpreter whose result to return. */
{
    Interp *iPtr = (Interp *) interp;

    return Tcl_GetString(iPtr->objResultPtr);
}

/*
 *----------------------------------------------------------------------
 *
 * Tcl_SetObjResult --
 *







|







226
227
228
229
230
231
232
233
234
235
236
237
238
239
240

const char *
Tcl_GetStringResult(
    register Tcl_Interp *interp)/* Interpreter whose result to return. */
{
    Interp *iPtr = (Interp *) interp;

    return TclGetString(iPtr->objResultPtr);
}

/*
 *----------------------------------------------------------------------
 *
 * Tcl_SetObjResult --
 *
379
380
381
382
383
384
385

386
387
388
389
390
391
392
393
394
395
396
397
398
    const char *element)	/* String to convert to list element and add
				 * to result. */
{
    Interp *iPtr = (Interp *) interp;
    Tcl_Obj *elementPtr = Tcl_NewStringObj(element, -1);
    Tcl_Obj *listPtr = Tcl_NewListObj(1, &elementPtr);
    const char *bytes;


    if (Tcl_IsShared(iPtr->objResultPtr)) {
	Tcl_SetObjResult(interp, Tcl_DuplicateObj(iPtr->objResultPtr));
    }
    bytes = TclGetString(iPtr->objResultPtr);
    if (TclNeedSpace(bytes, bytes+iPtr->objResultPtr->length)) {
	Tcl_AppendToObj(iPtr->objResultPtr, " ", 1);
    }
    Tcl_AppendObjToObj(iPtr->objResultPtr, listPtr);
    Tcl_DecrRefCount(listPtr);
}

/*







>




|
|







379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
    const char *element)	/* String to convert to list element and add
				 * to result. */
{
    Interp *iPtr = (Interp *) interp;
    Tcl_Obj *elementPtr = Tcl_NewStringObj(element, -1);
    Tcl_Obj *listPtr = Tcl_NewListObj(1, &elementPtr);
    const char *bytes;
    size_t length;

    if (Tcl_IsShared(iPtr->objResultPtr)) {
	Tcl_SetObjResult(interp, Tcl_DuplicateObj(iPtr->objResultPtr));
    }
    bytes = TclGetStringFromObj(iPtr->objResultPtr, &length);
    if (TclNeedSpace(bytes, bytes + length)) {
	Tcl_AppendToObj(iPtr->objResultPtr, " ", 1);
    }
    Tcl_AppendObjToObj(iPtr->objResultPtr, listPtr);
    Tcl_DecrRefCount(listPtr);
}

/*
Changes to generic/tclScan.c.
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599

    if (objc < 3) {
	Tcl_WrongNumArgs(interp, 1, objv,
		"string format ?varName ...?");
	return TCL_ERROR;
    }

    format = Tcl_GetString(objv[2]);
    numVars = objc-3;

    /*
     * Check for errors in the format string.
     */

    if (ValidateFormat(interp, format, numVars, &totalVars) == TCL_ERROR) {







|







585
586
587
588
589
590
591
592
593
594
595
596
597
598
599

    if (objc < 3) {
	Tcl_WrongNumArgs(interp, 1, objv,
		"string format ?varName ...?");
	return TCL_ERROR;
    }

    format = TclGetString(objv[2]);
    numVars = objc-3;

    /*
     * Check for errors in the format string.
     */

    if (ValidateFormat(interp, format, numVars, &totalVars) == TCL_ERROR) {
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
    if (totalVars > 0) {
	objs = Tcl_Alloc(sizeof(Tcl_Obj *) * totalVars);
	for (i = 0; i < totalVars; i++) {
	    objs[i] = NULL;
	}
    }

    string = Tcl_GetString(objv[1]);
    baseString = string;

    /*
     * Iterate over the format string filling in the result objects until we
     * reach the end of input, the end of the format string, or there is a
     * mismatch.
     */







|







607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
    if (totalVars > 0) {
	objs = Tcl_Alloc(sizeof(Tcl_Obj *) * totalVars);
	for (i = 0; i < totalVars; i++) {
	    objs[i] = NULL;
	}
    }

    string = TclGetString(objv[1]);
    baseString = string;

    /*
     * Iterate over the format string filling in the result objects until we
     * reach the end of input, the end of the format string, or there is a
     * mismatch.
     */
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
		Tcl_DecrRefCount(objPtr);
		string = end;
	    } else {
		double dvalue;
		if (Tcl_GetDoubleFromObj(NULL, objPtr, &dvalue) != TCL_OK) {
#ifdef ACCEPT_NAN
		    const Tcl_ObjIntRep *irPtr
			    = Tcl_FetchIntRep(objPtr, &tclDoubleType);
		    if (irPtr) {
			dvalue = irPtr->doubleValue;
		    } else
#endif
		    {
			Tcl_DecrRefCount(objPtr);
			goto done;







|







1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
		Tcl_DecrRefCount(objPtr);
		string = end;
	    } else {
		double dvalue;
		if (Tcl_GetDoubleFromObj(NULL, objPtr, &dvalue) != TCL_OK) {
#ifdef ACCEPT_NAN
		    const Tcl_ObjIntRep *irPtr
			    = TclFetchIntRep(objPtr, &tclDoubleType);
		    if (irPtr) {
			dvalue = irPtr->doubleValue;
		    } else
#endif
		    {
			Tcl_DecrRefCount(objPtr);
			goto done;
Changes to generic/tclStringObj.c.
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
    char *ptr = NULL;
    size_t attempt;

    if (objPtr->bytes == &tclEmptyString) {
	objPtr->bytes = NULL;
    }
    if (flag == 0 || stringPtr->allocated > 0) {
	if (needed <= STRING_MAXCHARS / 2) {
	    attempt = 2 * needed;
	    ptr = Tcl_AttemptRealloc(objPtr->bytes, attempt + 1);
	}
	if (ptr == NULL) {
	    /*
	     * Take care computing the amount of modest growth to avoid
	     * overflow into invalid argument values for attempt.
	     */

	    size_t limit = INT_MAX - needed;







<
|
|
<







137
138
139
140
141
142
143

144
145

146
147
148
149
150
151
152
    char *ptr = NULL;
    size_t attempt;

    if (objPtr->bytes == &tclEmptyString) {
	objPtr->bytes = NULL;
    }
    if (flag == 0 || stringPtr->allocated > 0) {

	attempt = 2 * needed;
	ptr = Tcl_AttemptRealloc(objPtr->bytes, attempt + 1);

	if (ptr == NULL) {
	    /*
	     * Take care computing the amount of modest growth to avoid
	     * overflow into invalid argument values for attempt.
	     */

	    size_t limit = INT_MAX - needed;
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
    Tcl_Obj *objPtr,
    size_t needed)
{
    /*
     * Pre-conditions:
     *	objPtr->typePtr == &tclStringType
     *	needed > stringPtr->maxChars
     *	needed < STRING_MAXCHARS
     */

    String *ptr = NULL, *stringPtr = GET_STRING(objPtr);
    size_t attempt;

    if (stringPtr->maxChars > 0) {
	/*
	 * Subsequent appends - apply the growth algorithm.
	 */

	if (needed <= STRING_MAXCHARS / 2) {
	    attempt = 2 * needed;
	    ptr = stringAttemptRealloc(stringPtr, attempt);
	}
	if (ptr == NULL) {
	    /*
	     * Take care computing the amount of modest growth to avoid
	     * overflow into invalid argument values for attempt.
	     */

	    size_t limit = STRING_MAXCHARS - needed;
	    size_t extra = needed - stringPtr->numChars
		    + TCL_MIN_UNICHAR_GROWTH;
	    size_t growth = (extra > limit) ? limit : extra;

	    attempt = needed + growth;
	    ptr = stringAttemptRealloc(stringPtr, attempt);
	}
    }
    if (ptr == NULL) {
	/*
	 * First allocation - just big enough; or last chance fallback.
	 */







<










<
|
|
<






<


<

|







174
175
176
177
178
179
180

181
182
183
184
185
186
187
188
189
190

191
192

193
194
195
196
197
198

199
200

201
202
203
204
205
206
207
208
209
    Tcl_Obj *objPtr,
    size_t needed)
{
    /*
     * Pre-conditions:
     *	objPtr->typePtr == &tclStringType
     *	needed > stringPtr->maxChars

     */

    String *ptr = NULL, *stringPtr = GET_STRING(objPtr);
    size_t attempt;

    if (stringPtr->maxChars > 0) {
	/*
	 * Subsequent appends - apply the growth algorithm.
	 */


	attempt = 2 * needed;
	ptr = stringAttemptRealloc(stringPtr, attempt);

	if (ptr == NULL) {
	    /*
	     * Take care computing the amount of modest growth to avoid
	     * overflow into invalid argument values for attempt.
	     */


	    size_t extra = needed - stringPtr->numChars
		    + TCL_MIN_UNICHAR_GROWTH;


	    attempt = needed + extra;
	    ptr = stringAttemptRealloc(stringPtr, attempt);
	}
    }
    if (ptr == NULL) {
	/*
	 * First allocation - just big enough; or last chance fallback.
	 */
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
	/*
	 * Invalidate the unicode data.
	 */

	stringPtr->numChars = TCL_AUTO_LENGTH;
	stringPtr->hasUnicode = 0;
    } else {
	/*
	 * Changing length of pure unicode string.
	 */

	stringCheckLimits(length);
	if (length > stringPtr->maxChars) {
	    stringPtr = stringRealloc(stringPtr, length);
	    SET_STRING(objPtr, stringPtr);
	    stringPtr->maxChars = length;
	}

	/*







<
<
<
<
<







843
844
845
846
847
848
849





850
851
852
853
854
855
856
	/*
	 * Invalidate the unicode data.
	 */

	stringPtr->numChars = TCL_AUTO_LENGTH;
	stringPtr->hasUnicode = 0;
    } else {





	if (length > stringPtr->maxChars) {
	    stringPtr = stringRealloc(stringPtr, length);
	    SET_STRING(objPtr, stringPtr);
	    stringPtr->maxChars = length;
	}

	/*
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
	stringPtr->numChars = TCL_AUTO_LENGTH;
	stringPtr->hasUnicode = 0;
    } else {
	/*
	 * Changing length of pure unicode string.
	 */

	if (length > STRING_MAXCHARS) {
	    return 0;
	}
	if (length > stringPtr->maxChars) {
	    stringPtr = stringAttemptRealloc(stringPtr, length);
	    if (stringPtr == NULL) {
		return 0;
	    }
	    SET_STRING(objPtr, stringPtr);
	    stringPtr->maxChars = length;







<
<
<







944
945
946
947
948
949
950



951
952
953
954
955
956
957
	stringPtr->numChars = TCL_AUTO_LENGTH;
	stringPtr->hasUnicode = 0;
    } else {
	/*
	 * Changing length of pure unicode string.
	 */




	if (length > stringPtr->maxChars) {
	    stringPtr = stringAttemptRealloc(stringPtr, length);
	    if (stringPtr == NULL) {
		return 0;
	    }
	    SET_STRING(objPtr, stringPtr);
	    stringPtr->maxChars = length;
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
    size_t numChars = 0;

    if (unicode) {
	while ((numChars != TCL_AUTO_LENGTH) && (unicode[numChars] != 0)) {
	    numChars++;
	}
    }
    stringCheckLimits(numChars);
    return numChars;
}

static void
SetUnicodeObj(
    Tcl_Obj *objPtr,		/* The object to set the string of. */
    const Tcl_UniChar *unicode,	/* The unicode string used to initialize the







<







1011
1012
1013
1014
1015
1016
1017

1018
1019
1020
1021
1022
1023
1024
    size_t numChars = 0;

    if (unicode) {
	while ((numChars != TCL_AUTO_LENGTH) && (unicode[numChars] != 0)) {
	    numChars++;
	}
    }

    return numChars;
}

static void
SetUnicodeObj(
    Tcl_Obj *objPtr,		/* The object to set the string of. */
    const Tcl_UniChar *unicode,	/* The unicode string used to initialize the
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
	numChars = UnicodeLength(unicode);
    }

    /*
     * Allocate enough space for the String structure + Unicode string.
     */

    stringCheckLimits(numChars);
    stringPtr = stringAlloc(numChars);
    SET_STRING(objPtr, stringPtr);
    objPtr->typePtr = &tclStringType;

    stringPtr->maxChars = numChars;
    memcpy(stringPtr->unicode, unicode, numChars * sizeof(Tcl_UniChar));
    stringPtr->unicode[numChars] = 0;







<







1032
1033
1034
1035
1036
1037
1038

1039
1040
1041
1042
1043
1044
1045
	numChars = UnicodeLength(unicode);
    }

    /*
     * Allocate enough space for the String structure + Unicode string.
     */


    stringPtr = stringAlloc(numChars);
    SET_STRING(objPtr, stringPtr);
    objPtr->typePtr = &tclStringType;

    stringPtr->maxChars = numChars;
    memcpy(stringPtr->unicode, unicode, numChars * sizeof(Tcl_UniChar));
    stringPtr->unicode[numChars] = 0;
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
     * the internal rep object with additional space. First try to double the
     * required allocation; if that fails, try a more modest increase. See the
     * "TCL STRING GROWTH ALGORITHM" comment at the top of this file for an
     * explanation of this growth algorithm.
     */

    numChars = stringPtr->numChars + appendNumChars;
    stringCheckLimits(numChars);

    if (numChars > stringPtr->maxChars) {
	size_t offset = TCL_AUTO_LENGTH;

	/*
	 * Protect against case where unicode points into the existing
	 * stringPtr->unicode array. Force it to follow any relocations due to







<







1398
1399
1400
1401
1402
1403
1404

1405
1406
1407
1408
1409
1410
1411
     * the internal rep object with additional space. First try to double the
     * required allocation; if that fails, try a more modest increase. See the
     * "TCL STRING GROWTH ALGORITHM" comment at the top of this file for an
     * explanation of this growth algorithm.
     */

    numChars = stringPtr->numChars + appendNumChars;


    if (numChars > stringPtr->maxChars) {
	size_t offset = TCL_AUTO_LENGTH;

	/*
	 * Protect against case where unicode points into the existing
	 * stringPtr->unicode array. Force it to follow any relocations due to
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
	} while (seekingConversion);
    }
    TclListObjGetElements(NULL, list, &objc, &objv);
    code = Tcl_AppendFormatToObj(NULL, objPtr, format, objc, objv);
    if (code != TCL_OK) {
	Tcl_AppendPrintfToObj(objPtr,
		"Unable to format \"%s\" with supplied arguments: %s",
		format, Tcl_GetString(list));
    }
    Tcl_DecrRefCount(list);
}

/*
 *---------------------------------------------------------------------------
 *







|







2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
	} while (seekingConversion);
    }
    TclListObjGetElements(NULL, list, &objc, &objv);
    code = Tcl_AppendFormatToObj(NULL, objPtr, format, objc, objv);
    if (code != TCL_OK) {
	Tcl_AppendPrintfToObj(objPtr,
		"Unable to format \"%s\" with supplied arguments: %s",
		format, TclGetString(list));
    }
    Tcl_DecrRefCount(list);
}

/*
 *---------------------------------------------------------------------------
 *
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
		unichar = 1;
	    }
	}
    }

    if (binary) {
	/* Result will be pure byte array. Pre-size it */
	TclGetByteArrayFromObj(objPtr, &length);
    } else if (unichar) {
	/* Result will be pure Tcl_UniChar array. Pre-size it. */
	TclGetUnicodeFromObj(objPtr, &length);
    } else {
	/* Result will be concat of string reps. Pre-size it. */
	(void)TclGetStringFromObj(objPtr, &length);
    }

    if (length == 0) {
	/* Any repeats of empty is empty. */







|


|







2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
		unichar = 1;
	    }
	}
    }

    if (binary) {
	/* Result will be pure byte array. Pre-size it */
	(void)TclGetByteArrayFromObj(objPtr, &length);
    } else if (unichar) {
	/* Result will be pure Tcl_UniChar array. Pre-size it. */
	(void)TclGetUnicodeFromObj(objPtr, &length);
    } else {
	/* Result will be concat of string reps. Pre-size it. */
	(void)TclGetStringFromObj(objPtr, &length);
    }

    if (length == 0) {
	/* Any repeats of empty is empty. */
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
		(count - done) * length);
    } else {
	/*
	 * Efficiently concatenate string reps.
	 */

	if (!inPlace || Tcl_IsShared(objPtr)) {
	    objResultPtr = Tcl_NewStringObj(Tcl_GetString(objPtr), length);
	} else {
	    TclFreeIntRep(objPtr);
	    objResultPtr = objPtr;
	}
        if (0 == Tcl_AttemptSetObjLength(objResultPtr, count*length)) {
	    if (interp) {
		Tcl_SetObjResult(interp, Tcl_ObjPrintf(
			"string size overflow: unable to alloc %" TCL_Z_MODIFIER "u bytes",
			count*length));
		Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
	    }
	    return NULL;
	}
	Tcl_SetObjLength(objResultPtr, length);
	while (count - done > done) {
	    Tcl_AppendObjToObj(objResultPtr, objResultPtr);
	    done *= 2;
	}
	Tcl_AppendToObj(objResultPtr, Tcl_GetString(objResultPtr),
		(count - done) * length);
    }
    return objResultPtr;
}

/*
 *---------------------------------------------------------------------------







|


















|







2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
		(count - done) * length);
    } else {
	/*
	 * Efficiently concatenate string reps.
	 */

	if (!inPlace || Tcl_IsShared(objPtr)) {
	    objResultPtr = Tcl_NewStringObj(TclGetString(objPtr), length);
	} else {
	    TclFreeIntRep(objPtr);
	    objResultPtr = objPtr;
	}
        if (0 == Tcl_AttemptSetObjLength(objResultPtr, count*length)) {
	    if (interp) {
		Tcl_SetObjResult(interp, Tcl_ObjPrintf(
			"string size overflow: unable to alloc %" TCL_Z_MODIFIER "u bytes",
			count*length));
		Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
	    }
	    return NULL;
	}
	Tcl_SetObjLength(objResultPtr, length);
	while (count - done > done) {
	    Tcl_AppendObjToObj(objResultPtr, objResultPtr);
	    done *= 2;
	}
	Tcl_AppendToObj(objResultPtr, TclGetString(objResultPtr),
		(count - done) * length);
    }
    return objResultPtr;
}

/*
 *---------------------------------------------------------------------------
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
	    /*
	     * Every argument is either a bytearray with a ("pure")
	     * value we know we can safely use, or it is an empty string.
	     * We don't need to count bytes for the empty strings.
	     */

	    if (TclIsPureByteArray(objPtr)) {
		TclGetByteArrayFromObj(objPtr, &numBytes); /* PANIC? */

		if (numBytes) {
		    last = objc - oc;
		    if (length == 0) {
			first = last;
		    }
		    length += numBytes;







|







2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
	    /*
	     * Every argument is either a bytearray with a ("pure")
	     * value we know we can safely use, or it is an empty string.
	     * We don't need to count bytes for the empty strings.
	     */

	    if (TclIsPureByteArray(objPtr)) {
		(void)TclGetByteArrayFromObj(objPtr, &numBytes); /* PANIC? */

		if (numBytes) {
		    last = objc - oc;
		    if (length == 0) {
			first = last;
		    }
		    length += numBytes;
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
	oc = objc;
	do {
	    Tcl_Obj *objPtr = *ov++;

	    if ((objPtr->bytes == NULL) || (objPtr->length)) {
		size_t numChars;

		TclGetUnicodeFromObj(objPtr, &numChars); /* PANIC? */
		if (numChars) {
		    last = objc - oc;
		    if (length == 0) {
			first = last;
		    }
		    length += numChars;
		}







|







2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
	oc = objc;
	do {
	    Tcl_Obj *objPtr = *ov++;

	    if ((objPtr->bytes == NULL) || (objPtr->length)) {
		size_t numChars;

		(void)TclGetUnicodeFromObj(objPtr, &numChars); /* PANIC? */
		if (numChars) {
		    last = objc - oc;
		    if (length == 0) {
			first = last;
		    }
		    length += numChars;
		}
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
		 * There's a pending value followed by more values.  Loop over
		 * remaining values generating strings until a non-empty value
		 * is found, or the pending value gets its string generated.
		 */

		do {
		    Tcl_Obj *objPtr = *ov++;
		    Tcl_GetString(objPtr); /* PANIC? */
		    numBytes = objPtr->length;
		} while (--oc && numBytes == 0 && pendingPtr->bytes == NULL);

		if (numBytes) {
		    last = objc -oc -1;
		}
		if (oc || numBytes) {
		    (void)TclGetStringFromObj(pendingPtr, &length);







|
<







3039
3040
3041
3042
3043
3044
3045
3046

3047
3048
3049
3050
3051
3052
3053
		 * There's a pending value followed by more values.  Loop over
		 * remaining values generating strings until a non-empty value
		 * is found, or the pending value gets its string generated.
		 */

		do {
		    Tcl_Obj *objPtr = *ov++;
		    (void)TclGetStringFromObj(objPtr, &numBytes); /* PANIC? */

		} while (--oc && numBytes == 0 && pendingPtr->bytes == NULL);

		if (numBytes) {
		    last = objc -oc -1;
		}
		if (oc || numBytes) {
		    (void)TclGetStringFromObj(pendingPtr, &length);
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098

	while (oc) {
	    size_t numBytes;
	    Tcl_Obj *objPtr = *ov++;

	    /* assert ( length > 0 && pendingPtr == NULL )  */

	    Tcl_GetString(objPtr); /* PANIC? */
	    numBytes = objPtr->length;
	    if (numBytes) {
		last = objc - oc;
		if (numBytes + length > (size_t)INT_MAX) {
		    goto overflow;
		}
		length += numBytes;







|







3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079

	while (oc) {
	    size_t numBytes;
	    Tcl_Obj *objPtr = *ov++;

	    /* assert ( length > 0 && pendingPtr == NULL )  */

	    TclGetString(objPtr); /* PANIC? */
	    numBytes = objPtr->length;
	    if (numBytes) {
		last = objc - oc;
		if (numBytes + length > (size_t)INT_MAX) {
		    goto overflow;
		}
		length += numBytes;
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
	 * failure to allocate enough space. Following stanza may panic.
	 */

	if (inPlace && !Tcl_IsShared(*objv)) {
	    size_t start;

	    objResultPtr = *objv++; objc--;
	    TclGetByteArrayFromObj(objResultPtr, &start);
	    dst = Tcl_SetByteArrayLength(objResultPtr, length) + start;
	} else {
	    objResultPtr = Tcl_NewByteArrayObj(NULL, length);
	    dst = Tcl_SetByteArrayLength(objResultPtr, length);
	}
	while (objc--) {
	    Tcl_Obj *objPtr = *objv++;







|







3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
	 * failure to allocate enough space. Following stanza may panic.
	 */

	if (inPlace && !Tcl_IsShared(*objv)) {
	    size_t start;

	    objResultPtr = *objv++; objc--;
	    (void)TclGetByteArrayFromObj(objResultPtr, &start);
	    dst = Tcl_SetByteArrayLength(objResultPtr, length) + start;
	} else {
	    objResultPtr = Tcl_NewByteArrayObj(NULL, length);
	    dst = Tcl_SetByteArrayLength(objResultPtr, length);
	}
	while (objc--) {
	    Tcl_Obj *objPtr = *objv++;
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164

	if (inPlace && !Tcl_IsShared(*objv)) {
	    size_t start;

	    objResultPtr = *objv++; objc--;

	    /* Ugly interface! Force resize of the unicode array. */
	    TclGetUnicodeFromObj(objResultPtr, &start);
	    Tcl_InvalidateStringRep(objResultPtr);
	    if (0 == Tcl_AttemptSetObjLength(objResultPtr, length)) {
		if (interp) {
		    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		    	"concatenation failed: unable to alloc %"
			TCL_Z_MODIFIER "u bytes",
			STRING_SIZE(length)));







|







3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145

	if (inPlace && !Tcl_IsShared(*objv)) {
	    size_t start;

	    objResultPtr = *objv++; objc--;

	    /* Ugly interface! Force resize of the unicode array. */
	    (void)TclGetUnicodeFromObj(objResultPtr, &start);
	    Tcl_InvalidateStringRep(objResultPtr);
	    if (0 == Tcl_AttemptSetObjLength(objResultPtr, length)) {
		if (interp) {
		    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		    	"concatenation failed: unable to alloc %"
			TCL_Z_MODIFIER "u bytes",
			STRING_SIZE(length)));
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
		    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		    	"concatenation failed: unable to alloc %" TCL_Z_MODIFIER "u bytes",
			length));
		    Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
		}
		return NULL;
	    }
	    dst = Tcl_GetString(objResultPtr) + start;

	    /* assert ( length > start ) */
	    TclFreeIntRep(objResultPtr);
	} else {
	    objResultPtr = Tcl_NewObj();	/* PANIC? */
	    if (0 == Tcl_AttemptSetObjLength(objResultPtr, length)) {
		Tcl_DecrRefCount(objResultPtr);
		if (interp) {
		    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		    	"concatenation failed: unable to alloc %" TCL_Z_MODIFIER "u bytes",
			length));
		    Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
		}
		return NULL;
	    }
	    dst = Tcl_GetString(objResultPtr);
	}
	while (objc--) {
	    Tcl_Obj *objPtr = *objv++;

	    if ((objPtr->bytes == NULL) || (objPtr->length)) {
		size_t more;
		char *src = TclGetStringFromObj(objPtr, &more);

		memcpy(dst, src, (size_t) more);
		dst += more;
	    }
	}
	/* Must NUL-terminate! */
	*dst = '\0';
    }
    return objResultPtr;







|















|








|







3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
		    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		    	"concatenation failed: unable to alloc %" TCL_Z_MODIFIER "u bytes",
			length));
		    Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
		}
		return NULL;
	    }
	    dst = TclGetString(objResultPtr) + start;

	    /* assert ( length > start ) */
	    TclFreeIntRep(objResultPtr);
	} else {
	    objResultPtr = Tcl_NewObj();	/* PANIC? */
	    if (0 == Tcl_AttemptSetObjLength(objResultPtr, length)) {
		Tcl_DecrRefCount(objResultPtr);
		if (interp) {
		    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		    	"concatenation failed: unable to alloc %" TCL_Z_MODIFIER "u bytes",
			length));
		    Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL);
		}
		return NULL;
	    }
	    dst = TclGetString(objResultPtr);
	}
	while (objc--) {
	    Tcl_Obj *objPtr = *objv++;

	    if ((objPtr->bytes == NULL) || (objPtr->length)) {
		size_t more;
		char *src = TclGetStringFromObj(objPtr, &more);

		memcpy(dst, src, more);
		dst += more;
	    }
	}
	/* Must NUL-terminate! */
	*dst = '\0';
    }
    return objResultPtr;
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
	    match = 1;		/* This will be reversed below. */
	} else {
	    /*
	     * The comparison function should compare up to the minimum byte
	     * length only.
	     */

	    match = memCmpFn(s1, s2, (size_t) length);
	}
	if ((match == 0) && (reqlength > length)) {
	    match = s1len - s2len;
	}
	match = (match > 0) ? 1 : (match < 0) ? -1 : 0;
    }
  matchdone:







|







3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
	    match = 1;		/* This will be reversed below. */
	} else {
	    /*
	     * The comparison function should compare up to the minimum byte
	     * length only.
	     */

	    match = memCmpFn(s1, s2, length);
	}
	if ((match == 0) && (reqlength > length)) {
	    match = s1len - s2len;
	}
	match = (match > 0) ? 1 : (match < 0) ? -1 : 0;
    }
  matchdone:
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
    if (stringPtr->hasUnicode) {
	numOrigChars = stringPtr->numChars;
    }
    if (numAppendChars == TCL_AUTO_LENGTH) {
	TclNumUtfChars(numAppendChars, bytes, numBytes);
    }
    needed = numOrigChars + numAppendChars;
    stringCheckLimits(needed);

    if (needed > stringPtr->maxChars) {
	GrowUnicodeBuffer(objPtr, needed);
	stringPtr = GET_STRING(objPtr);
    }

    stringPtr->hasUnicode = 1;







<







3936
3937
3938
3939
3940
3941
3942

3943
3944
3945
3946
3947
3948
3949
    if (stringPtr->hasUnicode) {
	numOrigChars = stringPtr->numChars;
    }
    if (numAppendChars == TCL_AUTO_LENGTH) {
	TclNumUtfChars(numAppendChars, bytes, numBytes);
    }
    needed = numOrigChars + numAppendChars;


    if (needed > stringPtr->maxChars) {
	GrowUnicodeBuffer(objPtr, needed);
	stringPtr = GET_STRING(objPtr);
    }

    stringPtr->hasUnicode = 1;
Changes to generic/tclStringRep.h.
27
28
29
30
31
32
33




34
35
36
37
38
39
40
 *
 * Copyright (c) 1995-1997 Sun Microsystems, Inc.
 * Copyright (c) 1999 by Scriptics Corporation.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 */





/*
 * The following structure is the internal rep for a String object. It keeps
 * track of how much memory has been used and how much has been allocated for
 * the Unicode and UTF string to enable growing and shrinking of the UTF and
 * Unicode reps of the String object with fewer mallocs. To optimize string
 * length and indexing operations, this structure also stores the number of







>
>
>
>







27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
 *
 * Copyright (c) 1995-1997 Sun Microsystems, Inc.
 * Copyright (c) 1999 by Scriptics Corporation.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 */

#ifndef _TCLSTRINGREP
#define _TCLSTRINGREP


/*
 * The following structure is the internal rep for a String object. It keeps
 * track of how much memory has been used and how much has been allocated for
 * the Unicode and UTF string to enable growing and shrinking of the UTF and
 * Unicode reps of the String object with fewer mallocs. To optimize string
 * length and indexing operations, this structure also stores the number of
60
61
62
63
64
65
66
67
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
97
98
    int hasUnicode;		/* Boolean determining whether the string has
				 * a Unicode representation. */
    Tcl_UniChar unicode[1];	/* The array of Unicode chars. The actual size
				 * of this field depends on the 'maxChars'
				 * field above. */
} String;

#define STRING_MAXCHARS \
    ((UINT_MAX - sizeof(String))/sizeof(Tcl_UniChar))
#define STRING_SIZE(numChars) \
    (sizeof(String) + ((numChars) * sizeof(Tcl_UniChar)))
#define stringCheckLimits(numChars) \
    do {								\
	if ((size_t)(numChars) > STRING_MAXCHARS) {		\
	    Tcl_Panic("max length for a Tcl unicode value (%" TCL_Z_MODIFIER "u chars) exceeded", \
		      STRING_MAXCHARS);					\
	}								\
    } while (0)
#define stringAttemptAlloc(numChars) \
    (String *) Tcl_AttemptAlloc(STRING_SIZE(numChars))
#define stringAlloc(numChars) \
    (String *) Tcl_Alloc(STRING_SIZE(numChars))
#define stringRealloc(ptr, numChars) \
    (String *) Tcl_Realloc((ptr), STRING_SIZE(numChars))
#define stringAttemptRealloc(ptr, numChars) \
    (String *) Tcl_AttemptRealloc((ptr), STRING_SIZE(numChars))
#define GET_STRING(objPtr) \
    ((String *) (objPtr)->internalRep.twoPtrValue.ptr1)
#define SET_STRING(objPtr, stringPtr) \
    ((objPtr)->internalRep.twoPtrValue.ptr2 = NULL),			\
    ((objPtr)->internalRep.twoPtrValue.ptr1 = (void *) (stringPtr))


/*
 * Local Variables:
 * mode: c
 * c-basic-offset: 4
 * fill-column: 78
 * End:
 */







<
<


<
<
<
<
<
<
<














>







64
65
66
67
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
    int hasUnicode;		/* Boolean determining whether the string has
				 * a Unicode representation. */
    Tcl_UniChar unicode[1];	/* The array of Unicode chars. The actual size
				 * of this field depends on the 'maxChars'
				 * field above. */
} String;



#define STRING_SIZE(numChars) \
    (sizeof(String) + ((numChars) * sizeof(Tcl_UniChar)))







#define stringAttemptAlloc(numChars) \
    (String *) Tcl_AttemptAlloc(STRING_SIZE(numChars))
#define stringAlloc(numChars) \
    (String *) Tcl_Alloc(STRING_SIZE(numChars))
#define stringRealloc(ptr, numChars) \
    (String *) Tcl_Realloc((ptr), STRING_SIZE(numChars))
#define stringAttemptRealloc(ptr, numChars) \
    (String *) Tcl_AttemptRealloc((ptr), STRING_SIZE(numChars))
#define GET_STRING(objPtr) \
    ((String *) (objPtr)->internalRep.twoPtrValue.ptr1)
#define SET_STRING(objPtr, stringPtr) \
    ((objPtr)->internalRep.twoPtrValue.ptr2 = NULL),			\
    ((objPtr)->internalRep.twoPtrValue.ptr1 = (void *) (stringPtr))

#endif /*  _TCLSTRINGREP */
/*
 * Local Variables:
 * mode: c
 * c-basic-offset: 4
 * fill-column: 78
 * End:
 */
Changes to generic/tclStubInit.c.
744
745
746
747
748
749
750




751
752
753
754
755
756
757
    0, /* 66 */
    TclBN_mp_expt_d_ex, /* 67 */
    TclBN_mp_set_long_long, /* 68 */
    TclBN_mp_get_long_long, /* 69 */
    TclBN_mp_set_long, /* 70 */
    TclBN_mp_get_long, /* 71 */
    TclBN_mp_get_int, /* 72 */




};

static const TclStubHooks tclStubHooks = {
    &tclPlatStubs,
    &tclIntStubs,
    &tclIntPlatStubs
};







>
>
>
>







744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
    0, /* 66 */
    TclBN_mp_expt_d_ex, /* 67 */
    TclBN_mp_set_long_long, /* 68 */
    TclBN_mp_get_long_long, /* 69 */
    TclBN_mp_set_long, /* 70 */
    TclBN_mp_get_long, /* 71 */
    TclBN_mp_get_int, /* 72 */
    TclBN_mp_tc_and, /* 73 */
    TclBN_mp_tc_or, /* 74 */
    TclBN_mp_tc_xor, /* 75 */
    TclBN_mp_tc_div_2d, /* 76 */
};

static const TclStubHooks tclStubHooks = {
    &tclPlatStubs,
    &tclIntStubs,
    &tclIntPlatStubs
};
Changes to generic/tclTest.c.
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
    if (!asyncPtr) {
        /* Woops - this one was deleted between the AsyncMark and now */
        return TCL_OK;
    }

    TclFormatInt(string, code);
    listArgv[0] = asyncPtr->command;
    listArgv[1] = Tcl_GetString(Tcl_GetObjResult(interp));
    listArgv[2] = string;
    listArgv[3] = NULL;
    cmd = Tcl_Merge(3, listArgv);
    if (interp != NULL) {
	code = Tcl_EvalEx(interp, cmd, -1, 0);
    } else {
	/*







|







972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
    if (!asyncPtr) {
        /* Woops - this one was deleted between the AsyncMark and now */
        return TCL_OK;
    }

    TclFormatInt(string, code);
    listArgv[0] = asyncPtr->command;
    listArgv[1] = Tcl_GetStringResult(interp);
    listArgv[2] = string;
    listArgv[3] = NULL;
    cmd = Tcl_Merge(3, listArgv);
    if (interp != NULL) {
	code = Tcl_EvalEx(interp, cmd, -1, 0);
    } else {
	/*
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
    objPtr->internalRep.twoPtrValue.ptr1 = NULL;
    objPtr->internalRep.twoPtrValue.ptr2 = NULL;
    */
    memset(&objPtr->internalRep, 0, sizeof(objPtr->internalRep));
    if (objc == 2) {
	const char *s = Tcl_GetString(objv[1]);
	objPtr->length = objv[1]->length;
	objPtr->bytes = ckalloc(objPtr->length + 1);
	memcpy(objPtr->bytes, s, objPtr->length);
	objPtr->bytes[objPtr->length] = 0;
    }
    Tcl_SetObjResult(interp, objPtr);
    return TCL_OK;
}








|







4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
    objPtr->internalRep.twoPtrValue.ptr1 = NULL;
    objPtr->internalRep.twoPtrValue.ptr2 = NULL;
    */
    memset(&objPtr->internalRep, 0, sizeof(objPtr->internalRep));
    if (objc == 2) {
	const char *s = Tcl_GetString(objv[1]);
	objPtr->length = objv[1]->length;
	objPtr->bytes = Tcl_Alloc(objPtr->length + 1);
	memcpy(objPtr->bytes, s, objPtr->length);
	objPtr->bytes[objPtr->length] = 0;
    }
    Tcl_SetObjResult(interp, objPtr);
    return TCL_OK;
}

Changes to generic/tclThreadTest.c.
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
	     * Possibly -joinable, then no special script, no joinable, then
	     * its a script.
	     */

	    script = Tcl_GetStringFromObj(objv[2], &len);

	    if ((len > 1) && (script[0] == '-') && (script[1] == 'j') &&
		    (0 == strncmp(script, "-joinable", (size_t) len))) {
		joinable = 1;
		script = "testthread wait";	/* Just enter event loop */
	    } else {
		/*
		 * Remember the script
		 */

		joinable = 0;
	    }
	} else if (objc == 4) {
	    /*
	     * Definitely a script available, but is the flag -joinable?
	     */

	    script = Tcl_GetStringFromObj(objv[2], &len);
	    joinable = ((len > 1) && (script[0] == '-') && (script[1] == 'j')
		    && (0 == strncmp(script, "-joinable", (size_t) len)));
	    script = Tcl_GetString(objv[3]);
	} else {
	    Tcl_WrongNumArgs(interp, 2, objv, "?-joinable? ?script?");
	    return TCL_ERROR;
	}
	return ThreadCreate(interp, script, joinable);
    }







|
















|







290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
	     * Possibly -joinable, then no special script, no joinable, then
	     * its a script.
	     */

	    script = Tcl_GetStringFromObj(objv[2], &len);

	    if ((len > 1) && (script[0] == '-') && (script[1] == 'j') &&
		    (0 == strncmp(script, "-joinable", len))) {
		joinable = 1;
		script = "testthread wait";	/* Just enter event loop */
	    } else {
		/*
		 * Remember the script
		 */

		joinable = 0;
	    }
	} else if (objc == 4) {
	    /*
	     * Definitely a script available, but is the flag -joinable?
	     */

	    script = Tcl_GetStringFromObj(objv[2], &len);
	    joinable = ((len > 1) && (script[0] == '-') && (script[1] == 'j')
		    && (0 == strncmp(script, "-joinable", len)));
	    script = Tcl_GetString(objv[3]);
	} else {
	    Tcl_WrongNumArgs(interp, 2, objv, "?-joinable? ?script?");
	    return TCL_ERROR;
	}
	return ThreadCreate(interp, script, joinable);
    }
Changes to generic/tclTimer.c.
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
    /*
     * First lets see if the command was passed a number as the first argument.
     */

    if (Tcl_GetWideIntFromObj(NULL, objv[1], &ms) != TCL_OK) {
	if (Tcl_GetIndexFromObj(NULL, objv[1], afterSubCmds, "", 0, &index)
		!= TCL_OK) {
            const char *arg = Tcl_GetString(objv[1]);

	    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
                    "bad argument \"%s\": must be"
                    " cancel, idle, info, or an integer", arg));
            Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "INDEX", "argument",
                    arg, NULL);
	    return TCL_ERROR;







|







817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
    /*
     * First lets see if the command was passed a number as the first argument.
     */

    if (Tcl_GetWideIntFromObj(NULL, objv[1], &ms) != TCL_OK) {
	if (Tcl_GetIndexFromObj(NULL, objv[1], afterSubCmds, "", 0, &index)
		!= TCL_OK) {
            const char *arg = TclGetString(objv[1]);

	    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
                    "bad argument \"%s\": must be"
                    " cancel, idle, info, or an integer", arg));
            Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "INDEX", "argument",
                    arg, NULL);
	    return TCL_ERROR;
Changes to generic/tclTomMath.decls.
252
253
254
255
256
257
258















259
260
261
262
}
declare 71 {
    unsigned long TclBN_mp_get_long(const mp_int *a)
}
declare 72 {
    unsigned long TclBN_mp_get_int(const mp_int *a)
}
















# Local Variables:
# mode: tcl
# End:







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>




252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
}
declare 71 {
    unsigned long TclBN_mp_get_long(const mp_int *a)
}
declare 72 {
    unsigned long TclBN_mp_get_int(const mp_int *a)
}

# Added in libtommath 1.1.0
declare 73 {
    int TclBN_mp_tc_and(const mp_int *a, const mp_int *b, mp_int *c)
}
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_tc_div_2d(const mp_int *a, int b, mp_int *c)
}


# Local Variables:
# mode: tcl
# End:
Changes to generic/tclTomMathDecls.h.
103
104
105
106
107
108
109




110
111
112
113
114
115
116
#define mp_set_long TclBN_mp_set_long
#define mp_set_long_long TclBN_mp_set_long_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_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 mp_toom_sqr TclBN_mp_toom_sqr
#define mp_toradix_n TclBN_mp_toradix_n
#define mp_unsigned_bin_size TclBN_mp_unsigned_bin_size
#define mp_xor TclBN_mp_xor







>
>
>
>







103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#define mp_set_long TclBN_mp_set_long
#define mp_set_long_long TclBN_mp_set_long_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_tc_and TclBN_mp_tc_and
#define mp_tc_div_2d TclBN_mp_tc_div_2d
#define mp_tc_or TclBN_mp_tc_or
#define mp_tc_xor TclBN_mp_tc_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 mp_toom_sqr TclBN_mp_toom_sqr
#define mp_toradix_n TclBN_mp_toradix_n
#define mp_unsigned_bin_size TclBN_mp_unsigned_bin_size
#define mp_xor TclBN_mp_xor
313
314
315
316
317
318
319











320
321
322
323
324
325
326
EXTERN Tcl_WideUInt	TclBN_mp_get_long_long(const mp_int *a);
/* 70 */
EXTERN int		TclBN_mp_set_long(mp_int *a, unsigned long i);
/* 71 */
EXTERN unsigned long	TclBN_mp_get_long(const mp_int *a);
/* 72 */
EXTERN unsigned long	TclBN_mp_get_int(const mp_int *a);












typedef struct TclTomMathStubs {
    int magic;
    void *hooks;

    int (*tclBN_epoch) (void); /* 0 */
    int (*tclBN_revision) (void); /* 1 */







>
>
>
>
>
>
>
>
>
>
>







317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
EXTERN Tcl_WideUInt	TclBN_mp_get_long_long(const mp_int *a);
/* 70 */
EXTERN int		TclBN_mp_set_long(mp_int *a, unsigned long i);
/* 71 */
EXTERN unsigned long	TclBN_mp_get_long(const mp_int *a);
/* 72 */
EXTERN unsigned long	TclBN_mp_get_int(const mp_int *a);
/* 73 */
EXTERN int		TclBN_mp_tc_and(const mp_int *a, const mp_int *b,
				mp_int *c);
/* 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_tc_div_2d(const mp_int *a, int b, mp_int *c);

typedef struct TclTomMathStubs {
    int magic;
    void *hooks;

    int (*tclBN_epoch) (void); /* 0 */
    int (*tclBN_revision) (void); /* 1 */
391
392
393
394
395
396
397




398
399
400
401
402
403
404
    void (*reserved66)(void);
    int (*tclBN_mp_expt_d_ex) (const mp_int *a, mp_digit b, mp_int *c, int fast); /* 67 */
    int (*tclBN_mp_set_long_long) (mp_int *a, Tcl_WideUInt i); /* 68 */
    Tcl_WideUInt (*tclBN_mp_get_long_long) (const mp_int *a); /* 69 */
    int (*tclBN_mp_set_long) (mp_int *a, unsigned long i); /* 70 */
    unsigned long (*tclBN_mp_get_long) (const mp_int *a); /* 71 */
    unsigned long (*tclBN_mp_get_int) (const mp_int *a); /* 72 */




} TclTomMathStubs;

extern const TclTomMathStubs *tclTomMathStubsPtr;

#ifdef __cplusplus
}
#endif







>
>
>
>







406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
    void (*reserved66)(void);
    int (*tclBN_mp_expt_d_ex) (const mp_int *a, mp_digit b, mp_int *c, int fast); /* 67 */
    int (*tclBN_mp_set_long_long) (mp_int *a, Tcl_WideUInt i); /* 68 */
    Tcl_WideUInt (*tclBN_mp_get_long_long) (const mp_int *a); /* 69 */
    int (*tclBN_mp_set_long) (mp_int *a, unsigned long i); /* 70 */
    unsigned long (*tclBN_mp_get_long) (const mp_int *a); /* 71 */
    unsigned long (*tclBN_mp_get_int) (const mp_int *a); /* 72 */
    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_tc_div_2d) (const mp_int *a, int b, mp_int *c); /* 76 */
} TclTomMathStubs;

extern const TclTomMathStubs *tclTomMathStubsPtr;

#ifdef __cplusplus
}
#endif
548
549
550
551
552
553
554








555
556
557
558
559
560
561
562
563
	(tclTomMathStubsPtr->tclBN_mp_get_long_long) /* 69 */
#define TclBN_mp_set_long \
	(tclTomMathStubsPtr->tclBN_mp_set_long) /* 70 */
#define TclBN_mp_get_long \
	(tclTomMathStubsPtr->tclBN_mp_get_long) /* 71 */
#define TclBN_mp_get_int \
	(tclTomMathStubsPtr->tclBN_mp_get_int) /* 72 */









#endif /* defined(USE_TCL_STUBS) */

/* !END!: Do not edit above this line. */

#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT

#endif /* _TCLINTDECLS */







>
>
>
>
>
>
>
>









567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
	(tclTomMathStubsPtr->tclBN_mp_get_long_long) /* 69 */
#define TclBN_mp_set_long \
	(tclTomMathStubsPtr->tclBN_mp_set_long) /* 70 */
#define TclBN_mp_get_long \
	(tclTomMathStubsPtr->tclBN_mp_get_long) /* 71 */
#define TclBN_mp_get_int \
	(tclTomMathStubsPtr->tclBN_mp_get_int) /* 72 */
#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_tc_div_2d \
	(tclTomMathStubsPtr->tclBN_mp_tc_div_2d) /* 76 */

#endif /* defined(USE_TCL_STUBS) */

/* !END!: Do not edit above this line. */

#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT

#endif /* _TCLINTDECLS */
Changes to generic/tclTrace.c.
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
	Tcl_Obj *resultListPtr, *pairObjPtr, *elemObjPtr;

	if (objc != 3) {
	    Tcl_WrongNumArgs(interp, 2, objv, "name");
	    return TCL_ERROR;
	}
	resultListPtr = Tcl_NewObj();
	name = Tcl_GetString(objv[2]);
	FOREACH_VAR_TRACE(interp, name, clientData) {
	    TraceVarInfo *tvarPtr = clientData;
	    char *q = ops;

	    pairObjPtr = Tcl_NewListObj(0, NULL);
	    if (tvarPtr->flags & TCL_TRACE_READS) {
		*q = 'r';







|







320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
	Tcl_Obj *resultListPtr, *pairObjPtr, *elemObjPtr;

	if (objc != 3) {
	    Tcl_WrongNumArgs(interp, 2, objv, "name");
	    return TCL_ERROR;
	}
	resultListPtr = Tcl_NewObj();
	name = TclGetString(objv[2]);
	FOREACH_VAR_TRACE(interp, name, clientData) {
	    TraceVarInfo *tvarPtr = clientData;
	    char *q = ops;

	    pairObjPtr = Tcl_NewListObj(0, NULL);
	    if (tvarPtr->flags & TCL_TRACE_READS) {
		*q = 'r';
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
	    tcmdPtr->refCount = 1;
	    flags |= TCL_TRACE_DELETE;
	    if (flags & (TCL_TRACE_ENTER_DURING_EXEC |
		    TCL_TRACE_LEAVE_DURING_EXEC)) {
		flags |= (TCL_TRACE_ENTER_EXEC | TCL_TRACE_LEAVE_EXEC);
	    }
	    memcpy(tcmdPtr->command, command, length+1);
	    name = Tcl_GetString(objv[3]);
	    if (Tcl_TraceCommand(interp, name, flags, TraceCommandProc,
		    tcmdPtr) != TCL_OK) {
		Tcl_Free(tcmdPtr);
		return TCL_ERROR;
	    }
	} else {
	    /*
	     * Search through all of our traces on this command to see if
	     * there's one with the given command. If so, then delete the
	     * first one that matches.
	     */

	    ClientData clientData;

	    /*
	     * First ensure the name given is valid.
	     */

	    name = Tcl_GetString(objv[3]);
	    if (Tcl_FindCommand(interp,name,NULL,TCL_LEAVE_ERR_MSG) == NULL) {
		return TCL_ERROR;
	    }

	    FOREACH_COMMAND_TRACE(interp, name, clientData) {
		TraceCommandInfo *tcmdPtr = clientData;








|


















|







481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
	    tcmdPtr->refCount = 1;
	    flags |= TCL_TRACE_DELETE;
	    if (flags & (TCL_TRACE_ENTER_DURING_EXEC |
		    TCL_TRACE_LEAVE_DURING_EXEC)) {
		flags |= (TCL_TRACE_ENTER_EXEC | TCL_TRACE_LEAVE_EXEC);
	    }
	    memcpy(tcmdPtr->command, command, length+1);
	    name = TclGetString(objv[3]);
	    if (Tcl_TraceCommand(interp, name, flags, TraceCommandProc,
		    tcmdPtr) != TCL_OK) {
		Tcl_Free(tcmdPtr);
		return TCL_ERROR;
	    }
	} else {
	    /*
	     * Search through all of our traces on this command to see if
	     * there's one with the given command. If so, then delete the
	     * first one that matches.
	     */

	    ClientData clientData;

	    /*
	     * First ensure the name given is valid.
	     */

	    name = TclGetString(objv[3]);
	    if (Tcl_FindCommand(interp,name,NULL,TCL_LEAVE_ERR_MSG) == NULL) {
		return TCL_ERROR;
	    }

	    FOREACH_COMMAND_TRACE(interp, name, clientData) {
		TraceCommandInfo *tcmdPtr = clientData;

561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
	Tcl_Obj *resultListPtr;

	if (objc != 4) {
	    Tcl_WrongNumArgs(interp, 3, objv, "name");
	    return TCL_ERROR;
	}

	name = Tcl_GetString(objv[3]);

	/*
	 * First ensure the name given is valid.
	 */

	if (Tcl_FindCommand(interp, name, NULL, TCL_LEAVE_ERR_MSG) == NULL) {
	    return TCL_ERROR;







|







561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
	Tcl_Obj *resultListPtr;

	if (objc != 4) {
	    Tcl_WrongNumArgs(interp, 3, objv, "name");
	    return TCL_ERROR;
	}

	name = TclGetString(objv[3]);

	/*
	 * First ensure the name given is valid.
	 */

	if (Tcl_FindCommand(interp, name, NULL, TCL_LEAVE_ERR_MSG) == NULL) {
	    return TCL_ERROR;
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
	    tcmdPtr->stepTrace = NULL;
	    tcmdPtr->startLevel = 0;
	    tcmdPtr->startCmd = NULL;
	    tcmdPtr->length = length;
	    tcmdPtr->refCount = 1;
	    flags |= TCL_TRACE_DELETE;
	    memcpy(tcmdPtr->command, command, length+1);
	    name = Tcl_GetString(objv[3]);
	    if (Tcl_TraceCommand(interp, name, flags, TraceCommandProc,
		    tcmdPtr) != TCL_OK) {
		Tcl_Free(tcmdPtr);
		return TCL_ERROR;
	    }
	} else {
	    /*
	     * Search through all of our traces on this command to see if
	     * there's one with the given command. If so, then delete the
	     * first one that matches.
	     */

	    ClientData clientData;

	    /*
	     * First ensure the name given is valid.
	     */

	    name = Tcl_GetString(objv[3]);
	    if (Tcl_FindCommand(interp,name,NULL,TCL_LEAVE_ERR_MSG) == NULL) {
		return TCL_ERROR;
	    }

	    FOREACH_COMMAND_TRACE(interp, name, clientData) {
		TraceCommandInfo *tcmdPtr = clientData;








|


















|







714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
	    tcmdPtr->stepTrace = NULL;
	    tcmdPtr->startLevel = 0;
	    tcmdPtr->startCmd = NULL;
	    tcmdPtr->length = length;
	    tcmdPtr->refCount = 1;
	    flags |= TCL_TRACE_DELETE;
	    memcpy(tcmdPtr->command, command, length+1);
	    name = TclGetString(objv[3]);
	    if (Tcl_TraceCommand(interp, name, flags, TraceCommandProc,
		    tcmdPtr) != TCL_OK) {
		Tcl_Free(tcmdPtr);
		return TCL_ERROR;
	    }
	} else {
	    /*
	     * Search through all of our traces on this command to see if
	     * there's one with the given command. If so, then delete the
	     * first one that matches.
	     */

	    ClientData clientData;

	    /*
	     * First ensure the name given is valid.
	     */

	    name = TclGetString(objv[3]);
	    if (Tcl_FindCommand(interp,name,NULL,TCL_LEAVE_ERR_MSG) == NULL) {
		return TCL_ERROR;
	    }

	    FOREACH_COMMAND_TRACE(interp, name, clientData) {
		TraceCommandInfo *tcmdPtr = clientData;

769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
	    return TCL_ERROR;
	}

	/*
	 * First ensure the name given is valid.
	 */

	name = Tcl_GetString(objv[3]);
	if (Tcl_FindCommand(interp, name, NULL, TCL_LEAVE_ERR_MSG) == NULL) {
	    return TCL_ERROR;
	}

	resultListPtr = Tcl_NewListObj(0, NULL);
	FOREACH_COMMAND_TRACE(interp, name, clientData) {
	    int numOps = 0;







|







769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
	    return TCL_ERROR;
	}

	/*
	 * First ensure the name given is valid.
	 */

	name = TclGetString(objv[3]);
	if (Tcl_FindCommand(interp, name, NULL, TCL_LEAVE_ERR_MSG) == NULL) {
	    return TCL_ERROR;
	}

	resultListPtr = Tcl_NewListObj(0, NULL);
	FOREACH_COMMAND_TRACE(interp, name, clientData) {
	    int numOps = 0;
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
#endif
	    ctvarPtr->traceCmdInfo.length = length;
	    flags |= TCL_TRACE_UNSETS | TCL_TRACE_RESULT_OBJECT;
	    memcpy(ctvarPtr->traceCmdInfo.command, command, length+1);
	    ctvarPtr->traceInfo.traceProc = TraceVarProc;
	    ctvarPtr->traceInfo.clientData = &ctvarPtr->traceCmdInfo;
	    ctvarPtr->traceInfo.flags = flags;
	    name = Tcl_GetString(objv[3]);
	    if (TraceVarEx(interp, name, NULL, (VarTrace *) ctvarPtr)
		    != TCL_OK) {
		Tcl_Free(ctvarPtr);
		return TCL_ERROR;
	    }
	} else {
	    /*
	     * Search through all of our traces on this variable to see if
	     * there's one with the given command. If so, then delete the
	     * first one that matches.
	     */

	    name = Tcl_GetString(objv[3]);
	    FOREACH_VAR_TRACE(interp, name, clientData) {
		TraceVarInfo *tvarPtr = clientData;

		if ((tvarPtr->length == length)
			&& ((tvarPtr->flags
#ifndef TCL_REMOVE_OBSOLETE_TRACES
& ~TCL_TRACE_OLD_STYLE







|












|







922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
#endif
	    ctvarPtr->traceCmdInfo.length = length;
	    flags |= TCL_TRACE_UNSETS | TCL_TRACE_RESULT_OBJECT;
	    memcpy(ctvarPtr->traceCmdInfo.command, command, length+1);
	    ctvarPtr->traceInfo.traceProc = TraceVarProc;
	    ctvarPtr->traceInfo.clientData = &ctvarPtr->traceCmdInfo;
	    ctvarPtr->traceInfo.flags = flags;
	    name = TclGetString(objv[3]);
	    if (TraceVarEx(interp, name, NULL, (VarTrace *) ctvarPtr)
		    != TCL_OK) {
		Tcl_Free(ctvarPtr);
		return TCL_ERROR;
	    }
	} else {
	    /*
	     * Search through all of our traces on this variable to see if
	     * there's one with the given command. If so, then delete the
	     * first one that matches.
	     */

	    name = TclGetString(objv[3]);
	    FOREACH_VAR_TRACE(interp, name, clientData) {
		TraceVarInfo *tvarPtr = clientData;

		if ((tvarPtr->length == length)
			&& ((tvarPtr->flags
#ifndef TCL_REMOVE_OBSOLETE_TRACES
& ~TCL_TRACE_OLD_STYLE
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979

	if (objc != 4) {
	    Tcl_WrongNumArgs(interp, 3, objv, "name");
	    return TCL_ERROR;
	}

	resultListPtr = Tcl_NewObj();
	name = Tcl_GetString(objv[3]);
	FOREACH_VAR_TRACE(interp, name, clientData) {
	    Tcl_Obj *opObjPtr, *eachTraceObjPtr, *elemObjPtr;
	    TraceVarInfo *tvarPtr = clientData;

	    /*
	     * Build a list with the ops list as the first obj element and the
	     * tcmdPtr->command string as the second obj element. Append this







|







965
966
967
968
969
970
971
972
973
974
975
976
977
978
979

	if (objc != 4) {
	    Tcl_WrongNumArgs(interp, 3, objv, "name");
	    return TCL_ERROR;
	}

	resultListPtr = Tcl_NewObj();
	name = TclGetString(objv[3]);
	FOREACH_VAR_TRACE(interp, name, clientData) {
	    Tcl_Obj *opObjPtr, *eachTraceObjPtr, *elemObjPtr;
	    TraceVarInfo *tvarPtr = clientData;

	    /*
	     * Build a list with the ops list as the first obj element and the
	     * tcmdPtr->command string as the second obj element. Append this
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841

	    /*
	     * Append command with arguments.
	     */

	    Tcl_DStringInit(&sub);
	    for (i = 0; i < objc; i++) {
		Tcl_DStringAppendElement(&sub, Tcl_GetString(objv[i]));
	    }
	    Tcl_DStringAppendElement(&cmd, Tcl_DStringValue(&sub));
	    Tcl_DStringFree(&sub);

	    if (flags & TCL_TRACE_ENTER_EXEC) {
		/*
		 * Append trace operation.







|







1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841

	    /*
	     * Append command with arguments.
	     */

	    Tcl_DStringInit(&sub);
	    for (i = 0; i < objc; i++) {
		Tcl_DStringAppendElement(&sub, TclGetString(objv[i]));
	    }
	    Tcl_DStringAppendElement(&cmd, Tcl_DStringValue(&sub));
	    Tcl_DStringFree(&sub);

	    if (flags & TCL_TRACE_ENTER_EXEC) {
		/*
		 * Append trace operation.
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
		const char *resultCodeStr;

		/*
		 * Append result code.
		 */

		resultCode = Tcl_NewIntObj(code);
		resultCodeStr = Tcl_GetString(resultCode);
		Tcl_DStringAppendElement(&cmd, resultCodeStr);
		Tcl_DecrRefCount(resultCode);

		/*
		 * Append result string.
		 */








|







1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
		const char *resultCodeStr;

		/*
		 * Append result code.
		 */

		resultCode = Tcl_NewIntObj(code);
		resultCodeStr = TclGetString(resultCode);
		Tcl_DStringAppendElement(&cmd, resultCodeStr);
		Tcl_DecrRefCount(resultCode);

		/*
		 * Append result string.
		 */

2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
     * This is a bit messy because we have to emulate the old trace interface,
     * which uses strings for everything.
     */

    argv = (const char **) TclStackAlloc(interp,
	    (objc + 1) * sizeof(const char *));
    for (i = 0; i < objc; i++) {
	argv[i] = Tcl_GetString(objv[i]);
    }
    argv[objc] = 0;

    /*
     * Invoke the command function. Note that we cast away const-ness on two
     * parameters for compatibility with legacy code; the code MUST NOT modify
     * either command or argv.







|







2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
     * This is a bit messy because we have to emulate the old trace interface,
     * which uses strings for everything.
     */

    argv = (const char **) TclStackAlloc(interp,
	    (objc + 1) * sizeof(const char *));
    for (i = 0; i < objc; i++) {
	argv[i] = TclGetString(objv[i]);
    }
    argv[objc] = 0;

    /*
     * Invoke the command function. Note that we cast away const-ness on two
     * parameters for compatibility with legacy code; the code MUST NOT modify
     * either command or argv.
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791

	    Tcl_AppendObjToErrorInfo((Tcl_Interp *)iPtr, Tcl_ObjPrintf(
		    "\n    (%s trace on \"%s%s%s%s\")", type, part1,
		    (part2 ? "(" : ""), (part2 ? part2 : ""),
		    (part2 ? ")" : "") ));
	    if (disposeFlags & TCL_TRACE_RESULT_OBJECT) {
		TclVarErrMsg((Tcl_Interp *) iPtr, part1, part2, verb,
			Tcl_GetString((Tcl_Obj *) result));
	    } else {
		TclVarErrMsg((Tcl_Interp *) iPtr, part1, part2, verb, result);
	    }
	    iPtr->flags &= ~(ERR_ALREADY_LOGGED);
	    Tcl_DiscardInterpState(state);
	} else {
	    Tcl_RestoreInterpState((Tcl_Interp *) iPtr, state);







|







2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791

	    Tcl_AppendObjToErrorInfo((Tcl_Interp *)iPtr, Tcl_ObjPrintf(
		    "\n    (%s trace on \"%s%s%s%s\")", type, part1,
		    (part2 ? "(" : ""), (part2 ? part2 : ""),
		    (part2 ? ")" : "") ));
	    if (disposeFlags & TCL_TRACE_RESULT_OBJECT) {
		TclVarErrMsg((Tcl_Interp *) iPtr, part1, part2, verb,
			TclGetString((Tcl_Obj *) result));
	    } else {
		TclVarErrMsg((Tcl_Interp *) iPtr, part1, part2, verb, result);
	    }
	    iPtr->flags &= ~(ERR_ALREADY_LOGGED);
	    Tcl_DiscardInterpState(state);
	} else {
	    Tcl_RestoreInterpState((Tcl_Interp *) iPtr, state);
Changes to generic/tclUtf.c.
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
 *
 * Side effects:
 *	None.
 *
 *---------------------------------------------------------------------------
 */

int
TclUtfCount(
    int ch)			/* The Unicode character whose size is returned. */
{
    if ((unsigned)(ch - 1) < (UNICODE_SELF - 1)) {
	return 1;
    }
    if (ch <= 0x7FF) {







|







84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
 *
 * Side effects:
 *	None.
 *
 *---------------------------------------------------------------------------
 */

size_t
TclUtfCount(
    int ch)			/* The Unicode character whose size is returned. */
{
    if ((unsigned)(ch - 1) < (UNICODE_SELF - 1)) {
	return 1;
    }
    if (ch <= 0x7FF) {
571
572
573
574
575
576
577

578
579
580
581
582
583
584
585
 */

const char *
Tcl_UtfFindFirst(
    const char *src,		/* The UTF-8 string to be searched. */
    int ch)			/* The Unicode character to search for. */
{

    int len, fullchar;
    Tcl_UniChar find = 0;

    while (1) {
	len = TclUtfToUniChar(src, &find);
	fullchar = find;
#if TCL_UTF_MAX <= 4
	if (!len) {







>
|







571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
 */

const char *
Tcl_UtfFindFirst(
    const char *src,		/* The UTF-8 string to be searched. */
    int ch)			/* The Unicode character to search for. */
{
    size_t len;
    int fullchar;
    Tcl_UniChar find = 0;

    while (1) {
	len = TclUtfToUniChar(src, &find);
	fullchar = find;
#if TCL_UTF_MAX <= 4
	if (!len) {
617
618
619
620
621
622
623

624
625
626
627
628
629
630
631
 */

const char *
Tcl_UtfFindLast(
    const char *src,		/* The UTF-8 string to be searched. */
    int ch)			/* The Unicode character to search for. */
{

    int len, fullchar;
    Tcl_UniChar find = 0;
    const char *last;

    last = NULL;
    while (1) {
	len = TclUtfToUniChar(src, &find);
	fullchar = find;







>
|







618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
 */

const char *
Tcl_UtfFindLast(
    const char *src,		/* The UTF-8 string to be searched. */
    int ch)			/* The Unicode character to search for. */
{
    size_t len;
    int fullchar;
    Tcl_UniChar find = 0;
    const char *last;

    last = NULL;
    while (1) {
	len = TclUtfToUniChar(src, &find);
	fullchar = find;
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
 */

const char *
Tcl_UtfNext(
    const char *src)		/* The current location in the string. */
{
    Tcl_UniChar ch = 0;
    int len = TclUtfToUniChar(src, &ch);

#if TCL_UTF_MAX <= 4
    if (len == 0) {
      len = TclUtfToUniChar(src, &ch);
    }
#endif
    return src + len;







|







668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
 */

const char *
Tcl_UtfNext(
    const char *src)		/* The current location in the string. */
{
    Tcl_UniChar ch = 0;
    size_t len = TclUtfToUniChar(src, &ch);

#if TCL_UTF_MAX <= 4
    if (len == 0) {
      len = TclUtfToUniChar(src, &ch);
    }
#endif
    return src + len;
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
Tcl_UniCharAtIndex(
    register const char *src,	/* The UTF-8 string to dereference. */
    register size_t index)		/* The position of the desired character. */
{
    Tcl_UniChar ch = 0;
    int fullchar = 0;
#if TCL_UTF_MAX <= 4
	int len = 1;
#endif

    src += TclUtfToUniChar(src, &ch);
    while (index--) {
#if TCL_UTF_MAX <= 4
	src += (len = TclUtfToUniChar(src, &ch));
#else







|







753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
Tcl_UniCharAtIndex(
    register const char *src,	/* The UTF-8 string to dereference. */
    register size_t index)		/* The position of the desired character. */
{
    Tcl_UniChar ch = 0;
    int fullchar = 0;
#if TCL_UTF_MAX <= 4
	size_t len = 1;
#endif

    src += TclUtfToUniChar(src, &ch);
    while (index--) {
#if TCL_UTF_MAX <= 4
	src += (len = TclUtfToUniChar(src, &ch));
#else
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
const char *
Tcl_UtfAtIndex(
    register const char *src,	/* The UTF-8 string. */
    register size_t index)		/* The position of the desired character. */
{
    Tcl_UniChar ch = 0;
#if TCL_UTF_MAX <= 4
    int len = 1;
#endif

    if (index != TCL_AUTO_LENGTH) {
	while (index--) {
#if TCL_UTF_MAX <= 4
	    src += (len = TclUtfToUniChar(src, &ch));
#else







|







801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
const char *
Tcl_UtfAtIndex(
    register const char *src,	/* The UTF-8 string. */
    register size_t index)		/* The position of the desired character. */
{
    Tcl_UniChar ch = 0;
#if TCL_UTF_MAX <= 4
    size_t len = 1;
#endif

    if (index != TCL_AUTO_LENGTH) {
	while (index--) {
#if TCL_UTF_MAX <= 4
	    src += (len = TclUtfToUniChar(src, &ch));
#else
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
int
Tcl_UtfToUpper(
    char *str)			/* String to convert in place. */
{
    Tcl_UniChar ch = 0;
    int upChar;
    char *src, *dst;
    int bytes;

    /*
     * Iterate over the string until we hit the terminating null.
     */

    src = dst = str;
    while (*src) {







|







899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
int
Tcl_UtfToUpper(
    char *str)			/* String to convert in place. */
{
    Tcl_UniChar ch = 0;
    int upChar;
    char *src, *dst;
    size_t bytes;

    /*
     * Iterate over the string until we hit the terminating null.
     */

    src = dst = str;
    while (*src) {
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
	/*
	 * To keep badly formed Utf strings from getting inflated by the
	 * conversion (thereby causing a segfault), only copy the upper case
	 * char to dst if its size is <= the original char.
	 */

	if ((bytes < TclUtfCount(upChar)) || ((upChar & 0xF800) == 0xD800)) {
	    memcpy(dst, src, (size_t) bytes);
	    dst += bytes;
	} else {
	    dst += Tcl_UniCharToUtf(upChar, dst);
	}
	src += bytes;
    }
    *dst = '\0';







|







926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
	/*
	 * To keep badly formed Utf strings from getting inflated by the
	 * conversion (thereby causing a segfault), only copy the upper case
	 * char to dst if its size is <= the original char.
	 */

	if ((bytes < TclUtfCount(upChar)) || ((upChar & 0xF800) == 0xD800)) {
	    memcpy(dst, src, bytes);
	    dst += bytes;
	} else {
	    dst += Tcl_UniCharToUtf(upChar, dst);
	}
	src += bytes;
    }
    *dst = '\0';
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
int
Tcl_UtfToLower(
    char *str)			/* String to convert in place. */
{
    Tcl_UniChar ch = 0;
    int lowChar;
    char *src, *dst;
    int bytes;

    /*
     * Iterate over the string until we hit the terminating null.
     */

    src = dst = str;
    while (*src) {







|







962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
int
Tcl_UtfToLower(
    char *str)			/* String to convert in place. */
{
    Tcl_UniChar ch = 0;
    int lowChar;
    char *src, *dst;
    size_t bytes;

    /*
     * Iterate over the string until we hit the terminating null.
     */

    src = dst = str;
    while (*src) {
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
	/*
	 * To keep badly formed Utf strings from getting inflated by the
	 * conversion (thereby causing a segfault), only copy the lower case
	 * char to dst if its size is <= the original char.
	 */

	if ((bytes < TclUtfCount(lowChar)) || ((lowChar & 0xF800) == 0xD800)) {
	    memcpy(dst, src, (size_t) bytes);
	    dst += bytes;
	} else {
	    dst += Tcl_UniCharToUtf(lowChar, dst);
	}
	src += bytes;
    }
    *dst = '\0';







|







989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
	/*
	 * To keep badly formed Utf strings from getting inflated by the
	 * conversion (thereby causing a segfault), only copy the lower case
	 * char to dst if its size is <= the original char.
	 */

	if ((bytes < TclUtfCount(lowChar)) || ((lowChar & 0xF800) == 0xD800)) {
	    memcpy(dst, src, bytes);
	    dst += bytes;
	} else {
	    dst += Tcl_UniCharToUtf(lowChar, dst);
	}
	src += bytes;
    }
    *dst = '\0';
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
int
Tcl_UtfToTitle(
    char *str)			/* String to convert in place. */
{
    Tcl_UniChar ch = 0;
    int titleChar, lowChar;
    char *src, *dst;
    int bytes;

    /*
     * Capitalize the first character and then lowercase the rest of the
     * characters until we get to a null.
     */

    src = dst = str;







|







1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
int
Tcl_UtfToTitle(
    char *str)			/* String to convert in place. */
{
    Tcl_UniChar ch = 0;
    int titleChar, lowChar;
    char *src, *dst;
    size_t bytes;

    /*
     * Capitalize the first character and then lowercase the rest of the
     * characters until we get to a null.
     */

    src = dst = str;
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
	    /* Combine surrogates */
	    titleChar = (((titleChar & 0x3ff) << 10) | (ch & 0x3ff)) + 0x10000;
	}
#endif
	titleChar = Tcl_UniCharToTitle(titleChar);

	if ((bytes < TclUtfCount(titleChar)) || ((titleChar & 0xF800) == 0xD800)) {
	    memcpy(dst, src, (size_t) bytes);
	    dst += bytes;
	} else {
	    dst += Tcl_UniCharToUtf(titleChar, dst);
	}
	src += bytes;
    }
    while (*src) {







|







1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
	    /* Combine surrogates */
	    titleChar = (((titleChar & 0x3ff) << 10) | (ch & 0x3ff)) + 0x10000;
	}
#endif
	titleChar = Tcl_UniCharToTitle(titleChar);

	if ((bytes < TclUtfCount(titleChar)) || ((titleChar & 0xF800) == 0xD800)) {
	    memcpy(dst, src, bytes);
	    dst += bytes;
	} else {
	    dst += Tcl_UniCharToUtf(titleChar, dst);
	}
	src += bytes;
    }
    while (*src) {
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
#endif
	/* Special exception for Georgian Asomtavruli chars, no titlecase. */
	if ((unsigned)(lowChar - 0x1C90) >= 0x30) {
	    lowChar = Tcl_UniCharToLower(lowChar);
	}

	if ((bytes < TclUtfCount(lowChar)) || ((lowChar & 0xF800) == 0xD800)) {
	    memcpy(dst, src, (size_t) bytes);
	    dst += bytes;
	} else {
	    dst += Tcl_UniCharToUtf(lowChar, dst);
	}
	src += bytes;
    }
    *dst = '\0';







|







1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
#endif
	/* Special exception for Georgian Asomtavruli chars, no titlecase. */
	if ((unsigned)(lowChar - 0x1C90) >= 0x30) {
	    lowChar = Tcl_UniCharToLower(lowChar);
	}

	if ((bytes < TclUtfCount(lowChar)) || ((lowChar & 0xF800) == 0xD800)) {
	    memcpy(dst, src, bytes);
	    dst += bytes;
	} else {
	    dst += Tcl_UniCharToUtf(lowChar, dst);
	}
	src += bytes;
    }
    *dst = '\0';
Changes to generic/tclUtil.c.
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
    int forbidNone = 0;		/* Do not permit CONVERT_NONE mode. Something
				 * needs protection or escape. */
    int requireEscape = 0;	/* Force use of CONVERT_ESCAPE mode.  For some
				 * reason bare or brace-quoted form fails. */
    int extra = 0;		/* Count of number of extra bytes needed for
				 * formatted element, assuming we use escape
				 * sequences in formatting. */
    int bytesNeeded;		/* Buffer length computed to complete the
				 * element formatting in the selected mode. */
#if COMPAT
    int preferEscape = 0;	/* Use preferences to track whether to use */
    int preferBrace = 0;	/* CONVERT_MASK mode. */
    int braceCount = 0;		/* Count of all braces '{' '}' seen. */
#endif /* COMPAT */








|







1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
    int forbidNone = 0;		/* Do not permit CONVERT_NONE mode. Something
				 * needs protection or escape. */
    int requireEscape = 0;	/* Force use of CONVERT_ESCAPE mode.  For some
				 * reason bare or brace-quoted form fails. */
    int extra = 0;		/* Count of number of extra bytes needed for
				 * formatted element, assuming we use escape
				 * sequences in formatting. */
    size_t bytesNeeded;		/* Buffer length computed to complete the
				 * element formatting in the selected mode. */
#if COMPAT
    int preferEscape = 0;	/* Use preferences to track whether to use */
    int preferBrace = 0;	/* CONVERT_MASK mode. */
    int braceCount = 0;		/* Count of all braces '{' '}' seen. */
#endif /* COMPAT */

1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
	 * Make room to escape leading #, if needed.
	 */

	if ((*src == '#') && !(*flagPtr & TCL_DONT_QUOTE_HASH)) {
	    bytesNeeded++;
	}
	*flagPtr = CONVERT_ESCAPE;
	goto overflowCheck;
    }
    if (*flagPtr & CONVERT_ANY) {
	/*
	 * The caller has not let us know what flags it will pass to
	 * TclConvertElement() so compute the max size we might need for any
	 * possible choice.  Normally the formatting using escape sequences is
	 * the longer one, and a minimum "extra" value of 2 makes sure we







|







1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
	 * Make room to escape leading #, if needed.
	 */

	if ((*src == '#') && !(*flagPtr & TCL_DONT_QUOTE_HASH)) {
	    bytesNeeded++;
	}
	*flagPtr = CONVERT_ESCAPE;
	return bytesNeeded;
    }
    if (*flagPtr & CONVERT_ANY) {
	/*
	 * The caller has not let us know what flags it will pass to
	 * TclConvertElement() so compute the max size we might need for any
	 * possible choice.  Normally the formatting using escape sequences is
	 * the longer one, and a minimum "extra" value of 2 makes sure we
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
	     * escape the braces.
	     */

	    if (*flagPtr & TCL_DONT_USE_BRACES) {
		bytesNeeded += braceCount;
	    }
	    *flagPtr = CONVERT_MASK;
	    goto overflowCheck;
	}
#endif /* COMPAT */
	if (*flagPtr & TCL_DONT_USE_BRACES) {
	    /*
	     * If the caller reports it will direct TclConvertElement() to
	     * use escapes, add the extra bytes needed to have room for them.
	     */







|







1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
	     * escape the braces.
	     */

	    if (*flagPtr & TCL_DONT_USE_BRACES) {
		bytesNeeded += braceCount;
	    }
	    *flagPtr = CONVERT_MASK;
	    return bytesNeeded;
	}
#endif /* COMPAT */
	if (*flagPtr & TCL_DONT_USE_BRACES) {
	    /*
	     * If the caller reports it will direct TclConvertElement() to
	     * use escapes, add the extra bytes needed to have room for them.
	     */
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
	    /*
	     * Add 2 bytes for room for the enclosing braces.
	     */

	    bytesNeeded += 2;
	}
	*flagPtr = CONVERT_BRACE;
	goto overflowCheck;
    }

    /*
     * So far, no need to quote or escape anything.
     */

    if ((*src == '#') && !(*flagPtr & TCL_DONT_QUOTE_HASH)) {
	/*
	 * If we need to quote a leading #, make room to enclose in braces.
	 */

	bytesNeeded += 2;
    }
    *flagPtr = CONVERT_NONE;

  overflowCheck:
    if (bytesNeeded < 0) {
	Tcl_Panic("TclScanElement: string length overflow");
    }
    return bytesNeeded;
}

/*
 *----------------------------------------------------------------------
 *
 * Tcl_ConvertElement --







|














<
<
<
<
<







1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288





1289
1290
1291
1292
1293
1294
1295
	    /*
	     * Add 2 bytes for room for the enclosing braces.
	     */

	    bytesNeeded += 2;
	}
	*flagPtr = CONVERT_BRACE;
	return bytesNeeded;
    }

    /*
     * So far, no need to quote or escape anything.
     */

    if ((*src == '#') && !(*flagPtr & TCL_DONT_QUOTE_HASH)) {
	/*
	 * If we need to quote a leading #, make room to enclose in braces.
	 */

	bytesNeeded += 2;
    }
    *flagPtr = CONVERT_NONE;





    return bytesNeeded;
}

/*
 *----------------------------------------------------------------------
 *
 * Tcl_ConvertElement --
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
 *
 * Side effects:
 *	None.
 *
 *----------------------------------------------------------------------
 */

static inline int
TrimRight(
    const char *bytes,		/* String to be trimmed... */
    int numBytes,		/* ...and its length in bytes */
    const char *trim,		/* String of trim characters... */
    int numTrim)		/* ...and its length in bytes */
{
    const char *p = bytes + numBytes;
    int pInc;
    Tcl_UniChar ch1 = 0, ch2 = 0;

    /*
     * Outer loop: iterate over string to be trimmed.
     */

    do {
	const char *q = trim;
	int bytesLeft = numTrim;

	p = Tcl_UtfPrev(p, bytes);
 	pInc = TclUtfToUniChar(p, &ch1);

	/*
	 * Inner loop: scan trim string for match to current character.
	 */

	do {
	    int qInc = TclUtfToUniChar(q, &ch2);

	    if (ch1 == ch2) {
		break;
	    }

	    q += qInc;
	    bytesLeft -= qInc;







|


|

|


|








|









|







1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
 *
 * Side effects:
 *	None.
 *
 *----------------------------------------------------------------------
 */

static inline size_t
TrimRight(
    const char *bytes,		/* String to be trimmed... */
	size_t numBytes,		/* ...and its length in bytes */
    const char *trim,		/* String of trim characters... */
	size_t numTrim)		/* ...and its length in bytes */
{
    const char *p = bytes + numBytes;
    size_t pInc;
    Tcl_UniChar ch1 = 0, ch2 = 0;

    /*
     * Outer loop: iterate over string to be trimmed.
     */

    do {
	const char *q = trim;
	size_t bytesLeft = numTrim;

	p = Tcl_UtfPrev(p, bytes);
 	pInc = TclUtfToUniChar(p, &ch1);

	/*
	 * Inner loop: scan trim string for match to current character.
	 */

	do {
	    size_t qInc = TclUtfToUniChar(q, &ch2);

	    if (ch1 == ch2) {
		break;
	    }

	    q += qInc;
	    bytesLeft -= qInc;
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
	Tcl_UniChar ch1 = 0, ch2 = 0;

    /*
     * Outer loop: iterate over string to be trimmed.
     */

    do {
	int pInc = TclUtfToUniChar(p, &ch1);
	const char *q = trim;
	int bytesLeft = numTrim;

	/*
	 * Inner loop: scan trim string for match to current character.
	 */

	do {
	    int qInc = TclUtfToUniChar(q, &ch2);

	    if (ch1 == ch2) {
		break;
	    }

	    q += qInc;
	    bytesLeft -= qInc;







|

|






|







1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
	Tcl_UniChar ch1 = 0, ch2 = 0;

    /*
     * Outer loop: iterate over string to be trimmed.
     */

    do {
	size_t pInc = TclUtfToUniChar(p, &ch1);
	const char *q = trim;
	size_t bytesLeft = numTrim;

	/*
	 * Inner loop: scan trim string for match to current character.
	 */

	do {
	    size_t qInc = TclUtfToUniChar(q, &ch2);

	    if (ch1 == ch2) {
		break;
	    }

	    q += qInc;
	    bytesLeft -= qInc;
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
	/*
	 * Append to the result with space if needed.
	 */

	if (needSpace) {
	    *p++ = ' ';
	}
	memcpy(p, element, (size_t) elemLength);
	p += elemLength;
	needSpace = 1;
    }
    *p = '\0';
    return result;
}








|







1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
	/*
	 * Append to the result with space if needed.
	 */

	if (needSpace) {
	    *p++ = ' ';
	}
	memcpy(p, element, elemLength);
	p += elemLength;
	needSpace = 1;
    }
    *p = '\0';
    return result;
}

2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
    for (i = 0;  i < objc;  i++) {
	size_t length;

	objPtr = objv[i];
	if (TclListObjIsCanonical(objPtr)) {
	    continue;
	}
	TclGetString(objPtr);
	length = objPtr->length;
	if (length > 0) {
	    break;
	}
    }
    if (i == objc) {
	resPtr = NULL;
	for (i = 0;  i < objc;  i++) {







|
<







2032
2033
2034
2035
2036
2037
2038
2039

2040
2041
2042
2043
2044
2045
2046
    for (i = 0;  i < objc;  i++) {
	size_t length;

	objPtr = objv[i];
	if (TclListObjIsCanonical(objPtr)) {
	    continue;
	}
	(void)TclGetStringFromObj(objPtr, &length);

	if (length > 0) {
	    break;
	}
    }
    if (i == objc) {
	resPtr = NULL;
	for (i = 0;  i < objc;  i++) {
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
     * Something cannot be determined to be safe, so build the concatenation
     * the slow way, using the string representations.
     *
     * First try to pre-allocate the size required.
     */

    for (i = 0;  i < objc;  i++) {
	element = TclGetString(objv[i]);
	elemLength = objv[i]->length;
	bytesNeeded += elemLength;
    }

    /*
     * Does not matter if this fails, will simply try later to build up the
     * string with each Append reallocating as needed with the usual string
     * append algorithm.  When that fails it will report the error.
     */

    TclNewObj(resPtr);
    (void) Tcl_AttemptSetObjLength(resPtr, bytesNeeded + objc - 1);
    Tcl_SetObjLength(resPtr, 0);

    for (i = 0;  i < objc;  i++) {
	size_t triml, trimr;

	element = TclGetString(objv[i]);
	elemLength = objv[i]->length;

	/* Trim away the leading/trailing whitespace. */
	triml = TclTrim(element, elemLength, CONCAT_TRIM_SET,
		CONCAT_WS_SIZE, &trimr);
	element += triml;
	elemLength -= triml + trimr;








|
<
















|
<







2069
2070
2071
2072
2073
2074
2075
2076

2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093

2094
2095
2096
2097
2098
2099
2100
     * Something cannot be determined to be safe, so build the concatenation
     * the slow way, using the string representations.
     *
     * First try to pre-allocate the size required.
     */

    for (i = 0;  i < objc;  i++) {
	element = TclGetStringFromObj(objv[i], &elemLength);

	bytesNeeded += elemLength;
    }

    /*
     * Does not matter if this fails, will simply try later to build up the
     * string with each Append reallocating as needed with the usual string
     * append algorithm.  When that fails it will report the error.
     */

    TclNewObj(resPtr);
    (void) Tcl_AttemptSetObjLength(resPtr, bytesNeeded + objc - 1);
    Tcl_SetObjLength(resPtr, 0);

    for (i = 0;  i < objc;  i++) {
	size_t triml, trimr;

	element = TclGetStringFromObj(objv[i], &elemLength);


	/* Trim away the leading/trailing whitespace. */
	triml = TclTrim(element, elemLength, CONCAT_TRIM_SET,
		CONCAT_WS_SIZE, &trimr);
	element += triml;
	elemLength -= triml + trimr;

3442
3443
3444
3445
3446
3447
3448
3449




3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467

    if (code == TCL_OK) {
	if (numType == TCL_NUMBER_INT) {
	    /* objPtr holds an integer in the signed wide range */
	    *widePtr = *(Tcl_WideInt *)cd;
	    return TCL_OK;
	}
	if (numType == TCL_NUMBER_BIG) {




	    /* objPtr holds an integer outside the signed wide range */
	    /* Truncate to the signed wide range. */
	    if (mp_isneg((mp_int *)cd)) {
		*widePtr = WIDE_MIN;
	    } else {
		*widePtr = WIDE_MAX;
	    }
	    return TCL_OK;
	}
	/* Must be a double -> not a valid index */
	goto parseError;
    }

    /* objPtr does not hold a number, check the end+/- format... */
    if (GetEndOffsetFromObj(objPtr, endValue, widePtr) == TCL_OK) {
	return TCL_OK;
    }








|
>
>
>
>
|
|
|
<
<
<
<
|
<
<
<







3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448




3449



3450
3451
3452
3453
3454
3455
3456

    if (code == TCL_OK) {
	if (numType == TCL_NUMBER_INT) {
	    /* objPtr holds an integer in the signed wide range */
	    *widePtr = *(Tcl_WideInt *)cd;
	    return TCL_OK;
	}
	if (numType != TCL_NUMBER_BIG) {
	    /* Must be a double -> not a valid index */
	    goto parseError;
	}

	/* objPtr holds an integer outside the signed wide range */
	/* Truncate to the signed wide range. */
	*widePtr = mp_isneg((mp_int *)cd) ? WIDE_MIN : WIDE_MAX;




    return TCL_OK;



    }

    /* objPtr does not hold a number, check the end+/- format... */
    if (GetEndOffsetFromObj(objPtr, endValue, widePtr) == TCL_OK) {
	return TCL_OK;
    }

3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
                                 * "objPtr" holds "end". */
    Tcl_WideInt *widePtr)       /* Location filled in with an integer
                                 * representing an index. */
{
    Tcl_ObjIntRep *irPtr;
    Tcl_WideInt offset = 0;	/* Offset in the "end-offset" expression */

    while ((irPtr = Tcl_FetchIntRep(objPtr, &endOffsetType)) == NULL) {
	Tcl_ObjIntRep ir;
	size_t length;
	const char *bytes = TclGetStringFromObj(objPtr, &length);

	if ((length < 3) || (length == 4)) {
	    /* Too short to be "end" or to be "end-$integer" */
	    return TCL_ERROR;







|







3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
                                 * "objPtr" holds "end". */
    Tcl_WideInt *widePtr)       /* Location filled in with an integer
                                 * representing an index. */
{
    Tcl_ObjIntRep *irPtr;
    Tcl_WideInt offset = 0;	/* Offset in the "end-offset" expression */

    while ((irPtr = TclFetchIntRep(objPtr, &endOffsetType)) == NULL) {
	Tcl_ObjIntRep ir;
	size_t length;
	const char *bytes = TclGetStringFromObj(objPtr, &length);

	if ((length < 3) || (length == 4)) {
	    /* Too short to be "end" or to be "end-$integer" */
	    return TCL_ERROR;
Changes to generic/tclVar.c.
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
	ir.twoPtrValue.ptr2 = INT2PTR(index);				\
	Tcl_StoreIntRep((objPtr), &localVarNameType, &ir);		\
    } while (0)

#define LocalGetIntRep(objPtr, index, name)				\
    do {								\
	const Tcl_ObjIntRep *irPtr;					\
	irPtr = Tcl_FetchIntRep((objPtr), &localVarNameType);		\
	(name) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL;		\
	(index) = irPtr ? PTR2INT(irPtr->twoPtrValue.ptr2) : -1;	\
    } while (0)

static const Tcl_ObjType parsedVarNameType = {
    "parsedVarName",
    FreeParsedVarName, DupParsedVarName, NULL, NULL







|







263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
	ir.twoPtrValue.ptr2 = INT2PTR(index);				\
	Tcl_StoreIntRep((objPtr), &localVarNameType, &ir);		\
    } while (0)

#define LocalGetIntRep(objPtr, index, name)				\
    do {								\
	const Tcl_ObjIntRep *irPtr;					\
	irPtr = TclFetchIntRep((objPtr), &localVarNameType);		\
	(name) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL;		\
	(index) = irPtr ? PTR2INT(irPtr->twoPtrValue.ptr2) : -1;	\
    } while (0)

static const Tcl_ObjType parsedVarNameType = {
    "parsedVarName",
    FreeParsedVarName, DupParsedVarName, NULL, NULL
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
	ir.twoPtrValue.ptr2 = ptr2;					\
	Tcl_StoreIntRep((objPtr), &parsedVarNameType, &ir);		\
    } while (0)

#define ParsedGetIntRep(objPtr, parsed, array, elem)			\
    do {								\
	const Tcl_ObjIntRep *irPtr;					\
	irPtr = Tcl_FetchIntRep((objPtr), &parsedVarNameType);		\
	(parsed) = (irPtr != NULL);					\
	(array) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL;		\
	(elem) = irPtr ? irPtr->twoPtrValue.ptr2 : NULL;		\
    } while (0)

Var *
TclVarHashCreateVar(







|







288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
	ir.twoPtrValue.ptr2 = ptr2;					\
	Tcl_StoreIntRep((objPtr), &parsedVarNameType, &ir);		\
    } while (0)

#define ParsedGetIntRep(objPtr, parsed, array, elem)			\
    do {								\
	const Tcl_ObjIntRep *irPtr;					\
	irPtr = TclFetchIntRep((objPtr), &parsedVarNameType);		\
	(parsed) = (irPtr != NULL);					\
	(array) = irPtr ? irPtr->twoPtrValue.ptr1 : NULL;		\
	(elem) = irPtr ? irPtr->twoPtrValue.ptr2 : NULL;		\
    } while (0)

Var *
TclVarHashCreateVar(
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
}

static int
NotArrayError(
    Tcl_Interp *interp,
    Tcl_Obj *name)
{
    const char *nameStr = Tcl_GetString(name);

    Tcl_SetObjResult(interp,
	    Tcl_ObjPrintf("\"%s\" isn't an array", nameStr));
    Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ARRAY", nameStr, NULL);
    return TCL_ERROR;
}








|







339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
}

static int
NotArrayError(
    Tcl_Interp *interp,
    Tcl_Obj *name)
{
    const char *nameStr = TclGetString(name);

    Tcl_SetObjResult(interp,
	    Tcl_ObjPrintf("\"%s\" isn't an array", nameStr));
    Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "ARRAY", nameStr, NULL);
    return TCL_ERROR;
}

6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
CompareVarKeys(
    void *keyPtr,			/* New key to compare. */
    Tcl_HashEntry *hPtr)	/* Existing key to compare. */
{
    Tcl_Obj *objPtr1 = (Tcl_Obj *)keyPtr;
    Tcl_Obj *objPtr2 = hPtr->key.objPtr;
    register const char *p1, *p2;
    register int l1, l2;

    /*
     * If the object pointers are the same then they match.
     * OPT: this comparison was moved to the caller
     *
     * if (objPtr1 == objPtr2) return 1;
     */







|







6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
CompareVarKeys(
    void *keyPtr,			/* New key to compare. */
    Tcl_HashEntry *hPtr)	/* Existing key to compare. */
{
    Tcl_Obj *objPtr1 = (Tcl_Obj *)keyPtr;
    Tcl_Obj *objPtr2 = hPtr->key.objPtr;
    register const char *p1, *p2;
    register size_t l1, l2;

    /*
     * If the object pointers are the same then they match.
     * OPT: this comparison was moved to the caller
     *
     * if (objPtr1 == objPtr2) return 1;
     */
Changes to generic/tclZipfs.c.
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
{
    if (objc > 4) {
	Tcl_WrongNumArgs(interp, 1, objv,
		 "?mountpoint? ?zipfile? ?password?");
	return TCL_ERROR;
    }

    return TclZipfs_Mount(interp, (objc > 1) ? Tcl_GetString(objv[1]) : NULL,
	    (objc > 2) ? Tcl_GetString(objv[2]) : NULL,
	    (objc > 3) ? Tcl_GetString(objv[3]) : NULL);
}

/*
 *-------------------------------------------------------------------------
 *
 * ZipFSMountBufferObjCmd --
 *







|
|
|







1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
{
    if (objc > 4) {
	Tcl_WrongNumArgs(interp, 1, objv,
		 "?mountpoint? ?zipfile? ?password?");
	return TCL_ERROR;
    }

    return TclZipfs_Mount(interp, (objc > 1) ? TclGetString(objv[1]) : NULL,
	    (objc > 2) ? TclGetString(objv[2]) : NULL,
	    (objc > 3) ? TclGetString(objv[3]) : NULL);
}

/*
 *-------------------------------------------------------------------------
 *
 * ZipFSMountBufferObjCmd --
 *
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928

	ReadLock();
	ret = ListMountPoints(interp);
	Unlock();
	return ret;
    }

    mountPoint = Tcl_GetString(objv[1]);
    if (objc < 3) {
	ReadLock();
	DescribeMounted(interp, mountPoint);
	Unlock();
	return TCL_OK;
    }








|







1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928

	ReadLock();
	ret = ListMountPoints(interp);
	Unlock();
	return ret;
    }

    mountPoint = TclGetString(objv[1]);
    if (objc < 3) {
	ReadLock();
	DescribeMounted(interp, mountPoint);
	Unlock();
	return TCL_OK;
    }

1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
    int objc,			/* Number of arguments. */
    Tcl_Obj *const objv[])	/* Argument objects. */
{
    if (objc != 2) {
	Tcl_WrongNumArgs(interp, 1, objv, "zipfile");
	return TCL_ERROR;
    }
    return TclZipfs_Unmount(interp, Tcl_GetString(objv[1]));
}

/*
 *-------------------------------------------------------------------------
 *
 * ZipFSMkKeyObjCmd --
 *







|







1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
    int objc,			/* Number of arguments. */
    Tcl_Obj *const objv[])	/* Argument objects. */
{
    if (objc != 2) {
	Tcl_WrongNumArgs(interp, 1, objv, "zipfile");
	return TCL_ERROR;
    }
    return TclZipfs_Unmount(interp, TclGetString(objv[1]));
}

/*
 *-------------------------------------------------------------------------
 *
 * ZipFSMkKeyObjCmd --
 *
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
    int len, i = 0;
    char *pw, passBuf[264];

    if (objc != 2) {
	Tcl_WrongNumArgs(interp, 1, objv, "password");
	return TCL_ERROR;
    }
    pw = Tcl_GetString(objv[1]);
    len = strlen(pw);
    if (len == 0) {
	return TCL_OK;
    }
    if ((len > 255) || strchr(pw, 0xff)) {
	Tcl_SetObjResult(interp, Tcl_NewStringObj("illegal password", -1));
	return TCL_ERROR;







|







2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
    int len, i = 0;
    char *pw, passBuf[264];

    if (objc != 2) {
	Tcl_WrongNumArgs(interp, 1, objv, "password");
	return TCL_ERROR;
    }
    pw = TclGetString(objv[1]);
    len = strlen(pw);
    if (len == 0) {
	return TCL_OK;
    }
    if ((len > 255) || strchr(pw, 0xff)) {
	Tcl_SetObjResult(interp, Tcl_NewStringObj("illegal password", -1));
	return TCL_ERROR;
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463

    /*
     * Caller has verified that the number of arguments is correct.
     */

    passBuf[0] = 0;
    if (objc > (isList ? 3 : 4)) {
	pw = Tcl_GetString(objv[isList ? 3 : 4]);
	pwlen = strlen(pw);
	if ((pwlen > 255) || strchr(pw, 0xff)) {
	    Tcl_SetObjResult(interp,
		    Tcl_NewStringObj("illegal password", -1));
	    Tcl_SetErrorCode(interp, "TCL", "ZIPFS", "BAD_PASS", NULL);
	    return TCL_ERROR;
	}







|







2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463

    /*
     * Caller has verified that the number of arguments is correct.
     */

    passBuf[0] = 0;
    if (objc > (isList ? 3 : 4)) {
	pw = TclGetString(objv[isList ? 3 : 4]);
	pwlen = strlen(pw);
	if ((pwlen > 255) || strchr(pw, 0xff)) {
	    Tcl_SetObjResult(interp,
		    Tcl_NewStringObj("illegal password", -1));
	    Tcl_SetErrorCode(interp, "TCL", "ZIPFS", "BAD_PASS", NULL);
	    return TCL_ERROR;
	}
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
    }
    if (lobjc == 0) {
	Tcl_DecrRefCount(list);
	Tcl_SetObjResult(interp, Tcl_NewStringObj("empty archive", -1));
	Tcl_SetErrorCode(interp, "TCL", "ZIPFS", "EMPTY", NULL);
	return TCL_ERROR;
    }
    out = Tcl_OpenFileChannel(interp, Tcl_GetString(objv[1]), "wb", 0755);
    if (out == NULL) {
	Tcl_DecrRefCount(list);
	return TCL_ERROR;
    }
    if (pwlen <= 0) {
	pw = NULL;
	pwlen = 0;
    }
    if (isImg) {
	ZipFile *zf, zf0;
	int isMounted = 0;
	const char *imgName;

	if (isList) {
	    imgName = (objc > 4) ? Tcl_GetString(objv[4]) :
		    Tcl_GetNameOfExecutable();
	} else {
	    imgName = (objc > 5) ? Tcl_GetString(objv[5]) :
		    Tcl_GetNameOfExecutable();
	}
	if (pwlen) {
	    i = 0;
	    for (len = pwlen; len-- > 0;) {
		int ch = pw[len];








|














|


|







2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
    }
    if (lobjc == 0) {
	Tcl_DecrRefCount(list);
	Tcl_SetObjResult(interp, Tcl_NewStringObj("empty archive", -1));
	Tcl_SetErrorCode(interp, "TCL", "ZIPFS", "EMPTY", NULL);
	return TCL_ERROR;
    }
    out = Tcl_OpenFileChannel(interp, TclGetString(objv[1]), "wb", 0755);
    if (out == NULL) {
	Tcl_DecrRefCount(list);
	return TCL_ERROR;
    }
    if (pwlen <= 0) {
	pw = NULL;
	pwlen = 0;
    }
    if (isImg) {
	ZipFile *zf, zf0;
	int isMounted = 0;
	const char *imgName;

	if (isList) {
	    imgName = (objc > 4) ? TclGetString(objv[4]) :
		    Tcl_GetNameOfExecutable();
	} else {
	    imgName = (objc > 5) ? TclGetString(objv[5]) :
		    Tcl_GetNameOfExecutable();
	}
	if (pwlen) {
	    i = 0;
	    for (len = pwlen; len-- > 0;) {
		int ch = pw[len];

2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
	}
	memset(passBuf, 0, sizeof(passBuf));
	Tcl_Flush(out);
    }
    Tcl_InitHashTable(&fileHash, TCL_STRING_KEYS);
    pos[0] = Tcl_Tell(out);
    if (!isList && (objc > 3)) {
	strip = Tcl_GetString(objv[3]);
	slen = strlen(strip);
    }
    for (i = 0; i < (size_t) lobjc; i += (isList ? 2 : 1)) {
	const char *path, *name;

	path = Tcl_GetString(lobjv[i]);
	if (isList) {
	    name = Tcl_GetString(lobjv[i + 1]);
	} else {
	    name = path;
	    if (slen > 0) {
		len = strlen(name);
		if ((len <= slen) || (strncmp(strip, name, slen) != 0)) {
		    continue;
		}







|





|

|







2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
	}
	memset(passBuf, 0, sizeof(passBuf));
	Tcl_Flush(out);
    }
    Tcl_InitHashTable(&fileHash, TCL_STRING_KEYS);
    pos[0] = Tcl_Tell(out);
    if (!isList && (objc > 3)) {
	strip = TclGetString(objv[3]);
	slen = strlen(strip);
    }
    for (i = 0; i < (size_t) lobjc; i += (isList ? 2 : 1)) {
	const char *path, *name;

	path = TclGetString(lobjv[i]);
	if (isList) {
	    name = TclGetString(lobjv[i + 1]);
	} else {
	    name = path;
	    if (slen > 0) {
		len = strlen(name);
		if ((len <= slen) || (strncmp(strip, name, slen) != 0)) {
		    continue;
		}
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
	}
    }
    pos[1] = Tcl_Tell(out);
    count = 0;
    for (i = 0; i < (size_t) lobjc; i += (isList ? 2 : 1)) {
	const char *path, *name;

	path = Tcl_GetString(lobjv[i]);
	if (isList) {
	    name = Tcl_GetString(lobjv[i + 1]);
	} else {
	    name = path;
	    if (slen > 0) {
		len = strlen(name);
		if ((len <= slen) || (strncmp(strip, name, slen) != 0)) {
		    continue;
		}







|

|







2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
	}
    }
    pos[1] = Tcl_Tell(out);
    count = 0;
    for (i = 0; i < (size_t) lobjc; i += (isList ? 2 : 1)) {
	const char *path, *name;

	path = TclGetString(lobjv[i]);
	if (isList) {
	    name = TclGetString(lobjv[i + 1]);
	} else {
	    name = path;
	    if (slen > 0) {
		len = strlen(name);
		if ((len <= slen) || (strncmp(strip, name, slen) != 0)) {
		    continue;
		}
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939

    if (objc < 2 || objc > 4) {
	Tcl_WrongNumArgs(interp, 1, objv, "?mountpoint? filename ?inZipfs?");
	return TCL_ERROR;
    }
    Tcl_DStringInit(&dPath);
    if (objc == 2) {
	filename = Tcl_GetString(objv[1]);
	result = CanonicalPath("", filename, &dPath, 1);
    } else if (objc == 3) {
	mntpoint = Tcl_GetString(objv[1]);
	filename = Tcl_GetString(objv[2]);
	result = CanonicalPath(mntpoint, filename, &dPath, 1);
    } else {
	int zipfs = 0;

	if (Tcl_GetBooleanFromObj(interp, objv[3], &zipfs)) {
	    return TCL_ERROR;
	}
	mntpoint = Tcl_GetString(objv[1]);
	filename = Tcl_GetString(objv[2]);
	result = CanonicalPath(mntpoint, filename, &dPath, zipfs);
    }
    Tcl_SetObjResult(interp, Tcl_NewStringObj(result, -1));
    return TCL_OK;
}

/*







|


|
|







|
|







2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939

    if (objc < 2 || objc > 4) {
	Tcl_WrongNumArgs(interp, 1, objv, "?mountpoint? filename ?inZipfs?");
	return TCL_ERROR;
    }
    Tcl_DStringInit(&dPath);
    if (objc == 2) {
	filename = TclGetString(objv[1]);
	result = CanonicalPath("", filename, &dPath, 1);
    } else if (objc == 3) {
	mntpoint = TclGetString(objv[1]);
	filename = TclGetString(objv[2]);
	result = CanonicalPath(mntpoint, filename, &dPath, 1);
    } else {
	int zipfs = 0;

	if (Tcl_GetBooleanFromObj(interp, objv[3], &zipfs)) {
	    return TCL_ERROR;
	}
	mntpoint = TclGetString(objv[1]);
	filename = TclGetString(objv[2]);
	result = CanonicalPath(mntpoint, filename, &dPath, zipfs);
    }
    Tcl_SetObjResult(interp, Tcl_NewStringObj(result, -1));
    return TCL_OK;
}

/*
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
	return TCL_ERROR;
    }

    /*
     * Prepend ZIPFS_VOLUME to filename, eliding the final /
     */

    filename = Tcl_GetString(objv[1]);
    Tcl_DStringInit(&ds);
    Tcl_DStringAppend(&ds, ZIPFS_VOLUME, ZIPFS_VOLUME_LEN - 1);
    Tcl_DStringAppend(&ds, filename, -1);
    filename = Tcl_DStringValue(&ds);

    ReadLock();
    exists = ZipFSLookup(filename) != NULL;







|







2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
	return TCL_ERROR;
    }

    /*
     * Prepend ZIPFS_VOLUME to filename, eliding the final /
     */

    filename = TclGetString(objv[1]);
    Tcl_DStringInit(&ds);
    Tcl_DStringAppend(&ds, ZIPFS_VOLUME, ZIPFS_VOLUME_LEN - 1);
    Tcl_DStringAppend(&ds, filename, -1);
    filename = Tcl_DStringValue(&ds);

    ReadLock();
    exists = ZipFSLookup(filename) != NULL;
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
    char *filename;
    ZipEntry *z;

    if (objc != 2) {
	Tcl_WrongNumArgs(interp, 1, objv, "filename");
	return TCL_ERROR;
    }
    filename = Tcl_GetString(objv[1]);
    ReadLock();
    z = ZipFSLookup(filename);
    if (z) {
	Tcl_Obj *result = Tcl_GetObjResult(interp);

	Tcl_ListObjAppendElement(interp, result,
		Tcl_NewStringObj(z->zipFilePtr->name, -1));







|







3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
    char *filename;
    ZipEntry *z;

    if (objc != 2) {
	Tcl_WrongNumArgs(interp, 1, objv, "filename");
	return TCL_ERROR;
    }
    filename = TclGetString(objv[1]);
    ReadLock();
    z = ZipFSLookup(filename);
    if (z) {
	Tcl_Obj *result = Tcl_GetObjResult(interp);

	Tcl_ListObjAppendElement(interp, result,
		Tcl_NewStringObj(z->zipFilePtr->name, -1));
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
	return TCL_ERROR;
    }
    if (objc == 3) {
	size_t n;
	char *what = TclGetStringFromObj(objv[1], &n);

	if ((n >= 2) && (strncmp(what, "-glob", n) == 0)) {
	    pattern = Tcl_GetString(objv[2]);
	} else if ((n >= 2) && (strncmp(what, "-regexp", n) == 0)) {
	    regexp = Tcl_RegExpCompile(interp, Tcl_GetString(objv[2]));
	    if (!regexp) {
		return TCL_ERROR;
	    }
	} else {
	    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		    "unknown option \"%s\"", what));
	    Tcl_SetErrorCode(interp, "TCL", "ZIPFS", "BAD_OPT", NULL);
	    return TCL_ERROR;
	}
    } else if (objc == 2) {
	pattern = Tcl_GetString(objv[1]);
    }
    ReadLock();
    if (pattern) {
	for (hPtr = Tcl_FirstHashEntry(&ZipFS.fileHash, &search);
		hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
	    ZipEntry *z = Tcl_GetHashValue(hPtr);








|

|










|







3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
	return TCL_ERROR;
    }
    if (objc == 3) {
	size_t n;
	char *what = TclGetStringFromObj(objv[1], &n);

	if ((n >= 2) && (strncmp(what, "-glob", n) == 0)) {
	    pattern = TclGetString(objv[2]);
	} else if ((n >= 2) && (strncmp(what, "-regexp", n) == 0)) {
	    regexp = Tcl_RegExpCompile(interp, TclGetString(objv[2]));
	    if (!regexp) {
		return TCL_ERROR;
	    }
	} else {
	    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		    "unknown option \"%s\"", what));
	    Tcl_SetErrorCode(interp, "TCL", "ZIPFS", "BAD_OPT", NULL);
	    return TCL_ERROR;
	}
    } else if (objc == 2) {
	pattern = TclGetString(objv[1]);
    }
    ReadLock();
    if (pattern) {
	for (hPtr = Tcl_FirstHashEntry(&ZipFS.fileHash, &search);
		hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
	    ZipEntry *z = Tcl_GetHashValue(hPtr);

3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
	    }
	    goto error;
	}
	memset(info->ubuf, 0, info->maxWrite);
	if (trunc) {
	    info->numBytes = 0;
	} else if (z->data) {
	    unsigned int j = z->numBytes;

	    if (j > info->maxWrite) {
		j = info->maxWrite;
	    }
	    memcpy(info->ubuf, z->data, j);
	    info->numBytes = j;
	} else {







|







3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
	    }
	    goto error;
	}
	memset(info->ubuf, 0, info->maxWrite);
	if (trunc) {
	    info->numBytes = 0;
	} else if (z->data) {
	    size_t j = z->numBytes;

	    if (j > info->maxWrite) {
		j = info->maxWrite;
	    }
	    memcpy(info->ubuf, z->data, j);
	    info->numBytes = j;
	} else {
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757

		memset(&stream, 0, sizeof(z_stream));
		stream.zalloc = Z_NULL;
		stream.zfree = Z_NULL;
		stream.opaque = Z_NULL;
		stream.avail_in = z->numCompressedBytes;
		if (z->isEncrypted) {
		    unsigned int j;

		    stream.avail_in -= 12;
		    cbuf = Tcl_AttemptAlloc(stream.avail_in);
		    if (!cbuf) {
			goto merror0;
		    }
		    for (j = 0; j < stream.avail_in; j++) {







|







3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757

		memset(&stream, 0, sizeof(z_stream));
		stream.zalloc = Z_NULL;
		stream.zfree = Z_NULL;
		stream.opaque = Z_NULL;
		stream.avail_in = z->numCompressedBytes;
		if (z->isEncrypted) {
		    size_t j;

		    stream.avail_in -= 12;
		    cbuf = Tcl_AttemptAlloc(stream.avail_in);
		    if (!cbuf) {
			goto merror0;
		    }
		    for (j = 0; j < stream.avail_in; j++) {
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
	    }
	    info->ubuf += i;
	}
	if (info->iscompr) {
	    z_stream stream;
	    int err;
	    unsigned char *ubuf = NULL;
	    unsigned int j;

	    memset(&stream, 0, sizeof(z_stream));
	    stream.zalloc = Z_NULL;
	    stream.zfree = Z_NULL;
	    stream.opaque = Z_NULL;
	    stream.avail_in = z->numCompressedBytes;
	    if (info->isEncrypted) {







|







3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
	    }
	    info->ubuf += i;
	}
	if (info->iscompr) {
	    z_stream stream;
	    int err;
	    unsigned char *ubuf = NULL;
	    size_t j;

	    memset(&stream, 0, sizeof(z_stream));
	    stream.zalloc = Z_NULL;
	    stream.zfree = Z_NULL;
	    stream.opaque = Z_NULL;
	    stream.avail_in = z->numCompressedBytes;
	    if (info->isEncrypted) {
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
	    ZIPFS_ERROR(interp, "decompression error");
	    if (interp) {
		Tcl_SetErrorCode(interp, "TCL", "ZIPFS", "CORRUPT", NULL);
	    }
	    goto error;
	} else if (info->isEncrypted) {
	    unsigned char *ubuf = NULL;
	    unsigned int j, len;

	    /*
	     * Decode encrypted but uncompressed file, since we support
	     * Tcl_Seek() on it, and it can be randomly accessed later.
	     */

	    len = z->numCompressedBytes - 12;







|







3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
	    ZIPFS_ERROR(interp, "decompression error");
	    if (interp) {
		Tcl_SetErrorCode(interp, "TCL", "ZIPFS", "CORRUPT", NULL);
	    }
	    goto error;
	} else if (info->isEncrypted) {
	    unsigned char *ubuf = NULL;
	    size_t j, len;

	    /*
	     * Decode encrypted but uncompressed file, since we support
	     * Tcl_Seek() on it, and it can be randomly accessed later.
	     */

	    len = z->numCompressedBytes - 12;
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200

    prefix = TclGetStringFromObj(pathPtr, &prefixLen);

    /*
     * The (normalized) path we're searching.
     */

    path = Tcl_GetString(normPathPtr);
    len = normPathPtr->length;

    Tcl_DStringInit(&dsPref);
    Tcl_DStringAppend(&dsPref, prefix, prefixLen);

    if (strcmp(prefix, path) == 0) {
	prefix = NULL;







|







4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200

    prefix = TclGetStringFromObj(pathPtr, &prefixLen);

    /*
     * The (normalized) path we're searching.
     */

    path = TclGetString(normPathPtr);
    len = normPathPtr->length;

    Tcl_DStringInit(&dsPref);
    Tcl_DStringAppend(&dsPref, prefix, prefixLen);

    if (strcmp(prefix, path) == 0) {
	prefix = NULL;
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
    char *path;

    pathPtr = Tcl_FSGetNormalizedPath(NULL, pathPtr);
    if (!pathPtr) {
	return -1;
    }

    path = Tcl_GetString(pathPtr);
    if (strncmp(path, ZIPFS_VOLUME, ZIPFS_VOLUME_LEN) != 0) {
	return -1;
    }

    len = pathPtr->length;

    ReadLock();







|







4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
    char *path;

    pathPtr = Tcl_FSGetNormalizedPath(NULL, pathPtr);
    if (!pathPtr) {
	return -1;
    }

    path = TclGetString(pathPtr);
    if (strncmp(path, ZIPFS_VOLUME, ZIPFS_VOLUME_LEN) != 0) {
	return -1;
    }

    len = pathPtr->length;

    ReadLock();
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
    char *path;
    ZipEntry *z;

    pathPtr = Tcl_FSGetNormalizedPath(NULL, pathPtr);
    if (!pathPtr) {
	return -1;
    }
    path = Tcl_GetString(pathPtr);
    ReadLock();
    z = ZipFSLookup(path);
    if (!z) {
	Tcl_SetErrno(ENOENT);
	ZIPFS_POSIX_ERROR(interp, "file not found");
	ret = TCL_ERROR;
	goto done;







|







4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
    char *path;
    ZipEntry *z;

    pathPtr = Tcl_FSGetNormalizedPath(NULL, pathPtr);
    if (!pathPtr) {
	return -1;
    }
    path = TclGetString(pathPtr);
    ReadLock();
    z = ZipFSLookup(path);
    if (!z) {
	Tcl_SetErrno(ENOENT);
	ZIPFS_POSIX_ERROR(interp, "file not found");
	ret = TCL_ERROR;
	goto done;
Changes to generic/tclZlib.c.
418
419
420
421
422
423
424

425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
				 * parsed. */
    GzipHeader *headerPtr,	/* Where to store the parsed-out values. */
    int *extraSizePtr)		/* Variable to add the length of header
				 * strings (filename, comment) to. */
{
    Tcl_Obj *value;
    int len, result = TCL_ERROR;

    const char *valueStr;
    Tcl_Encoding latin1enc;
    static const char *const types[] = {
	"binary", "text"
    };

    /*
     * RFC 1952 says that header strings are in ISO 8859-1 (LATIN-1).
     */

    latin1enc = Tcl_GetEncoding(NULL, "iso8859-1");
    if (latin1enc == NULL) {
	Tcl_Panic("no latin-1 encoding");
    }

    if (GetValue(interp, dictObj, "comment", &value) != TCL_OK) {
	goto error;
    } else if (value != NULL) {
	valueStr = TclGetString(value);
	Tcl_UtfToExternal(NULL, latin1enc, valueStr, value->length, 0, NULL,
		headerPtr->nativeCommentBuf, MAX_COMMENT_LEN-1, NULL, &len,
		NULL);
	headerPtr->nativeCommentBuf[len] = '\0';
	headerPtr->header.comment = (Bytef *) headerPtr->nativeCommentBuf;
	if (extraSizePtr != NULL) {
	    *extraSizePtr += len;
	}
    }

    if (GetValue(interp, dictObj, "crc", &value) != TCL_OK) {
	goto error;
    } else if (value != NULL &&
	    Tcl_GetBooleanFromObj(interp, value, &headerPtr->header.hcrc)) {
	goto error;
    }

    if (GetValue(interp, dictObj, "filename", &value) != TCL_OK) {
	goto error;
    } else if (value != NULL) {
	valueStr = TclGetString(value);
	Tcl_UtfToExternal(NULL, latin1enc, valueStr, value->length, 0, NULL,
		headerPtr->nativeFilenameBuf, MAXPATHLEN-1, NULL, &len, NULL);
	headerPtr->nativeFilenameBuf[len] = '\0';
	headerPtr->header.name = (Bytef *) headerPtr->nativeFilenameBuf;
	if (extraSizePtr != NULL) {
	    *extraSizePtr += len;
	}
    }







>


















|
|



















|
|







418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
				 * parsed. */
    GzipHeader *headerPtr,	/* Where to store the parsed-out values. */
    int *extraSizePtr)		/* Variable to add the length of header
				 * strings (filename, comment) to. */
{
    Tcl_Obj *value;
    int len, result = TCL_ERROR;
    size_t length;
    const char *valueStr;
    Tcl_Encoding latin1enc;
    static const char *const types[] = {
	"binary", "text"
    };

    /*
     * RFC 1952 says that header strings are in ISO 8859-1 (LATIN-1).
     */

    latin1enc = Tcl_GetEncoding(NULL, "iso8859-1");
    if (latin1enc == NULL) {
	Tcl_Panic("no latin-1 encoding");
    }

    if (GetValue(interp, dictObj, "comment", &value) != TCL_OK) {
	goto error;
    } else if (value != NULL) {
	valueStr = TclGetStringFromObj(value, &length);
	Tcl_UtfToExternal(NULL, latin1enc, valueStr, length, 0, NULL,
		headerPtr->nativeCommentBuf, MAX_COMMENT_LEN-1, NULL, &len,
		NULL);
	headerPtr->nativeCommentBuf[len] = '\0';
	headerPtr->header.comment = (Bytef *) headerPtr->nativeCommentBuf;
	if (extraSizePtr != NULL) {
	    *extraSizePtr += len;
	}
    }

    if (GetValue(interp, dictObj, "crc", &value) != TCL_OK) {
	goto error;
    } else if (value != NULL &&
	    Tcl_GetBooleanFromObj(interp, value, &headerPtr->header.hcrc)) {
	goto error;
    }

    if (GetValue(interp, dictObj, "filename", &value) != TCL_OK) {
	goto error;
    } else if (value != NULL) {
	valueStr = TclGetStringFromObj(value, &length);
	Tcl_UtfToExternal(NULL, latin1enc, valueStr, length, 0, NULL,
		headerPtr->nativeFilenameBuf, MAXPATHLEN-1, NULL, &len, NULL);
	headerPtr->nativeFilenameBuf[len] = '\0';
	headerPtr->header.name = (Bytef *) headerPtr->nativeFilenameBuf;
	if (extraSizePtr != NULL) {
	    *extraSizePtr += len;
	}
    }
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399

3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
	 * Embedded NUL bytes are ok; they'll be C080-encoded.
	 */

	if (optionName == NULL) {
	    Tcl_DStringAppendElement(dsPtr, "-dictionary");
	    if (cd->compDictObj) {
		Tcl_DStringAppendElement(dsPtr,
			Tcl_GetString(cd->compDictObj));
	    } else {
		Tcl_DStringAppendElement(dsPtr, "");
	    }
	} else {
	    if (cd->compDictObj) {

		const char *str = TclGetString(cd->compDictObj);

		Tcl_DStringAppend(dsPtr, str, cd->compDictObj->length);
	    }
	    return TCL_OK;
	}
    }

    /*
     * The "header" option, which is only valid on inflating gzip channels,
     * reports the header that has been read from the start of the stream.
     */

    if ((cd->flags & IN_HEADER) && ((optionName == NULL) ||
	    (strcmp(optionName, "-header") == 0))) {
	Tcl_Obj *tmpObj = Tcl_NewObj();

	ExtractHeader(&cd->inHeader.header, tmpObj);
	if (optionName == NULL) {
	    Tcl_DStringAppendElement(dsPtr, "-header");
	    Tcl_DStringAppendElement(dsPtr, Tcl_GetString(tmpObj));
	    Tcl_DecrRefCount(tmpObj);
	} else {
	    TclDStringAppendObj(dsPtr, tmpObj);
	    Tcl_DecrRefCount(tmpObj);
	    return TCL_OK;
	}
    }







|





>
|

|

















|







3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
	 * Embedded NUL bytes are ok; they'll be C080-encoded.
	 */

	if (optionName == NULL) {
	    Tcl_DStringAppendElement(dsPtr, "-dictionary");
	    if (cd->compDictObj) {
		Tcl_DStringAppendElement(dsPtr,
			TclGetString(cd->compDictObj));
	    } else {
		Tcl_DStringAppendElement(dsPtr, "");
	    }
	} else {
	    if (cd->compDictObj) {
		size_t length;
		const char *str = TclGetStringFromObj(cd->compDictObj, &length);

		Tcl_DStringAppend(dsPtr, str, length);
	    }
	    return TCL_OK;
	}
    }

    /*
     * The "header" option, which is only valid on inflating gzip channels,
     * reports the header that has been read from the start of the stream.
     */

    if ((cd->flags & IN_HEADER) && ((optionName == NULL) ||
	    (strcmp(optionName, "-header") == 0))) {
	Tcl_Obj *tmpObj = Tcl_NewObj();

	ExtractHeader(&cd->inHeader.header, tmpObj);
	if (optionName == NULL) {
	    Tcl_DStringAppendElement(dsPtr, "-header");
	    Tcl_DStringAppendElement(dsPtr, TclGetString(tmpObj));
	    Tcl_DecrRefCount(tmpObj);
	} else {
	    TclDStringAppendObj(dsPtr, tmpObj);
	    Tcl_DecrRefCount(tmpObj);
	    return TCL_OK;
	}
    }
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
    return TCL_OK;
}

int
Tcl_ZlibStreamGet(
    Tcl_ZlibStream zshandle,
    Tcl_Obj *data,
	size_t count)
{
    return TCL_OK;
}

int
Tcl_ZlibDeflate(
    Tcl_Interp *interp,







|







4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
    return TCL_OK;
}

int
Tcl_ZlibStreamGet(
    Tcl_ZlibStream zshandle,
    Tcl_Obj *data,
    size_t count)
{
    return TCL_OK;
}

int
Tcl_ZlibDeflate(
    Tcl_Interp *interp,
Changes to library/http/cookiejar.tcl.
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
		}
	    }
	}
	set n [expr {[db total_changes] - $n}]
	log info "constructed domain info with %d entries" $n
    }

    # This forces the rebuild of the domain data, loading it from 
    method forceLoadDomainData {} {
	db transaction {
	    db eval {
		DELETE FROM domains;
		DELETE FROM forbiddenSuper;
		INSERT OR REPLACE INTO domainCacheMetadata
		    (id, retrievalDate, installDate)







|







454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
		}
	    }
	}
	set n [expr {[db total_changes] - $n}]
	log info "constructed domain info with %d entries" $n
    }

    # This forces the rebuild of the domain data, loading it from
    method forceLoadDomainData {} {
	db transaction {
	    db eval {
		DELETE FROM domains;
		DELETE FROM forbiddenSuper;
		INSERT OR REPLACE INTO domainCacheMetadata
		    (id, retrievalDate, installDate)
Changes to libtommath/LICENSE.
1
2
3
4
5
6
7
8
9
10

11
12
13
14
15
16
17
18
19


20
21
22
23
24
25
26
27
28
29
LibTomMath is licensed under DUAL licensing terms.

Choose and use the license of your needs.

[LICENSE #1]

LibTomMath is public domain.  As should all quality software be.

Tom St Denis


[/LICENSE #1]

[LICENSE #2]

            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
                    Version 2, December 2004

 Copyright (C) 2004 Sam Hocevar <[email protected]>



 Everyone is permitted to copy and distribute verbatim or modified
 copies of this license document, and changing it is allowed as long
 as the name is changed.

            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  0. You just DO WHAT THE FUCK YOU WANT TO. 

[/LICENSE #2]
|

|

<
|
|
|
|

>
|
|
|
|
<
<
|
|

>
>
|
|
|
|
|
<

<
|
<
1
2
3
4

5
6
7
8
9
10
11
12
13
14


15
16
17
18
19
20
21
22
23
24

25

26

                          The LibTom license

This is free and unencumbered software released into the public domain.


Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of


relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.



For more information, please refer to <http://unlicense.org/>

Changes to libtommath/bn_error.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_ERROR_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

static const struct {
   int code;
   const char *msg;
} msgs[] = {
   { MP_OKAY, "Successful" },











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_ERROR_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

static const struct {
   int code;
   const char *msg;
} msgs[] = {
   { MP_OKAY, "Successful" },
Changes to libtommath/bn_fast_mp_invmod.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_FAST_MP_INVMOD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* computes the modular inverse via binary extended euclidean algorithm,
 * that is c = 1/a mod b
 *
 * Based on slow invmod except this is optimized for the case where b is
 * odd as per HAC Note 14.64 on pp. 610











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_FAST_MP_INVMOD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* computes the modular inverse via binary extended euclidean algorithm,
 * that is c = 1/a mod b
 *
 * Based on slow invmod except this is optimized for the case where b is
 * odd as per HAC Note 14.64 on pp. 610
Changes to libtommath/bn_fast_mp_montgomery_reduce.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_FAST_MP_MONTGOMERY_REDUCE_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* computes xR**-1 == x (mod N) via Montgomery Reduction
 *
 * This is an optimized implementation of montgomery_reduce
 * which uses the comba method to quickly calculate the columns of the
 * reduction.











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_FAST_MP_MONTGOMERY_REDUCE_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* computes xR**-1 == x (mod N) via Montgomery Reduction
 *
 * This is an optimized implementation of montgomery_reduce
 * which uses the comba method to quickly calculate the columns of the
 * reduction.
Changes to libtommath/bn_fast_s_mp_mul_digs.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_FAST_S_MP_MUL_DIGS_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* Fast (comba) multiplier
 *
 * This is the fast column-array [comba] multiplier.  It is
 * designed to compute the columns of the product first
 * then handle the carries afterwards.  This has the effect











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_FAST_S_MP_MUL_DIGS_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* Fast (comba) multiplier
 *
 * This is the fast column-array [comba] multiplier.  It is
 * designed to compute the columns of the product first
 * then handle the carries afterwards.  This has the effect
Changes to libtommath/bn_fast_s_mp_mul_high_digs.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_FAST_S_MP_MUL_HIGH_DIGS_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* this is a modified version of fast_s_mul_digs that only produces
 * output digits *above* digs.  See the comments for fast_s_mul_digs
 * to see how it works.
 *
 * This is used in the Barrett reduction since for one of the multiplications











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_FAST_S_MP_MUL_HIGH_DIGS_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* this is a modified version of fast_s_mul_digs that only produces
 * output digits *above* digs.  See the comments for fast_s_mul_digs
 * to see how it works.
 *
 * This is used in the Barrett reduction since for one of the multiplications
Changes to libtommath/bn_fast_s_mp_sqr.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_FAST_S_MP_SQR_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* the jist of squaring...
 * you do like mult except the offset of the tmpx [one that
 * starts closer to zero] can't equal the offset of tmpy.
 * So basically you set up iy like before then you min it with
 * (ty-tx) so that it never happens.  You double all those











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_FAST_S_MP_SQR_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* the jist of squaring...
 * you do like mult except the offset of the tmpx [one that
 * starts closer to zero] can't equal the offset of tmpy.
 * So basically you set up iy like before then you min it with
 * (ty-tx) so that it never happens.  You double all those
Changes to libtommath/bn_mp_2expt.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_2EXPT_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* computes a = 2**b
 *
 * Simple algorithm which zeroes the int, grows it then just sets one bit
 * as required.
 */











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_2EXPT_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* computes a = 2**b
 *
 * Simple algorithm which zeroes the int, grows it then just sets one bit
 * as required.
 */
Changes to libtommath/bn_mp_abs.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_ABS_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* b = |a|
 *
 * Simple function copies the input and fixes the sign to positive
 */
int mp_abs(const mp_int *a, mp_int *b)











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_ABS_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* b = |a|
 *
 * Simple function copies the input and fixes the sign to positive
 */
int mp_abs(const mp_int *a, mp_int *b)
Changes to libtommath/bn_mp_add.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_ADD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* high level addition (handles signs) */
int mp_add(const mp_int *a, const mp_int *b, mp_int *c)
{
   int     sa, sb, res;












|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_ADD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* high level addition (handles signs) */
int mp_add(const mp_int *a, const mp_int *b, mp_int *c)
{
   int     sa, sb, res;

Changes to libtommath/bn_mp_add_d.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_ADD_D_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* single digit addition */
int mp_add_d(const mp_int *a, mp_digit b, mp_int *c)
{
   int     res, ix, oldused;
   mp_digit *tmpa, *tmpc, mu;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_ADD_D_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* single digit addition */
int mp_add_d(const mp_int *a, mp_digit b, mp_int *c)
{
   int     res, ix, oldused;
   mp_digit *tmpa, *tmpc, mu;
Changes to libtommath/bn_mp_addmod.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_ADDMOD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* d = a + b (mod c) */
int mp_addmod(const mp_int *a, const mp_int *b, const mp_int *c, mp_int *d)
{
   int     res;
   mp_int  t;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_ADDMOD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* d = a + b (mod c) */
int mp_addmod(const mp_int *a, const mp_int *b, const mp_int *c, mp_int *d)
{
   int     res;
   mp_int  t;
Changes to libtommath/bn_mp_and.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_AND_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* AND two ints together */
int mp_and(const mp_int *a, const mp_int *b, mp_int *c)
{
   int     res, ix, px;
   mp_int  t;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_AND_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* AND two ints together */
int mp_and(const mp_int *a, const mp_int *b, mp_int *c)
{
   int     res, ix, px;
   mp_int  t;
Changes to libtommath/bn_mp_clamp.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_CLAMP_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* trim unused digits
 *
 * This is used to ensure that leading zero digits are
 * trimed and the leading "used" digit will be non-zero
 * Typically very fast.  Also fixes the sign if there











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_CLAMP_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* trim unused digits
 *
 * This is used to ensure that leading zero digits are
 * trimed and the leading "used" digit will be non-zero
 * Typically very fast.  Also fixes the sign if there
Changes to libtommath/bn_mp_clear.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_CLEAR_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* clear one (frees)  */
void mp_clear(mp_int *a)
{
   int i;












|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_CLEAR_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* clear one (frees)  */
void mp_clear(mp_int *a)
{
   int i;

Changes to libtommath/bn_mp_clear_multi.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_CLEAR_MULTI_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

#include <stdarg.h>

void mp_clear_multi(mp_int *mp, ...)
{
   mp_int *next_mp = mp;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_CLEAR_MULTI_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

#include <stdarg.h>

void mp_clear_multi(mp_int *mp, ...)
{
   mp_int *next_mp = mp;
Changes to libtommath/bn_mp_cmp.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_CMP_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* compare two ints (signed)*/
int mp_cmp(const mp_int *a, const mp_int *b)
{
   /* compare based on sign */
   if (a->sign != b->sign) {











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_CMP_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* compare two ints (signed)*/
int mp_cmp(const mp_int *a, const mp_int *b)
{
   /* compare based on sign */
   if (a->sign != b->sign) {
Changes to libtommath/bn_mp_cmp_d.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_CMP_D_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* compare a digit */
int mp_cmp_d(const mp_int *a, mp_digit b)
{
   /* compare based on sign */
   if (a->sign == MP_NEG) {











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_CMP_D_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* compare a digit */
int mp_cmp_d(const mp_int *a, mp_digit b)
{
   /* compare based on sign */
   if (a->sign == MP_NEG) {
Changes to libtommath/bn_mp_cmp_mag.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_CMP_MAG_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* compare maginitude of two ints (unsigned) */
int mp_cmp_mag(const mp_int *a, const mp_int *b)
{
   int     n;
   mp_digit *tmpa, *tmpb;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_CMP_MAG_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* compare maginitude of two ints (unsigned) */
int mp_cmp_mag(const mp_int *a, const mp_int *b)
{
   int     n;
   mp_digit *tmpa, *tmpb;
Changes to libtommath/bn_mp_cnt_lsb.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_CNT_LSB_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

static const int lnz[16] = {
   4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0
};

/* Counts the number of lsbs which are zero before the first zero bit */











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_CNT_LSB_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

static const int lnz[16] = {
   4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0
};

/* Counts the number of lsbs which are zero before the first zero bit */
Changes to libtommath/bn_mp_complement.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_COMPLEMENT_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* b = ~a */
int mp_complement(const mp_int *a, mp_int *b)
{
   int res = mp_neg(a, b);
   return (res == MP_OKAY) ? mp_sub_d(b, 1uL, b) : res;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_COMPLEMENT_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* b = ~a */
int mp_complement(const mp_int *a, mp_int *b)
{
   int res = mp_neg(a, b);
   return (res == MP_OKAY) ? mp_sub_d(b, 1uL, b) : res;
Changes to libtommath/bn_mp_copy.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_COPY_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* copy, b = a */
int mp_copy(const mp_int *a, mp_int *b)
{
   int     res, n;












|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_COPY_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* copy, b = a */
int mp_copy(const mp_int *a, mp_int *b)
{
   int     res, n;

Changes to libtommath/bn_mp_count_bits.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_COUNT_BITS_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* returns the number of bits in an int */
int mp_count_bits(const mp_int *a)
{
   int     r;
   mp_digit q;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_COUNT_BITS_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* returns the number of bits in an int */
int mp_count_bits(const mp_int *a)
{
   int     r;
   mp_digit q;
Changes to libtommath/bn_mp_div.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_DIV_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

#ifdef BN_MP_DIV_SMALL

/* slower bit-bang division... also smaller */
int mp_div(const mp_int *a, const mp_int *b, mp_int *c, mp_int *d)
{











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_DIV_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

#ifdef BN_MP_DIV_SMALL

/* slower bit-bang division... also smaller */
int mp_div(const mp_int *a, const mp_int *b, mp_int *c, mp_int *d)
{
Changes to libtommath/bn_mp_div_2.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_DIV_2_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* b = a/2 */
int mp_div_2(const mp_int *a, mp_int *b)
{
   int     x, res, oldused;












|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_DIV_2_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* b = a/2 */
int mp_div_2(const mp_int *a, mp_int *b)
{
   int     x, res, oldused;

Changes to libtommath/bn_mp_div_2d.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_DIV_2D_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* shift right by a certain bit count (store quotient in c, optional remainder in d) */
int mp_div_2d(const mp_int *a, int b, mp_int *c, mp_int *d)
{
   mp_digit D, r, rr;
   int     x, res;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_DIV_2D_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* shift right by a certain bit count (store quotient in c, optional remainder in d) */
int mp_div_2d(const mp_int *a, int b, mp_int *c, mp_int *d)
{
   mp_digit D, r, rr;
   int     x, res;
Changes to libtommath/bn_mp_div_3.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_DIV_3_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* divide by three (based on routine from MPI and the GMP manual) */
int mp_div_3(const mp_int *a, mp_int *c, mp_digit *d)
{
   mp_int   q;
   mp_word  w, t;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_DIV_3_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* divide by three (based on routine from MPI and the GMP manual) */
int mp_div_3(const mp_int *a, mp_int *c, mp_digit *d)
{
   mp_int   q;
   mp_word  w, t;
Changes to libtommath/bn_mp_div_d.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_DIV_D_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* single digit division (based on routine from MPI) */
int mp_div_d(const mp_int *a, mp_digit b, mp_int *c, mp_digit *d)
{
   mp_int  q;
   mp_word w;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_DIV_D_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* single digit division (based on routine from MPI) */
int mp_div_d(const mp_int *a, mp_digit b, mp_int *c, mp_digit *d)
{
   mp_int  q;
   mp_word w;
Changes to libtommath/bn_mp_dr_is_modulus.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_DR_IS_MODULUS_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* determines if a number is a valid DR modulus */
int mp_dr_is_modulus(const mp_int *a)
{
   int ix;












|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_DR_IS_MODULUS_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* determines if a number is a valid DR modulus */
int mp_dr_is_modulus(const mp_int *a)
{
   int ix;

Changes to libtommath/bn_mp_dr_reduce.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_DR_REDUCE_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* reduce "x" in place modulo "n" using the Diminished Radix algorithm.
 *
 * Based on algorithm from the paper
 *
 * "Generating Efficient Primes for Discrete Log Cryptosystems"











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_DR_REDUCE_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* reduce "x" in place modulo "n" using the Diminished Radix algorithm.
 *
 * Based on algorithm from the paper
 *
 * "Generating Efficient Primes for Discrete Log Cryptosystems"
Changes to libtommath/bn_mp_dr_setup.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_DR_SETUP_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* determines the setup value */
void mp_dr_setup(const mp_int *a, mp_digit *d)
{
   /* the casts are required if DIGIT_BIT is one less than
    * the number of bits in a mp_digit [e.g. DIGIT_BIT==31]











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_DR_SETUP_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* determines the setup value */
void mp_dr_setup(const mp_int *a, mp_digit *d)
{
   /* the casts are required if DIGIT_BIT is one less than
    * the number of bits in a mp_digit [e.g. DIGIT_BIT==31]
Changes to libtommath/bn_mp_exch.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_EXCH_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* swap the elements of two integers, for cases where you can't simply swap the
 * mp_int pointers around
 */
void mp_exch(mp_int *a, mp_int *b)
{











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_EXCH_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* swap the elements of two integers, for cases where you can't simply swap the
 * mp_int pointers around
 */
void mp_exch(mp_int *a, mp_int *b)
{
Changes to libtommath/bn_mp_export.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_EXPORT_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* based on gmp's mpz_export.
 * see http://gmplib.org/manual/Integer-Import-and-Export.html
 */
int mp_export(void *rop, size_t *countp, int order, size_t size,
              int endian, size_t nails, const mp_int *op)











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_EXPORT_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* based on gmp's mpz_export.
 * see http://gmplib.org/manual/Integer-Import-and-Export.html
 */
int mp_export(void *rop, size_t *countp, int order, size_t size,
              int endian, size_t nails, const mp_int *op)
Changes to libtommath/bn_mp_expt_d.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_EXPT_D_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* wrapper function for mp_expt_d_ex() */
int mp_expt_d(const mp_int *a, mp_digit b, mp_int *c)
{
   return mp_expt_d_ex(a, b, c, 0);
}











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_EXPT_D_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* wrapper function for mp_expt_d_ex() */
int mp_expt_d(const mp_int *a, mp_digit b, mp_int *c)
{
   return mp_expt_d_ex(a, b, c, 0);
}
Changes to libtommath/bn_mp_expt_d_ex.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_EXPT_D_EX_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* calculate c = a**b  using a square-multiply algorithm */
int mp_expt_d_ex(const mp_int *a, mp_digit b, mp_int *c, int fast)
{
   int     res;
   unsigned int x;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_EXPT_D_EX_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* calculate c = a**b  using a square-multiply algorithm */
int mp_expt_d_ex(const mp_int *a, mp_digit b, mp_int *c, int fast)
{
   int     res;
   unsigned int x;
Changes to libtommath/bn_mp_exptmod.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_EXPTMOD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */


/* this is a shell function that calls either the normal or Montgomery
 * exptmod functions.  Originally the call to the montgomery code was
 * embedded in the normal function but that wasted alot of stack space
 * for nothing (since 99% of the time the Montgomery code would be called)











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_EXPTMOD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */


/* this is a shell function that calls either the normal or Montgomery
 * exptmod functions.  Originally the call to the montgomery code was
 * embedded in the normal function but that wasted alot of stack space
 * for nothing (since 99% of the time the Montgomery code would be called)
Changes to libtommath/bn_mp_exptmod_fast.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_EXPTMOD_FAST_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* computes Y == G**X mod P, HAC pp.616, Algorithm 14.85
 *
 * Uses a left-to-right k-ary sliding window to compute the modular exponentiation.
 * The value of k changes based on the size of the exponent.
 *











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_EXPTMOD_FAST_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* computes Y == G**X mod P, HAC pp.616, Algorithm 14.85
 *
 * Uses a left-to-right k-ary sliding window to compute the modular exponentiation.
 * The value of k changes based on the size of the exponent.
 *
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
      mp_set(&res, 1uL);
      if ((err = mp_mod(G, P, &M[1])) != MP_OKAY) {
         goto LBL_RES;
      }
   }

   /* compute the value at M[1<<(winsize-1)] by squaring M[1] (winsize-1) times */
   if ((err = mp_copy(&M[1], &M[1 << (winsize - 1)])) != MP_OKAY) {
      goto LBL_RES;
   }

   for (x = 0; x < (winsize - 1); x++) {
      if ((err = mp_sqr(&M[1 << (winsize - 1)], &M[1 << (winsize - 1)])) != MP_OKAY) {
         goto LBL_RES;
      }
      if ((err = redux(&M[1 << (winsize - 1)], P, mp)) != MP_OKAY) {
         goto LBL_RES;
      }
   }

   /* create upper table */
   for (x = (1 << (winsize - 1)) + 1; x < (1 << winsize); x++) {
      if ((err = mp_mul(&M[x - 1], &M[1], &M[x])) != MP_OKAY) {







|




|


|







160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
      mp_set(&res, 1uL);
      if ((err = mp_mod(G, P, &M[1])) != MP_OKAY) {
         goto LBL_RES;
      }
   }

   /* compute the value at M[1<<(winsize-1)] by squaring M[1] (winsize-1) times */
   if ((err = mp_copy(&M[1], &M[(size_t)1 << (winsize - 1)])) != MP_OKAY) {
      goto LBL_RES;
   }

   for (x = 0; x < (winsize - 1); x++) {
      if ((err = mp_sqr(&M[(size_t)1 << (winsize - 1)], &M[(size_t)1 << (winsize - 1)])) != MP_OKAY) {
         goto LBL_RES;
      }
      if ((err = redux(&M[(size_t)1 << (winsize - 1)], P, mp)) != MP_OKAY) {
         goto LBL_RES;
      }
   }

   /* create upper table */
   for (x = (1 << (winsize - 1)) + 1; x < (1 << winsize); x++) {
      if ((err = mp_mul(&M[x - 1], &M[1], &M[x])) != MP_OKAY) {
Changes to libtommath/bn_mp_exteuclid.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_EXTEUCLID_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* Extended euclidean algorithm of (a, b) produces
   a*u1 + b*u2 = u3
 */
int mp_exteuclid(const mp_int *a, const mp_int *b, mp_int *U1, mp_int *U2, mp_int *U3)
{











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_EXTEUCLID_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* Extended euclidean algorithm of (a, b) produces
   a*u1 + b*u2 = u3
 */
int mp_exteuclid(const mp_int *a, const mp_int *b, mp_int *U1, mp_int *U2, mp_int *U3)
{
Changes to libtommath/bn_mp_fread.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_FREAD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

#ifndef LTM_NO_FILE
/* read a bigint from a file stream in ASCII */
int mp_fread(mp_int *a, int radix, FILE *stream)
{
   int err, ch, neg, y;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_FREAD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

#ifndef LTM_NO_FILE
/* read a bigint from a file stream in ASCII */
int mp_fread(mp_int *a, int radix, FILE *stream)
{
   int err, ch, neg, y;
Changes to libtommath/bn_mp_fwrite.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_FWRITE_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

#ifndef LTM_NO_FILE
int mp_fwrite(const mp_int *a, int radix, FILE *stream)
{
   char *buf;
   int err, len, x;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_FWRITE_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

#ifndef LTM_NO_FILE
int mp_fwrite(const mp_int *a, int radix, FILE *stream)
{
   char *buf;
   int err, len, x;
Changes to libtommath/bn_mp_gcd.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_GCD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* Greatest Common Divisor using the binary method */
int mp_gcd(const mp_int *a, const mp_int *b, mp_int *c)
{
   mp_int  u, v;
   int     k, u_lsb, v_lsb, res;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_GCD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* Greatest Common Divisor using the binary method */
int mp_gcd(const mp_int *a, const mp_int *b, mp_int *c)
{
   mp_int  u, v;
   int     k, u_lsb, v_lsb, res;
Added libtommath/bn_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
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include "tommath_private.h"
#ifdef BN_MP_GET_BIT_C

/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense
 */

/* Checks the bit at position b and returns MP_YES
   if the bit is 1, MP_NO if it is 0 and MP_VAL
   in case of error */
int mp_get_bit(const mp_int *a, int b)
{
   int limb;
   mp_digit bit, isset;

   if (b < 0) {
      return MP_VAL;
   }

   limb = b / DIGIT_BIT;

   /*
    * Zero is a special value with the member "used" set to zero.
    * Needs to be tested before the check for the upper boundary
    * otherwise (limb >= a->used) would be true for a = 0
    */

   if (mp_iszero(a) != MP_NO) {
      return MP_NO;
   }

   if (limb >= a->used) {
      return MP_VAL;
   }

   bit = (mp_digit)(1) << (b % DIGIT_BIT);

   isset = a->dp[limb] & bit;
   return (isset != 0u) ? MP_YES : MP_NO;
}

#endif

/* ref:         $Format:%D$ */
/* git commit:  $Format:%H$ */
/* commit time: $Format:%ai$ */
Added libtommath/bn_mp_get_double.c.






























































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "tommath_private.h"
#ifdef BN_MP_GET_DOUBLE_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense
 */

double mp_get_double(const mp_int *a)
{
   int i;
   double d = 0.0, fac = 1.0;
   for (i = 0; i < DIGIT_BIT; ++i) {
      fac *= 2.0;
   }
   for (i = USED(a); i --> 0;) {
      d = (d * fac) + (double)DIGIT(a, i);
   }
   return (mp_isneg(a) != MP_NO) ? -d : d;
}
#endif

/* ref:         $Format:%D$ */
/* git commit:  $Format:%H$ */
/* commit time: $Format:%ai$ */
Changes to libtommath/bn_mp_get_int.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_GET_INT_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* get the lower 32-bits of an mp_int */
unsigned long mp_get_int(const mp_int *a)
{
   int i;
   mp_min_u32 res;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_GET_INT_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* get the lower 32-bits of an mp_int */
unsigned long mp_get_int(const mp_int *a)
{
   int i;
   mp_min_u32 res;
Changes to libtommath/bn_mp_get_long.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_GET_LONG_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* get the lower unsigned long of an mp_int, platform dependent */
unsigned long mp_get_long(const mp_int *a)
{
   int i;
   unsigned long res;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_GET_LONG_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* get the lower unsigned long of an mp_int, platform dependent */
unsigned long mp_get_long(const mp_int *a)
{
   int i;
   unsigned long res;
33
34
35
36
37
38
39




   while (--i >= 0) {
      res = (res << DIGIT_BIT) | DIGIT(a, i);
   }
#endif
   return res;
}
#endif











>
>
>
>
32
33
34
35
36
37
38
39
40
41
42
   while (--i >= 0) {
      res = (res << DIGIT_BIT) | DIGIT(a, i);
   }
#endif
   return res;
}
#endif

/* ref:         $Format:%D$ */
/* git commit:  $Format:%H$ */
/* commit time: $Format:%ai$ */
Changes to libtommath/bn_mp_get_long_long.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_GET_LONG_LONG_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* get the lower unsigned long long of an mp_int, platform dependent */
Tcl_WideUInt mp_get_long_long(const mp_int *a)
{
   int i;
   Tcl_WideUInt res;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_GET_LONG_LONG_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* get the lower unsigned long long of an mp_int, platform dependent */
Tcl_WideUInt mp_get_long_long(const mp_int *a)
{
   int i;
   Tcl_WideUInt res;
33
34
35
36
37
38
39




   while (--i >= 0) {
      res = (res << DIGIT_BIT) | DIGIT(a, i);
   }
#endif
   return res;
}
#endif











>
>
>
>
32
33
34
35
36
37
38
39
40
41
42
   while (--i >= 0) {
      res = (res << DIGIT_BIT) | DIGIT(a, i);
   }
#endif
   return res;
}
#endif

/* ref:         $Format:%D$ */
/* git commit:  $Format:%H$ */
/* commit time: $Format:%ai$ */
Changes to libtommath/bn_mp_grow.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_GROW_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* grow as required */
int mp_grow(mp_int *a, int size)
{
   int     i;
   mp_digit *tmp;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_GROW_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* grow as required */
int mp_grow(mp_int *a, int size)
{
   int     i;
   mp_digit *tmp;
Changes to libtommath/bn_mp_import.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_IMPORT_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* based on gmp's mpz_import.
 * see http://gmplib.org/manual/Integer-Import-and-Export.html
 */
int mp_import(mp_int *rop, size_t count, int order, size_t size,
              int endian, size_t nails, const void *op)











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_IMPORT_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* based on gmp's mpz_import.
 * see http://gmplib.org/manual/Integer-Import-and-Export.html
 */
int mp_import(mp_int *rop, size_t count, int order, size_t size,
              int endian, size_t nails, const void *op)
Changes to libtommath/bn_mp_init.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_INIT_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* init a new mp_int */
int mp_init(mp_int *a)
{
   int i;












|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_INIT_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* init a new mp_int */
int mp_init(mp_int *a)
{
   int i;

Changes to libtommath/bn_mp_init_copy.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_INIT_COPY_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* creates "a" then copies b into it */
int mp_init_copy(mp_int *a, const mp_int *b)
{
   int     res;












|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_INIT_COPY_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* creates "a" then copies b into it */
int mp_init_copy(mp_int *a, const mp_int *b)
{
   int     res;

Changes to libtommath/bn_mp_init_multi.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_INIT_MULTI_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

#include <stdarg.h>

int mp_init_multi(mp_int *mp, ...)
{
   mp_err res = MP_OKAY;      /* Assume ok until proven otherwise */











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_INIT_MULTI_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

#include <stdarg.h>

int mp_init_multi(mp_int *mp, ...)
{
   mp_err res = MP_OKAY;      /* Assume ok until proven otherwise */
Changes to libtommath/bn_mp_init_set.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_INIT_SET_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* initialize and set a digit */
int mp_init_set(mp_int *a, mp_digit b)
{
   int err;
   if ((err = mp_init(a)) != MP_OKAY) {











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_INIT_SET_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* initialize and set a digit */
int mp_init_set(mp_int *a, mp_digit b)
{
   int err;
   if ((err = mp_init(a)) != MP_OKAY) {
Changes to libtommath/bn_mp_init_set_int.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_INIT_SET_INT_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* initialize and set a digit */
int mp_init_set_int(mp_int *a, unsigned long b)
{
   int err;
   if ((err = mp_init(a)) != MP_OKAY) {











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_INIT_SET_INT_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* initialize and set a digit */
int mp_init_set_int(mp_int *a, unsigned long b)
{
   int err;
   if ((err = mp_init(a)) != MP_OKAY) {
Changes to libtommath/bn_mp_init_size.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_INIT_SIZE_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* init an mp_init for a given size */
int mp_init_size(mp_int *a, int size)
{
   int x;












|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_INIT_SIZE_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* init an mp_init for a given size */
int mp_init_size(mp_int *a, int size)
{
   int x;

Changes to libtommath/bn_mp_invmod.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_INVMOD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* hac 14.61, pp608 */
int mp_invmod(const mp_int *a, const mp_int *b, mp_int *c)
{
   /* b cannot be negative and has to be >1 */
   if ((b->sign == MP_NEG) || (mp_cmp_d(b, 1uL) != MP_GT)) {











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_INVMOD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* hac 14.61, pp608 */
int mp_invmod(const mp_int *a, const mp_int *b, mp_int *c)
{
   /* b cannot be negative and has to be >1 */
   if ((b->sign == MP_NEG) || (mp_cmp_d(b, 1uL) != MP_GT)) {
Changes to libtommath/bn_mp_invmod_slow.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_INVMOD_SLOW_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* hac 14.61, pp608 */
int mp_invmod_slow(const mp_int *a, const mp_int *b, mp_int *c)
{
   mp_int  x, y, u, v, A, B, C, D;
   int     res;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_INVMOD_SLOW_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* hac 14.61, pp608 */
int mp_invmod_slow(const mp_int *a, const mp_int *b, mp_int *c)
{
   mp_int  x, y, u, v, A, B, C, D;
   int     res;
Changes to libtommath/bn_mp_is_square.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_IS_SQUARE_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* Check if remainders are possible squares - fast exclude non-squares */
static const char rem_128[128] = {
   0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1,
   0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1,
   1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1,











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_IS_SQUARE_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* Check if remainders are possible squares - fast exclude non-squares */
static const char rem_128[128] = {
   0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1,
   0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1,
   1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1,
Changes to libtommath/bn_mp_jacobi.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#include "tommath_private.h"
#ifdef BN_MP_JACOBI_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* computes the jacobi c = (a | n) (or Legendre if n is prime)
 * HAC pp. 73 Algorithm 2.149
 * HAC is wrong here, as the special case of (0 | 1) is not
 * handled correctly.
 */
int mp_jacobi(const mp_int *a, const mp_int *n, int *c)
{
   mp_int  a1, p1;
   int     k, s, r, res;
   mp_digit residue;

   /* if a < 0 return MP_VAL */
   if (mp_isneg(a) == MP_YES) {
      return MP_VAL;
   }

   /* if n <= 0 return MP_VAL */
   if (mp_cmp_d(n, 0uL) != MP_GT) {
      return MP_VAL;
   }

   /* step 1. handle case of a == 0 */
   if (mp_iszero(a) == MP_YES) {
      /* special case of a == 0 and n == 1 */
      if (mp_cmp_d(n, 1uL) == MP_EQ) {
         *c = 1;
      } else {
         *c = 0;
      }
      return MP_OKAY;
   }

   /* step 2.  if a == 1, return 1 */
   if (mp_cmp_d(a, 1uL) == MP_EQ) {
      *c = 1;
      return MP_OKAY;
   }

   /* default */
   s = 0;

   /* step 3.  write a = a1 * 2**k  */
   if ((res = mp_init_copy(&a1, a)) != MP_OKAY) {
      return res;
   }

   if ((res = mp_init(&p1)) != MP_OKAY) {
      goto LBL_A1;
   }

   /* divide out larger power of two */
   k = mp_cnt_lsb(&a1);
   if ((res = mp_div_2d(&a1, k, &a1, NULL)) != MP_OKAY) {
      goto LBL_P1;
   }

   /* step 4.  if e is even set s=1 */
   if (((unsigned)k & 1u) == 0u) {
      s = 1;
   } else {
      /* else set s=1 if p = 1/7 (mod 8) or s=-1 if p = 3/5 (mod 8) */
      residue = n->dp[0] & 7u;

      if ((residue == 1u) || (residue == 7u)) {
         s = 1;
      } else if ((residue == 3u) || (residue == 5u)) {
         s = -1;
      }
   }

   /* step 5.  if p == 3 (mod 4) *and* a1 == 3 (mod 4) then s = -s */
   if (((n->dp[0] & 3u) == 3u) && ((a1.dp[0] & 3u) == 3u)) {
      s = -s;
   }

   /* if a1 == 1 we're done */
   if (mp_cmp_d(&a1, 1uL) == MP_EQ) {
      *c = s;
   } else {
      /* n1 = n mod a1 */
      if ((res = mp_mod(n, &a1, &p1)) != MP_OKAY) {
         goto LBL_P1;
      }
      if ((res = mp_jacobi(&p1, &a1, &r)) != MP_OKAY) {
         goto LBL_P1;
      }
      *c = s * r;
   }

   /* done */
   res = MP_OKAY;
LBL_P1:
   mp_clear(&p1);
LBL_A1:
   mp_clear(&a1);
   return res;
}
#endif

/* ref:         $Format:%D$ */
/* git commit:  $Format:%H$ */
/* commit time: $Format:%ai$ */











|
<



|
<
<



<
<
<
<










<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16


17
18
19




20
21
22
23
24
25
26
27
28
29






















30




















































31
32
33
34
35
36
#include "tommath_private.h"
#ifdef BN_MP_JACOBI_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* computes the jacobi c = (a | n) (or Legendre if n is prime)
 * Kept for legacy reasons, please use mp_kronecker() instead


 */
int mp_jacobi(const mp_int *a, const mp_int *n, int *c)
{




   /* if a < 0 return MP_VAL */
   if (mp_isneg(a) == MP_YES) {
      return MP_VAL;
   }

   /* if n <= 0 return MP_VAL */
   if (mp_cmp_d(n, 0uL) != MP_GT) {
      return MP_VAL;
   }























   return mp_kronecker(a, n, c);




















































}
#endif

/* ref:         $Format:%D$ */
/* git commit:  $Format:%H$ */
/* commit time: $Format:%ai$ */
Changes to libtommath/bn_mp_karatsuba_mul.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_KARATSUBA_MUL_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* c = |a| * |b| using Karatsuba Multiplication using
 * three half size multiplications
 *
 * Let B represent the radix [e.g. 2**DIGIT_BIT] and
 * let n represent half of the number of digits in











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_KARATSUBA_MUL_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* c = |a| * |b| using Karatsuba Multiplication using
 * three half size multiplications
 *
 * Let B represent the radix [e.g. 2**DIGIT_BIT] and
 * let n represent half of the number of digits in
Changes to libtommath/bn_mp_karatsuba_sqr.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_KARATSUBA_SQR_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* Karatsuba squaring, computes b = a*a using three
 * half size squarings
 *
 * See comments of karatsuba_mul for details.  It
 * is essentially the same algorithm but merely











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_KARATSUBA_SQR_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* Karatsuba squaring, computes b = a*a using three
 * half size squarings
 *
 * See comments of karatsuba_mul for details.  It
 * is essentially the same algorithm but merely
Added libtommath/bn_mp_kronecker.c.
































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#include "tommath_private.h"
#ifdef BN_MP_KRONECKER_C

/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense
 */

/*
   Kronecker symbol (a|p)
   Straightforward implementation of algorithm 1.4.10 in
   Henri Cohen: "A Course in Computational Algebraic Number Theory"

   @book{cohen2013course,
     title={A course in computational algebraic number theory},
     author={Cohen, Henri},
     volume={138},
     year={2013},
     publisher={Springer Science \& Business Media}
    }
 */
int mp_kronecker(const mp_int *a, const mp_int *p, int *c)
{
   mp_int a1, p1, r;

   int e = MP_OKAY;
   int v, k;

   static const int table[8] = {0, 1, 0, -1, 0, -1, 0, 1};

   if (mp_iszero(p) != MP_NO) {
      if ((a->used == 1) && (a->dp[0] == 1u)) {
         *c = 1;
         return e;
      } else {
         *c = 0;
         return e;
      }
   }

   if ((mp_iseven(a) != MP_NO) && (mp_iseven(p) != MP_NO)) {
      *c = 0;
      return e;
   }

   if ((e = mp_init_copy(&a1, a)) != MP_OKAY) {
      return e;
   }
   if ((e = mp_init_copy(&p1, p)) != MP_OKAY) {
      goto LBL_KRON_0;
   }

   v = mp_cnt_lsb(&p1);
   if ((e = mp_div_2d(&p1, v, &p1, NULL)) != MP_OKAY) {
      goto LBL_KRON_1;
   }

   if ((v & 0x1) == 0) {
      k = 1;
   } else {
      k = table[a->dp[0] & 7u];
   }

   if (p1.sign == MP_NEG) {
      p1.sign = MP_ZPOS;
      if (a1.sign == MP_NEG) {
         k = -k;
      }
   }

   if ((e = mp_init(&r)) != MP_OKAY) {
      goto LBL_KRON_1;
   }

   for (;;) {
      if (mp_iszero(&a1) != MP_NO) {
         if (mp_cmp_d(&p1, 1uL) == MP_EQ) {
            *c = k;
            goto LBL_KRON;
         } else {
            *c = 0;
            goto LBL_KRON;
         }
      }

      v = mp_cnt_lsb(&a1);
      if ((e = mp_div_2d(&a1, v, &a1, NULL)) != MP_OKAY) {
         goto LBL_KRON;
      }

      if ((v & 0x1) == 1) {
         k = k * table[p1.dp[0] & 7u];
      }

      if (a1.sign == MP_NEG) {
         /*
          * Compute k = (-1)^((a1)*(p1-1)/4) * k
          * a1.dp[0] + 1 cannot overflow because the MSB
          * of the type mp_digit is not set by definition
          */
         if (((a1.dp[0] + 1u) & p1.dp[0] & 2u) != 0u) {
            k = -k;
         }
      } else {
         /* compute k = (-1)^((a1-1)*(p1-1)/4) * k */
         if ((a1.dp[0] & p1.dp[0] & 2u) != 0u) {
            k = -k;
         }
      }

      if ((e = mp_copy(&a1, &r)) != MP_OKAY) {
         goto LBL_KRON;
      }
      r.sign = MP_ZPOS;
      if ((e = mp_mod(&p1, &r, &a1)) != MP_OKAY) {
         goto LBL_KRON;
      }
      if ((e = mp_copy(&r, &p1)) != MP_OKAY) {
         goto LBL_KRON;
      }
   }

LBL_KRON:
   mp_clear(&r);
LBL_KRON_1:
   mp_clear(&p1);
LBL_KRON_0:
   mp_clear(&a1);

   return e;
}

#endif

/* ref:         $Format:%D$ */
/* git commit:  $Format:%H$ */
/* commit time: $Format:%ai$ */
Changes to libtommath/bn_mp_lcm.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_LCM_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* computes least common multiple as |a*b|/(a, b) */
int mp_lcm(const mp_int *a, const mp_int *b, mp_int *c)
{
   int     res;
   mp_int  t1, t2;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_LCM_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* computes least common multiple as |a*b|/(a, b) */
int mp_lcm(const mp_int *a, const mp_int *b, mp_int *c)
{
   int     res;
   mp_int  t1, t2;
Changes to libtommath/bn_mp_lshd.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_LSHD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* shift left a certain amount of digits */
int mp_lshd(mp_int *a, int b)
{
   int     x, res;












|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_LSHD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* shift left a certain amount of digits */
int mp_lshd(mp_int *a, int b)
{
   int     x, res;

Changes to libtommath/bn_mp_mod.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_MOD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* c = a mod b, 0 <= c < b if b > 0, b < c <= 0 if b < 0 */
int mp_mod(const mp_int *a, const mp_int *b, mp_int *c)
{
   mp_int  t;
   int     res;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_MOD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* c = a mod b, 0 <= c < b if b > 0, b < c <= 0 if b < 0 */
int mp_mod(const mp_int *a, const mp_int *b, mp_int *c)
{
   mp_int  t;
   int     res;
Changes to libtommath/bn_mp_mod_2d.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_MOD_2D_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* calc a value mod 2**b */
int mp_mod_2d(const mp_int *a, int b, mp_int *c)
{
   int     x, res;












|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_MOD_2D_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* calc a value mod 2**b */
int mp_mod_2d(const mp_int *a, int b, mp_int *c)
{
   int     x, res;

Changes to libtommath/bn_mp_mod_d.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_MOD_D_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

int mp_mod_d(const mp_int *a, mp_digit b, mp_digit *c)
{
   return mp_div_d(a, b, NULL, c);
}
#endif











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_MOD_D_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

int mp_mod_d(const mp_int *a, mp_digit b, mp_digit *c)
{
   return mp_div_d(a, b, NULL, c);
}
#endif
Changes to libtommath/bn_mp_montgomery_calc_normalization.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_MONTGOMERY_CALC_NORMALIZATION_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/*
 * shifts with subtractions when the result is greater than b.
 *
 * The method is slightly modified to shift B unconditionally upto just under
 * the leading bit of b.  This saves alot of multiple precision shifting.











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_MONTGOMERY_CALC_NORMALIZATION_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/*
 * shifts with subtractions when the result is greater than b.
 *
 * The method is slightly modified to shift B unconditionally upto just under
 * the leading bit of b.  This saves alot of multiple precision shifting.
Changes to libtommath/bn_mp_montgomery_reduce.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_MONTGOMERY_REDUCE_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* computes xR**-1 == x (mod N) via Montgomery Reduction */
int mp_montgomery_reduce(mp_int *x, const mp_int *n, mp_digit rho)
{
   int     ix, res, digs;
   mp_digit mu;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_MONTGOMERY_REDUCE_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* computes xR**-1 == x (mod N) via Montgomery Reduction */
int mp_montgomery_reduce(mp_int *x, const mp_int *n, mp_digit rho)
{
   int     ix, res, digs;
   mp_digit mu;
Changes to libtommath/bn_mp_montgomery_setup.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_MONTGOMERY_SETUP_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* setups the montgomery reduction stuff */
int mp_montgomery_setup(const mp_int *n, mp_digit *rho)
{
   mp_digit x, b;












|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_MONTGOMERY_SETUP_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* setups the montgomery reduction stuff */
int mp_montgomery_setup(const mp_int *n, mp_digit *rho)
{
   mp_digit x, b;

Changes to libtommath/bn_mp_mul.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_MUL_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* high level multiplication (handles sign) */
int mp_mul(const mp_int *a, const mp_int *b, mp_int *c)
{
   int     res, neg;
   neg = (a->sign == b->sign) ? MP_ZPOS : MP_NEG;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_MUL_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* high level multiplication (handles sign) */
int mp_mul(const mp_int *a, const mp_int *b, mp_int *c)
{
   int     res, neg;
   neg = (a->sign == b->sign) ? MP_ZPOS : MP_NEG;
Changes to libtommath/bn_mp_mul_2.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_MUL_2_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* b = a*2 */
int mp_mul_2(const mp_int *a, mp_int *b)
{
   int     x, res, oldused;












|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_MUL_2_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* b = a*2 */
int mp_mul_2(const mp_int *a, mp_int *b)
{
   int     x, res, oldused;

Changes to libtommath/bn_mp_mul_2d.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_MUL_2D_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* shift left by a certain bit count */
int mp_mul_2d(const mp_int *a, int b, mp_int *c)
{
   mp_digit d;
   int      res;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_MUL_2D_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* shift left by a certain bit count */
int mp_mul_2d(const mp_int *a, int b, mp_int *c)
{
   mp_digit d;
   int      res;
Changes to libtommath/bn_mp_mul_d.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_MUL_D_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* multiply by a digit */
int mp_mul_d(const mp_int *a, mp_digit b, mp_int *c)
{
   mp_digit u, *tmpa, *tmpc;
   mp_word  r;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_MUL_D_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* multiply by a digit */
int mp_mul_d(const mp_int *a, mp_digit b, mp_int *c)
{
   mp_digit u, *tmpa, *tmpc;
   mp_word  r;
Changes to libtommath/bn_mp_mulmod.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_MULMOD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* d = a * b (mod c) */
int mp_mulmod(const mp_int *a, const mp_int *b, const mp_int *c, mp_int *d)
{
   int     res;
   mp_int  t;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_MULMOD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* d = a * b (mod c) */
int mp_mulmod(const mp_int *a, const mp_int *b, const mp_int *c, mp_int *d)
{
   int     res;
   mp_int  t;
Changes to libtommath/bn_mp_n_root.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_N_ROOT_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* wrapper function for mp_n_root_ex()
 * computes c = (a)**(1/b) such that (c)**b <= a and (c+1)**b > a
 */
int mp_n_root(const mp_int *a, mp_digit b, mp_int *c)
{











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_N_ROOT_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* wrapper function for mp_n_root_ex()
 * computes c = (a)**(1/b) such that (c)**b <= a and (c+1)**b > a
 */
int mp_n_root(const mp_int *a, mp_digit b, mp_int *c)
{
Changes to libtommath/bn_mp_n_root_ex.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_N_ROOT_EX_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* find the n'th root of an integer
 *
 * Result found such that (c)**b <= a and (c+1)**b > a
 *
 * This algorithm uses Newton's approximation











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_N_ROOT_EX_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* find the n'th root of an integer
 *
 * Result found such that (c)**b <= a and (c+1)**b > a
 *
 * This algorithm uses Newton's approximation
Changes to libtommath/bn_mp_neg.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_NEG_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* b = -a */
int mp_neg(const mp_int *a, mp_int *b)
{
   int     res;
   if (a != b) {











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_NEG_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* b = -a */
int mp_neg(const mp_int *a, mp_int *b)
{
   int     res;
   if (a != b) {
Changes to libtommath/bn_mp_or.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_OR_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* OR two ints together */
int mp_or(const mp_int *a, const mp_int *b, mp_int *c)
{
   int     res, ix, px;
   mp_int  t;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_OR_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* OR two ints together */
int mp_or(const mp_int *a, const mp_int *b, mp_int *c)
{
   int     res, ix, px;
   mp_int  t;
Changes to libtommath/bn_mp_prime_fermat.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_PRIME_FERMAT_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* performs one Fermat test.
 *
 * If "a" were prime then b**a == b (mod a) since the order of
 * the multiplicative sub-group would be phi(a) = a-1.  That means
 * it would be the same as b**(a mod (a-1)) == b**1 == b (mod a).











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_PRIME_FERMAT_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* performs one Fermat test.
 *
 * If "a" were prime then b**a == b (mod a) since the order of
 * the multiplicative sub-group would be phi(a) = a-1.  That means
 * it would be the same as b**(a mod (a-1)) == b**1 == b (mod a).
Added libtommath/bn_mp_prime_frobenius_underwood.c.












































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
#include "tommath_private.h"
#ifdef BN_MP_PRIME_FROBENIUS_UNDERWOOD_C

/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense
 */

/*
 *  See file bn_mp_prime_is_prime.c or the documentation in doc/bn.tex for the details
 */
#ifndef LTM_USE_FIPS_ONLY

#ifdef MP_8BIT
/*
 * floor of positive solution of
 * (2^16)-1 = (a+4)*(2*a+5)
 * TODO: Both values are smaller than N^(1/4), would have to use a bigint
 *       for a instead but any a biger than about 120 are already so rare that
 *       it is possible to ignore them and still get enough pseudoprimes.
 *       But it is still a restriction of the set of available pseudoprimes
 *       which makes this implementation less secure if used stand-alone.
 */
#define LTM_FROBENIUS_UNDERWOOD_A 177
#else
#define LTM_FROBENIUS_UNDERWOOD_A 32764
#endif
int mp_prime_frobenius_underwood(const mp_int *N, int *result)
{
   mp_int T1z, T2z, Np1z, sz, tz;

   int a, ap2, length, i, j, isset;
   int e;

   *result = MP_NO;

   if ((e = mp_init_multi(&T1z, &T2z, &Np1z, &sz, &tz, NULL)) != MP_OKAY) {
      return e;
   }

   for (a = 0; a < LTM_FROBENIUS_UNDERWOOD_A; a++) {
      /* TODO: That's ugly! No, really, it is! */
      if ((a==2) || (a==4) || (a==7) || (a==8) || (a==10) ||
          (a==14) || (a==18) || (a==23) || (a==26) || (a==28)) {
         continue;
      }
      /* (32764^2 - 4) < 2^31, no bigint for >MP_8BIT needed) */
      if ((e = mp_set_long(&T1z, (unsigned long)a)) != MP_OKAY) {
         goto LBL_FU_ERR;
      }

      if ((e = mp_sqr(&T1z, &T1z)) != MP_OKAY) {
         goto LBL_FU_ERR;
      }

      if ((e = mp_sub_d(&T1z, 4uL, &T1z)) != MP_OKAY) {
         goto LBL_FU_ERR;
      }

      if ((e = mp_kronecker(&T1z, N, &j)) != MP_OKAY) {
         goto LBL_FU_ERR;
      }

      if (j == -1) {
         break;
      }

      if (j == 0) {
         /* composite */
         goto LBL_FU_ERR;
      }
   }
   /* Tell it a composite and set return value accordingly */
   if (a >= LTM_FROBENIUS_UNDERWOOD_A) {
      e = MP_ITER;
      goto LBL_FU_ERR;
   }
   /* Composite if N and (a+4)*(2*a+5) are not coprime */
   if ((e = mp_set_long(&T1z, (unsigned long)((a+4)*((2*a)+5)))) != MP_OKAY) {
      goto LBL_FU_ERR;
   }

   if ((e = mp_gcd(N, &T1z, &T1z)) != MP_OKAY) {
      goto LBL_FU_ERR;
   }

   if (!((T1z.used == 1) && (T1z.dp[0] == 1u))) {
      goto LBL_FU_ERR;
   }

   ap2 = a + 2;
   if ((e = mp_add_d(N, 1uL, &Np1z)) != MP_OKAY) {
      goto LBL_FU_ERR;
   }

   mp_set(&sz, 1uL);
   mp_set(&tz, 2uL);
   length = mp_count_bits(&Np1z);

   for (i = length - 2; i >= 0; i--) {
      /*
       * temp = (sz*(a*sz+2*tz))%N;
       * tz   = ((tz-sz)*(tz+sz))%N;
       * sz   = temp;
       */
      if ((e = mp_mul_2(&tz, &T2z)) != MP_OKAY) {
         goto LBL_FU_ERR;
      }

      /* a = 0 at about 50% of the cases (non-square and odd input) */
      if (a != 0) {
         if ((e = mp_mul_d(&sz, (mp_digit)a, &T1z)) != MP_OKAY) {
            goto LBL_FU_ERR;
         }
         if ((e = mp_add(&T1z, &T2z, &T2z)) != MP_OKAY) {
            goto LBL_FU_ERR;
         }
      }

      if ((e = mp_mul(&T2z, &sz, &T1z)) != MP_OKAY) {
         goto LBL_FU_ERR;
      }
      if ((e = mp_sub(&tz, &sz, &T2z)) != MP_OKAY) {
         goto LBL_FU_ERR;
      }
      if ((e = mp_add(&sz, &tz, &sz)) != MP_OKAY) {
         goto LBL_FU_ERR;
      }
      if ((e = mp_mul(&sz, &T2z, &tz)) != MP_OKAY) {
         goto LBL_FU_ERR;
      }
      if ((e = mp_mod(&tz, N, &tz)) != MP_OKAY) {
         goto LBL_FU_ERR;
      }
      if ((e = mp_mod(&T1z, N, &sz)) != MP_OKAY) {
         goto LBL_FU_ERR;
      }
      if ((isset = mp_get_bit(&Np1z, i)) == MP_VAL) {
         e = isset;
         goto LBL_FU_ERR;
      }
      if (isset == MP_YES) {
         /*
          *  temp = (a+2) * sz + tz
          *  tz   = 2 * tz - sz
          *  sz   = temp
          */
         if (a == 0) {
            if ((e = mp_mul_2(&sz, &T1z)) != MP_OKAY) {
               goto LBL_FU_ERR;
            }
         } else {
            if ((e = mp_mul_d(&sz, (mp_digit)ap2, &T1z)) != MP_OKAY) {
               goto LBL_FU_ERR;
            }
         }
         if ((e = mp_add(&T1z, &tz, &T1z)) != MP_OKAY) {
            goto LBL_FU_ERR;
         }
         if ((e = mp_mul_2(&tz, &T2z)) != MP_OKAY) {
            goto LBL_FU_ERR;
         }
         if ((e = mp_sub(&T2z, &sz, &tz)) != MP_OKAY) {
            goto LBL_FU_ERR;
         }
         mp_exch(&sz, &T1z);
      }
   }

   if ((e = mp_set_long(&T1z, (unsigned long)((2 * a) + 5))) != MP_OKAY) {
      goto LBL_FU_ERR;
   }
   if ((e = mp_mod(&T1z, N, &T1z)) != MP_OKAY) {
      goto LBL_FU_ERR;
   }
   if ((mp_iszero(&sz) != MP_NO) && (mp_cmp(&tz, &T1z) == MP_EQ)) {
      *result = MP_YES;
      goto LBL_FU_ERR;
   }

LBL_FU_ERR:
   mp_clear_multi(&tz, &sz, &Np1z, &T2z, &T1z, NULL);
   return e;
}

#endif
#endif

/* ref:         $Format:%D$ */
/* git commit:  $Format:%H$ */
/* commit time: $Format:%ai$ */
Changes to libtommath/bn_mp_prime_is_divisible.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_PRIME_IS_DIVISIBLE_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* determines if an integers is divisible by one
 * of the first PRIME_SIZE primes or not
 *
 * sets result to 0 if not, 1 if yes
 */











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_PRIME_IS_DIVISIBLE_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* determines if an integers is divisible by one
 * of the first PRIME_SIZE primes or not
 *
 * sets result to 0 if not, 1 if yes
 */
Changes to libtommath/bn_mp_prime_is_prime.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

16
17

18


19


20
21
22
23
24
25
26

27
28
29
30
31
32
33
34

























35
36
37
38
39
40
41
42






43
44
45
46
47
48
49
50
51
52
53

54

55
56
57
58
59
60
61

62









63
64
65


66

























67
68
69























































































































































































































70
71
72
73
74
75
76
77

78
79
80
81
82
#include "tommath_private.h"
#ifdef BN_MP_PRIME_IS_PRIME_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */


/* performs a variable number of rounds of Miller-Rabin
 *

 * Probability of error after t rounds is no more than





 *
 * Sets result to 1 if probably prime, 0 otherwise
 */
int mp_prime_is_prime(const mp_int *a, int t, int *result)
{
   mp_int  b;
   int     ix, err, res;


   /* default to no */
   *result = MP_NO;

   /* valid value of t? */
   if ((t <= 0) || (t > PRIME_SIZE)) {
      return MP_VAL;
   }


























   /* is the input equal to one of the primes in the table? */
   for (ix = 0; ix < PRIME_SIZE; ix++) {
      if (mp_cmp_d(a, ltm_prime_tab[ix]) == MP_EQ) {
         *result = 1;
         return MP_OKAY;
      }
   }







   /* first perform trial division */
   if ((err = mp_prime_is_divisible(a, &res)) != MP_OKAY) {
      return err;
   }

   /* return if it was trivially divisible */
   if (res == MP_YES) {
      return MP_OKAY;
   }


   /* now perform the miller-rabin rounds */

   if ((err = mp_init(&b)) != MP_OKAY) {
      return err;
   }

   for (ix = 0; ix < t; ix++) {
      /* set the prime */
      mp_set(&b, ltm_prime_tab[ix]);











      if ((err = mp_prime_miller_rabin(a, &b, &res)) != MP_OKAY) {
         goto LBL_B;
      }




























      if (res == MP_NO) {
         goto LBL_B;
      }























































































































































































































   }

   /* passed the test */
   *result = MP_YES;
LBL_B:
   mp_clear(&b);
   return err;
}

#endif

/* ref:         $Format:%D$ */
/* git commit:  $Format:%H$ */
/* commit time: $Format:%ai$ */











|
<


>
|
<
>
|
>
>
|
>
>
|
|
<



|
>





|


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>




|



>
>
>
>
>
>











>
|
>
|



<
<
|
>
|
>
>
>
>
>
>
>
>
>
|
|
|
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>








>





1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16

17
18
19
20
21
22
23
24
25

26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
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
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
#include "tommath_private.h"
#ifdef BN_MP_PRIME_IS_PRIME_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* portable integer log of two with small footprint */
static unsigned int s_floor_ilog2(int value)

{
   unsigned int r = 0;
   while ((value >>= 1) != 0) {
      r++;
   }
   return r;
}



int mp_prime_is_prime(const mp_int *a, int t, int *result)
{
   mp_int  b;
   int     ix, err, res, p_max = 0, size_a, len;
   unsigned int fips_rand, mask;

   /* default to no */
   *result = MP_NO;

   /* valid value of t? */
   if (t > PRIME_SIZE) {
      return MP_VAL;
   }

   /* Some shortcuts */
   /* N > 3 */
   if (a->used == 1) {
      if ((a->dp[0] == 0u) || (a->dp[0] == 1u)) {
         *result = 0;
         return MP_OKAY;
      }
      if (a->dp[0] == 2u) {
         *result = 1;
         return MP_OKAY;
      }
   }

   /* N must be odd */
   if (mp_iseven(a) == MP_YES) {
      return MP_OKAY;
   }
   /* N is not a perfect square: floor(sqrt(N))^2 != N */
   if ((err = mp_is_square(a, &res)) != MP_OKAY) {
      return err;
   }
   if (res != 0) {
      return MP_OKAY;
   }

   /* is the input equal to one of the primes in the table? */
   for (ix = 0; ix < PRIME_SIZE; ix++) {
      if (mp_cmp_d(a, ltm_prime_tab[ix]) == MP_EQ) {
         *result = MP_YES;
         return MP_OKAY;
      }
   }
#ifdef MP_8BIT
   /* The search in the loop above was exhaustive in this case */
   if ((a->used == 1) && (PRIME_SIZE >= 31)) {
      return MP_OKAY;
   }
#endif

   /* first perform trial division */
   if ((err = mp_prime_is_divisible(a, &res)) != MP_OKAY) {
      return err;
   }

   /* return if it was trivially divisible */
   if (res == MP_YES) {
      return MP_OKAY;
   }

   /*
       Run the Miller-Rabin test with base 2 for the BPSW test.
    */
   if ((err = mp_init_set(&b, 2uL)) != MP_OKAY) {
      return err;
   }



   if ((err = mp_prime_miller_rabin(a, &b, &res)) != MP_OKAY) {
      goto LBL_B;
   }
   if (res == MP_NO) {
      goto LBL_B;
   }
   /*
      Rumours have it that Mathematica does a second M-R test with base 3.
      Other rumours have it that their strong L-S test is slightly different.
      It does not hurt, though, beside a bit of extra runtime.
   */
   b.dp[0]++;
   if ((err = mp_prime_miller_rabin(a, &b, &res)) != MP_OKAY) {
      goto LBL_B;
   }
   if (res == MP_NO) {
      goto LBL_B;
   }

   /*
    * Both, the Frobenius-Underwood test and the the Lucas-Selfridge test are quite
    * slow so if speed is an issue, define LTM_USE_FIPS_ONLY to use M-R tests with
    * bases 2, 3 and t random bases.
    */
#ifndef LTM_USE_FIPS_ONLY
   if (t >= 0) {
      /*
       * Use a Frobenius-Underwood test instead of the Lucas-Selfridge test for
       * MP_8BIT (It is unknown if the Lucas-Selfridge test works with 16-bit
       * integers but the necesssary analysis is on the todo-list).
       */
#if defined (MP_8BIT) || defined (LTM_USE_FROBENIUS_TEST)
      err = mp_prime_frobenius_underwood(a, &res);
      if ((err != MP_OKAY) && (err != MP_ITER)) {
         goto LBL_B;
      }
      if (res == MP_NO) {
         goto LBL_B;
      }
#else
      if ((err = mp_prime_strong_lucas_selfridge(a, &res)) != MP_OKAY) {
         goto LBL_B;
      }
      if (res == MP_NO) {
         goto LBL_B;
      }
#endif
   }
#endif

   /* run at least one Miller-Rabin test with a random base */
   if (t == 0) {
      t = 1;
   }

   /*
      abs(t) extra rounds of M-R to extend the range of primes it can find if t < 0.
      Only recommended if the input range is known to be < 3317044064679887385961981

      It uses the bases for a deterministic M-R test if input < 3317044064679887385961981
      The caller has to check the size.

      Not for cryptographic use because with known bases strong M-R pseudoprimes can
      be constructed. Use at least one M-R test with a random base (t >= 1).

      The 1119 bit large number

      80383745745363949125707961434194210813883768828755814583748891752229742737653\
      33652186502336163960045457915042023603208766569966760987284043965408232928738\
      79185086916685732826776177102938969773947016708230428687109997439976544144845\
      34115587245063340927902227529622941498423068816854043264575340183297861112989\
      60644845216191652872597534901

      has been constructed by F. Arnault (F. Arnault, "Rabin-Miller primality test:
      composite numbers which pass it.",  Mathematics of Computation, 1995, 64. Jg.,
      Nr. 209, S. 355-361), is a semiprime with the two factors

      40095821663949960541830645208454685300518816604113250877450620473800321707011\
      96242716223191597219733582163165085358166969145233813917169287527980445796800\
      452592031836601

      20047910831974980270915322604227342650259408302056625438725310236900160853505\
      98121358111595798609866791081582542679083484572616906958584643763990222898400\
      226296015918301

      and it is a strong pseudoprime to all forty-six prime M-R bases up to 200

      It does not fail the strong Bailley-PSP test as implemented here, it is just
      given as an example, if not the reason to use the BPSW-test instead of M-R-tests
      with a sequence of primes 2...n.

   */
   if (t < 0) {
      t = -t;
      /*
          Sorenson, Jonathan; Webster, Jonathan (2015).
           "Strong Pseudoprimes to Twelve Prime Bases".
       */
      /* 0x437ae92817f9fc85b7e5 = 318665857834031151167461 */
      if ((err =   mp_read_radix(&b, "437ae92817f9fc85b7e5", 16)) != MP_OKAY) {
         goto LBL_B;
      }

      if (mp_cmp(a, &b) == MP_LT) {
         p_max = 12;
      } else {
         /* 0x2be6951adc5b22410a5fd = 3317044064679887385961981 */
         if ((err = mp_read_radix(&b, "2be6951adc5b22410a5fd", 16)) != MP_OKAY) {
            goto LBL_B;
         }

         if (mp_cmp(a, &b) == MP_LT) {
            p_max = 13;
         } else {
            err = MP_VAL;
            goto LBL_B;
         }
      }

      /* for compatibility with the current API (well, compatible within a sign's width) */
      if (p_max < t) {
         p_max = t;
      }

      if (p_max > PRIME_SIZE) {
         err = MP_VAL;
         goto LBL_B;
      }
      /* we did bases 2 and 3  already, skip them */
      for (ix = 2; ix < p_max; ix++) {
         mp_set(&b, ltm_prime_tab[ix]);
         if ((err = mp_prime_miller_rabin(a, &b, &res)) != MP_OKAY) {
            goto LBL_B;
         }
         if (res == MP_NO) {
            goto LBL_B;
         }
      }
   }
   /*
       Do "t" M-R tests with random bases between 3 and "a".
       See Fips 186.4 p. 126ff
   */
   else if (t > 0) {
      /*
       * The mp_digit's have a defined bit-size but the size of the
       * array a.dp is a simple 'int' and this library can not assume full
       * compliance to the current C-standard (ISO/IEC 9899:2011) because
       * it gets used for small embeded processors, too. Some of those MCUs
       * have compilers that one cannot call standard compliant by any means.
       * Hence the ugly type-fiddling in the following code.
       */
      size_a = mp_count_bits(a);
      mask = (1u << s_floor_ilog2(size_a)) - 1u;
      /*
         Assuming the General Rieman hypothesis (never thought to write that in a
         comment) the upper bound can be lowered to  2*(log a)^2.
         E. Bach, "Explicit bounds for primality testing and related problems,"
         Math. Comp. 55 (1990), 355-380.

            size_a = (size_a/10) * 7;
            len = 2 * (size_a * size_a);

         E.g.: a number of size 2^2048 would be reduced to the upper limit

            floor(2048/10)*7 = 1428
            2 * 1428^2       = 4078368

         (would have been ~4030331.9962 with floats and natural log instead)
         That number is smaller than 2^28, the default bit-size of mp_digit.
      */

      /*
        How many tests, you might ask? Dana Jacobsen of Math::Prime::Util fame
        does exactly 1. In words: one. Look at the end of _GMP_is_prime() in
        Math-Prime-Util-GMP-0.50/primality.c if you do not believe it.

        The function mp_rand() goes to some length to use a cryptographically
        good PRNG. That also means that the chance to always get the same base
        in the loop is non-zero, although very low.
        If the BPSW test and/or the addtional Frobenious test have been
        performed instead of just the Miller-Rabin test with the bases 2 and 3,
        a single extra test should suffice, so such a very unlikely event
        will not do much harm.

        To preemptivly answer the dangling question: no, a witness does not
        need to be prime.
      */
      for (ix = 0; ix < t; ix++) {
         /* mp_rand() guarantees the first digit to be non-zero */
         if ((err = mp_rand(&b, 1)) != MP_OKAY) {
            goto LBL_B;
         }
         /*
          * Reduce digit before casting because mp_digit might be bigger than
          * an unsigned int and "mask" on the other side is most probably not.
          */
         fips_rand = (unsigned int)(b.dp[0] & (mp_digit) mask);
#ifdef MP_8BIT
         /*
          * One 8-bit digit is too small, so concatenate two if the size of
          * unsigned int allows for it.
          */
         if (((sizeof(unsigned int) * CHAR_BIT)/2) >= (sizeof(mp_digit) * CHAR_BIT)) {
            if ((err = mp_rand(&b, 1)) != MP_OKAY) {
               goto LBL_B;
            }
            fips_rand <<= sizeof(mp_digit) * CHAR_BIT;
            fips_rand |= (unsigned int) b.dp[0];
            fips_rand &= mask;
         }
#endif
         if (fips_rand > (unsigned int)(INT_MAX - DIGIT_BIT)) {
            len = INT_MAX / DIGIT_BIT;
         } else {
            len = (((int)fips_rand + DIGIT_BIT) / DIGIT_BIT);
         }
         /*  Unlikely. */
         if (len < 0) {
            ix--;
            continue;
         }
         /*
          * As mentioned above, one 8-bit digit is too small and
          * although it can only happen in the unlikely case that
          * an "unsigned int" is smaller than 16 bit a simple test
          * is cheap and the correction even cheaper.
          */
#ifdef MP_8BIT
         /* All "a" < 2^8 have been caught before */
         if (len == 1) {
            len++;
         }
#endif
         if ((err = mp_rand(&b, len)) != MP_OKAY) {
            goto LBL_B;
         }
         /*
          * That number might got too big and the witness has to be
          * smaller than or equal to "a"
          */
         len = mp_count_bits(&b);
         if (len > size_a) {
            len = len - size_a;
            if ((err = mp_div_2d(&b, len, &b, NULL)) != MP_OKAY) {
               goto LBL_B;
            }
         }

         /* Although the chance for b <= 3 is miniscule, try again. */
         if (mp_cmp_d(&b, 3uL) != MP_GT) {
            ix--;
            continue;
         }
         if ((err = mp_prime_miller_rabin(a, &b, &res)) != MP_OKAY) {
            goto LBL_B;
         }
         if (res == MP_NO) {
            goto LBL_B;
         }
      }
   }

   /* passed the test */
   *result = MP_YES;
LBL_B:
   mp_clear(&b);
   return err;
}

#endif

/* ref:         $Format:%D$ */
/* git commit:  $Format:%H$ */
/* commit time: $Format:%ai$ */
Changes to libtommath/bn_mp_prime_miller_rabin.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_PRIME_MILLER_RABIN_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* Miller-Rabin test of "a" to the base of "b" as described in
 * HAC pp. 139 Algorithm 4.24
 *
 * Sets result to 0 if definitely composite or 1 if probably prime.
 * Randomly the chance of error is no more than 1/4 and often











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_PRIME_MILLER_RABIN_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* Miller-Rabin test of "a" to the base of "b" as described in
 * HAC pp. 139 Algorithm 4.24
 *
 * Sets result to 0 if definitely composite or 1 if probably prime.
 * Randomly the chance of error is no more than 1/4 and often
Changes to libtommath/bn_mp_prime_next_prime.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "tommath_private.h"
#ifdef BN_MP_PRIME_NEXT_PRIME_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* finds the next prime after the number "a" using "t" trials
 * of Miller-Rabin.
 *
 * bbs_style = 1 means the prime must be congruent to 3 mod 4
 */
int mp_prime_next_prime(mp_int *a, int t, int bbs_style)
{
   int      err, res = MP_NO, x, y;
   mp_digit res_tab[PRIME_SIZE], step, kstep;
   mp_int   b;

   /* ensure t is valid */
   if ((t <= 0) || (t > PRIME_SIZE)) {
      return MP_VAL;
   }

   /* force positive */
   a->sign = MP_ZPOS;

   /* simple algo if a is less than the largest prime in the table */
   if (mp_cmp_d(a, ltm_prime_tab[PRIME_SIZE-1]) == MP_LT) {
      /* find which prime it is bigger than */
      for (x = PRIME_SIZE - 2; x >= 0; x--) {











|
<













<
<
<
<
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
20
21
22
23
24
25





26
27
28
29
30
31
32
#include "tommath_private.h"
#ifdef BN_MP_PRIME_NEXT_PRIME_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* finds the next prime after the number "a" using "t" trials
 * of Miller-Rabin.
 *
 * bbs_style = 1 means the prime must be congruent to 3 mod 4
 */
int mp_prime_next_prime(mp_int *a, int t, int bbs_style)
{
   int      err, res = MP_NO, x, y;
   mp_digit res_tab[PRIME_SIZE], step, kstep;
   mp_int   b;






   /* force positive */
   a->sign = MP_ZPOS;

   /* simple algo if a is less than the largest prime in the table */
   if (mp_cmp_d(a, ltm_prime_tab[PRIME_SIZE-1]) == MP_LT) {
      /* find which prime it is bigger than */
      for (x = PRIME_SIZE - 2; x >= 0; x--) {
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
      }

      /* if didn't pass sieve and step == MAX then skip test */
      if ((y == 1) && (step >= (((mp_digit)1 << DIGIT_BIT) - kstep))) {
         continue;
      }

      /* is this prime? */
      for (x = 0; x < t; x++) {
         mp_set(&b, ltm_prime_tab[x]);
         if ((err = mp_prime_miller_rabin(a, &b, &res)) != MP_OKAY) {
            goto LBL_ERR;
         }
         if (res == MP_NO) {
            break;
         }
      }

      if (res == MP_YES) {
         break;
      }
   }

   err = MP_OKAY;
LBL_ERR:







<
<
<
|
|
|
<
<
<
<
<







131
132
133
134
135
136
137



138
139
140





141
142
143
144
145
146
147
      }

      /* if didn't pass sieve and step == MAX then skip test */
      if ((y == 1) && (step >= (((mp_digit)1 << DIGIT_BIT) - kstep))) {
         continue;
      }




      if ((err = mp_prime_is_prime(a, t, &res)) != MP_OKAY) {
         goto LBL_ERR;
      }





      if (res == MP_YES) {
         break;
      }
   }

   err = MP_OKAY;
LBL_ERR:
Changes to libtommath/bn_mp_prime_rabin_miller_trials.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19



20


21
22
23
24
25
26
27


28
29
30
31
32
33
34
35
36
37
#include "tommath_private.h"
#ifdef BN_MP_PRIME_RABIN_MILLER_TRIALS_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */


static const struct {
   int k, t;
} sizes[] = {



   {   128,    28 },


   {   256,    16 },
   {   384,    10 },
   {   512,     7 },
   {   640,     6 },
   {   768,     5 },
   {   896,     4 },
   {  1024,     4 }


};

/* returns # of RM trials required for a given bit size */
int mp_prime_rabin_miller_trials(int size)
{
   int x;

   for (x = 0; x < (int)(sizeof(sizes)/(sizeof(sizes[0]))); x++) {
      if (sizes[x].k == size) {
         return sizes[x].t;











|
<






>
>
>
|
>
>






|
>
>


|







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include "tommath_private.h"
#ifdef BN_MP_PRIME_RABIN_MILLER_TRIALS_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */


static const struct {
   int k, t;
} sizes[] = {
   {    80,    -1 }, /* Use deterministic algorithm for size <= 80 bits */
   {    81,    39 },
   {    96,    37 },
   {   128,    32 },
   {   160,    27 },
   {   192,    21 },
   {   256,    16 },
   {   384,    10 },
   {   512,     7 },
   {   640,     6 },
   {   768,     5 },
   {   896,     4 },
   {  1024,     4 },
   {  2048,     2 },
   {  4096,     1 },
};

/* returns # of RM trials required for a given bit size and max. error of 2^(-96)*/
int mp_prime_rabin_miller_trials(int size)
{
   int x;

   for (x = 0; x < (int)(sizeof(sizes)/(sizeof(sizes[0]))); x++) {
      if (sizes[x].k == size) {
         return sizes[x].t;
Changes to libtommath/bn_mp_prime_random_ex.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_PRIME_RANDOM_EX_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* makes a truly random prime of a given size (bits),
 *
 * Flags are as follows:
 *
 *   LTM_PRIME_BBS      - make prime congruent to 3 mod 4











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_PRIME_RANDOM_EX_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* makes a truly random prime of a given size (bits),
 *
 * Flags are as follows:
 *
 *   LTM_PRIME_BBS      - make prime congruent to 3 mod 4
Added libtommath/bn_mp_prime_strong_lucas_selfridge.c.






















































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
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
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
#include "tommath_private.h"
#ifdef BN_MP_PRIME_STRONG_LUCAS_SELFRIDGE_C

/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense
 */

/*
 *  See file bn_mp_prime_is_prime.c or the documentation in doc/bn.tex for the details
 */
#ifndef LTM_USE_FIPS_ONLY

/*
 *  8-bit is just too small. You can try the Frobenius test
 *  but that frobenius test can fail, too, for the same reason.
 */
#ifndef MP_8BIT

/*
 * multiply bigint a with int d and put the result in c
 * Like mp_mul_d() but with a signed long as the small input
 */
static int s_mp_mul_si(const mp_int *a, long d, mp_int *c)
{
   mp_int t;
   int err, neg = 0;

   if ((err = mp_init(&t)) != MP_OKAY) {
      return err;
   }
   if (d < 0) {
      neg = 1;
      d = -d;
   }

   /*
    * mp_digit might be smaller than a long, which excludes
    * the use of mp_mul_d() here.
    */
   if ((err = mp_set_long(&t, (unsigned long) d)) != MP_OKAY) {
      goto LBL_MPMULSI_ERR;
   }
   if ((err = mp_mul(a, &t, c)) != MP_OKAY) {
      goto LBL_MPMULSI_ERR;
   }
   if (neg ==  1) {
      c->sign = (a->sign == MP_NEG) ? MP_ZPOS: MP_NEG;
   }
LBL_MPMULSI_ERR:
   mp_clear(&t);
   return err;
}
/*
    Strong Lucas-Selfridge test.
    returns MP_YES if it is a strong L-S prime, MP_NO if it is composite

    Code ported from  Thomas Ray Nicely's implementation of the BPSW test
    at http://www.trnicely.net/misc/bpsw.html

    Freeware copyright (C) 2016 Thomas R. Nicely <http://www.trnicely.net>.
    Released into the public domain by the author, who disclaims any legal
    liability arising from its use

    The multi-line comments are made by Thomas R. Nicely and are copied verbatim.
    Additional comments marked "CZ" (without the quotes) are by the code-portist.

    (If that name sounds familiar, he is the guy who found the fdiv bug in the
     Pentium (P5x, I think) Intel processor)
*/
int mp_prime_strong_lucas_selfridge(const mp_int *a, int *result)
{
   /* CZ TODO: choose better variable names! */
   mp_int Dz, gcd, Np1, Uz, Vz, U2mz, V2mz, Qmz, Q2mz, Qkdz, T1z, T2z, T3z, T4z, Q2kdz;
   /* CZ TODO: Some of them need the full 32 bit, hence the (temporary) exclusion of MP_8BIT */
   int32_t D, Ds, J, sign, P, Q, r, s, u, Nbits;
   int e;
   int isset, oddness;

   *result = MP_NO;
   /*
   Find the first element D in the sequence {5, -7, 9, -11, 13, ...}
   such that Jacobi(D,N) = -1 (Selfridge's algorithm). Theory
   indicates that, if N is not a perfect square, D will "nearly
   always" be "small." Just in case, an overflow trap for D is
   included.
   */

   if ((e = mp_init_multi(&Dz, &gcd, &Np1, &Uz, &Vz, &U2mz, &V2mz, &Qmz, &Q2mz, &Qkdz, &T1z, &T2z, &T3z, &T4z, &Q2kdz,
                          NULL)) != MP_OKAY) {
      return e;
   }

   D = 5;
   sign = 1;

   for (;;) {
      Ds   = sign * D;
      sign = -sign;
      if ((e = mp_set_long(&Dz, (unsigned long)D)) != MP_OKAY) {
         goto LBL_LS_ERR;
      }
      if ((e = mp_gcd(a, &Dz, &gcd)) != MP_OKAY) {
         goto LBL_LS_ERR;
      }
      /* if 1 < GCD < N then N is composite with factor "D", and
         Jacobi(D,N) is technically undefined (but often returned
         as zero). */
      if ((mp_cmp_d(&gcd, 1uL) == MP_GT) && (mp_cmp(&gcd, a) == MP_LT)) {
         goto LBL_LS_ERR;
      }
      if (Ds < 0) {
         Dz.sign = MP_NEG;
      }
      if ((e = mp_kronecker(&Dz, a, &J)) != MP_OKAY) {
         goto LBL_LS_ERR;
      }

      if (J == -1) {
         break;
      }
      D += 2;

      if (D > (INT_MAX - 2)) {
         e = MP_VAL;
         goto LBL_LS_ERR;
      }
   }



   P = 1;              /* Selfridge's choice */
   Q = (1 - Ds) / 4;   /* Required so D = P*P - 4*Q */

   /* NOTE: The conditions (a) N does not divide Q, and
      (b) D is square-free or not a perfect square, are included by
      some authors; e.g., "Prime numbers and computer methods for
      factorization," Hans Riesel (2nd ed., 1994, Birkhauser, Boston),
      p. 130. For this particular application of Lucas sequences,
      these conditions were found to be immaterial. */

   /* Now calculate N - Jacobi(D,N) = N + 1 (even), and calculate the
      odd positive integer d and positive integer s for which
      N + 1 = 2^s*d (similar to the step for N - 1 in Miller's test).
      The strong Lucas-Selfridge test then returns N as a strong
      Lucas probable prime (slprp) if any of the following
      conditions is met: U_d=0, V_d=0, V_2d=0, V_4d=0, V_8d=0,
      V_16d=0, ..., etc., ending with V_{2^(s-1)*d}=V_{(N+1)/2}=0
      (all equalities mod N). Thus d is the highest index of U that
      must be computed (since V_2m is independent of U), compared
      to U_{N+1} for the standard Lucas-Selfridge test; and no
      index of V beyond (N+1)/2 is required, just as in the
      standard Lucas-Selfridge test. However, the quantity Q^d must
      be computed for use (if necessary) in the latter stages of
      the test. The result is that the strong Lucas-Selfridge test
      has a running time only slightly greater (order of 10 %) than
      that of the standard Lucas-Selfridge test, while producing
      only (roughly) 30 % as many pseudoprimes (and every strong
      Lucas pseudoprime is also a standard Lucas pseudoprime). Thus
      the evidence indicates that the strong Lucas-Selfridge test is
      more effective than the standard Lucas-Selfridge test, and a
      Baillie-PSW test based on the strong Lucas-Selfridge test
      should be more reliable. */

   if ((e = mp_add_d(a, 1uL, &Np1)) != MP_OKAY) {
      goto LBL_LS_ERR;
   }
   s = mp_cnt_lsb(&Np1);

   /* CZ
    * This should round towards zero because
    * Thomas R. Nicely used GMP's mpz_tdiv_q_2exp()
    * and mp_div_2d() is equivalent. Additionally:
    * dividing an even number by two does not produce
    * any leftovers.
    */
   if ((e = mp_div_2d(&Np1, s, &Dz, NULL)) != MP_OKAY) {
      goto LBL_LS_ERR;
   }
   /* We must now compute U_d and V_d. Since d is odd, the accumulated
      values U and V are initialized to U_1 and V_1 (if the target
      index were even, U and V would be initialized instead to U_0=0
      and V_0=2). The values of U_2m and V_2m are also initialized to
      U_1 and V_1; the FOR loop calculates in succession U_2 and V_2,
      U_4 and V_4, U_8 and V_8, etc. If the corresponding bits
      (1, 2, 3, ...) of t are on (the zero bit having been accounted
      for in the initialization of U and V), these values are then
      combined with the previous totals for U and V, using the
      composition formulas for addition of indices. */

   mp_set(&Uz, 1uL);    /* U=U_1 */
   mp_set(&Vz, (mp_digit)P);    /* V=V_1 */
   mp_set(&U2mz, 1uL);  /* U_1 */
   mp_set(&V2mz, (mp_digit)P);  /* V_1 */

   if (Q < 0) {
      Q = -Q;
      if ((e = mp_set_long(&Qmz, (unsigned long)Q)) != MP_OKAY) {
         goto LBL_LS_ERR;
      }
      if ((e = mp_mul_2(&Qmz, &Q2mz)) != MP_OKAY) {
         goto LBL_LS_ERR;
      }
      /* Initializes calculation of Q^d */
      if ((e = mp_set_long(&Qkdz, (unsigned long)Q)) != MP_OKAY) {
         goto LBL_LS_ERR;
      }
      Qmz.sign = MP_NEG;
      Q2mz.sign = MP_NEG;
      Qkdz.sign = MP_NEG;
      Q = -Q;
   } else {
      if ((e = mp_set_long(&Qmz, (unsigned long)Q)) != MP_OKAY) {
         goto LBL_LS_ERR;
      }
      if ((e = mp_mul_2(&Qmz, &Q2mz)) != MP_OKAY) {
         goto LBL_LS_ERR;
      }
      /* Initializes calculation of Q^d */
      if ((e = mp_set_long(&Qkdz, (unsigned long)Q)) != MP_OKAY) {
         goto LBL_LS_ERR;
      }
   }

   Nbits = mp_count_bits(&Dz);

   for (u = 1; u < Nbits; u++) { /* zero bit off, already accounted for */
      /* Formulas for doubling of indices (carried out mod N). Note that
       * the indices denoted as "2m" are actually powers of 2, specifically
       * 2^(ul-1) beginning each loop and 2^ul ending each loop.
       *
       * U_2m = U_m*V_m
       * V_2m = V_m*V_m - 2*Q^m
       */

      if ((e = mp_mul(&U2mz, &V2mz, &U2mz)) != MP_OKAY) {
         goto LBL_LS_ERR;
      }
      if ((e = mp_mod(&U2mz, a, &U2mz)) != MP_OKAY) {
         goto LBL_LS_ERR;
      }
      if ((e = mp_sqr(&V2mz, &V2mz)) != MP_OKAY) {
         goto LBL_LS_ERR;
      }
      if ((e = mp_sub(&V2mz, &Q2mz, &V2mz)) != MP_OKAY) {
         goto LBL_LS_ERR;
      }
      if ((e = mp_mod(&V2mz, a, &V2mz)) != MP_OKAY) {
         goto LBL_LS_ERR;
      }
      /* Must calculate powers of Q for use in V_2m, also for Q^d later */
      if ((e = mp_sqr(&Qmz, &Qmz)) != MP_OKAY) {
         goto LBL_LS_ERR;
      }
      /* prevents overflow */ /* CZ  still necessary without a fixed prealloc'd mem.? */
      if ((e = mp_mod(&Qmz, a, &Qmz)) != MP_OKAY) {
         goto LBL_LS_ERR;
      }
      if ((e = mp_mul_2(&Qmz, &Q2mz)) != MP_OKAY) {
         goto LBL_LS_ERR;
      }
      if ((isset = mp_get_bit(&Dz, u)) == MP_VAL) {
         e = isset;
         goto LBL_LS_ERR;
      }
      if (isset == MP_YES) {
         /* Formulas for addition of indices (carried out mod N);
          *
          * U_(m+n) = (U_m*V_n + U_n*V_m)/2
          * V_(m+n) = (V_m*V_n + D*U_m*U_n)/2
          *
          * Be careful with division by 2 (mod N)!
          */
         if ((e = mp_mul(&U2mz, &Vz, &T1z)) != MP_OKAY) {
            goto LBL_LS_ERR;
         }
         if ((e = mp_mul(&Uz, &V2mz, &T2z)) != MP_OKAY) {
            goto LBL_LS_ERR;
         }
         if ((e = mp_mul(&V2mz, &Vz, &T3z)) != MP_OKAY) {
            goto LBL_LS_ERR;
         }
         if ((e = mp_mul(&U2mz, &Uz, &T4z)) != MP_OKAY) {
            goto LBL_LS_ERR;
         }
         if ((e = s_mp_mul_si(&T4z, (long)Ds, &T4z)) != MP_OKAY) {
            goto LBL_LS_ERR;
         }
         if ((e = mp_add(&T1z, &T2z, &Uz)) != MP_OKAY) {
            goto LBL_LS_ERR;
         }
         if (mp_isodd(&Uz) != MP_NO) {
            if ((e = mp_add(&Uz, a, &Uz)) != MP_OKAY) {
               goto LBL_LS_ERR;
            }
         }
         /* CZ
          * This should round towards negative infinity because
          * Thomas R. Nicely used GMP's mpz_fdiv_q_2exp().
          * But mp_div_2() does not do so, it is truncating instead.
          */
         oddness = mp_isodd(&Uz);
         if ((e = mp_div_2(&Uz, &Uz)) != MP_OKAY) {
            goto LBL_LS_ERR;
         }
         if ((Uz.sign == MP_NEG) && (oddness != MP_NO)) {
            if ((e = mp_sub_d(&Uz, 1uL, &Uz)) != MP_OKAY) {
               goto LBL_LS_ERR;
            }
         }
         if ((e = mp_add(&T3z, &T4z, &Vz)) != MP_OKAY) {
            goto LBL_LS_ERR;
         }
         if (mp_isodd(&Vz) != MP_NO) {
            if ((e = mp_add(&Vz, a, &Vz)) != MP_OKAY) {
               goto LBL_LS_ERR;
            }
         }
         oddness = mp_isodd(&Vz);
         if ((e = mp_div_2(&Vz, &Vz)) != MP_OKAY) {
            goto LBL_LS_ERR;
         }
         if ((Vz.sign == MP_NEG) && (oddness != MP_NO)) {
            if ((e = mp_sub_d(&Vz, 1uL, &Vz)) != MP_OKAY) {
               goto LBL_LS_ERR;
            }
         }
         if ((e = mp_mod(&Uz, a, &Uz)) != MP_OKAY) {
            goto LBL_LS_ERR;
         }
         if ((e = mp_mod(&Vz, a, &Vz)) != MP_OKAY) {
            goto LBL_LS_ERR;
         }
         /* Calculating Q^d for later use */
         if ((e = mp_mul(&Qkdz, &Qmz, &Qkdz)) != MP_OKAY) {
            goto LBL_LS_ERR;
         }
         if ((e = mp_mod(&Qkdz, a, &Qkdz)) != MP_OKAY) {
            goto LBL_LS_ERR;
         }
      }
   }

   /* If U_d or V_d is congruent to 0 mod N, then N is a prime or a
      strong Lucas pseudoprime. */
   if ((mp_iszero(&Uz) != MP_NO) || (mp_iszero(&Vz) != MP_NO)) {
      *result = MP_YES;
      goto LBL_LS_ERR;
   }

   /* NOTE: Ribenboim ("The new book of prime number records," 3rd ed.,
      1995/6) omits the condition V0 on p.142, but includes it on
      p. 130. The condition is NECESSARY; otherwise the test will
      return false negatives---e.g., the primes 29 and 2000029 will be
      returned as composite. */

   /* Otherwise, we must compute V_2d, V_4d, V_8d, ..., V_{2^(s-1)*d}
      by repeated use of the formula V_2m = V_m*V_m - 2*Q^m. If any of
      these are congruent to 0 mod N, then N is a prime or a strong
      Lucas pseudoprime. */

   /* Initialize 2*Q^(d*2^r) for V_2m */
   if ((e = mp_mul_2(&Qkdz, &Q2kdz)) != MP_OKAY) {
      goto LBL_LS_ERR;
   }

   for (r = 1; r < s; r++) {
      if ((e = mp_sqr(&Vz, &Vz)) != MP_OKAY) {
         goto LBL_LS_ERR;
      }
      if ((e = mp_sub(&Vz, &Q2kdz, &Vz)) != MP_OKAY) {
         goto LBL_LS_ERR;
      }
      if ((e = mp_mod(&Vz, a, &Vz)) != MP_OKAY) {
         goto LBL_LS_ERR;
      }
      if (mp_iszero(&Vz) != MP_NO) {
         *result = MP_YES;
         goto LBL_LS_ERR;
      }
      /* Calculate Q^{d*2^r} for next r (final iteration irrelevant). */
      if (r < (s - 1)) {
         if ((e = mp_sqr(&Qkdz, &Qkdz)) != MP_OKAY) {
            goto LBL_LS_ERR;
         }
         if ((e = mp_mod(&Qkdz, a, &Qkdz)) != MP_OKAY) {
            goto LBL_LS_ERR;
         }
         if ((e = mp_mul_2(&Qkdz, &Q2kdz)) != MP_OKAY) {
            goto LBL_LS_ERR;
         }
      }
   }
LBL_LS_ERR:
   mp_clear_multi(&Q2kdz, &T4z, &T3z, &T2z, &T1z, &Qkdz, &Q2mz, &Qmz, &V2mz, &U2mz, &Vz, &Uz, &Np1, &gcd, &Dz, NULL);
   return e;
}
#endif
#endif
#endif

/* ref:         $Format:%D$ */
/* git commit:  $Format:%H$ */
/* commit time: $Format:%ai$ */
Changes to libtommath/bn_mp_radix_size.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_RADIX_SIZE_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* returns size of ASCII reprensentation */
int mp_radix_size(const mp_int *a, int radix, int *size)
{
   int     res, digs;
   mp_int  t;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_RADIX_SIZE_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* returns size of ASCII reprensentation */
int mp_radix_size(const mp_int *a, int radix, int *size)
{
   int     res, digs;
   mp_int  t;
Changes to libtommath/bn_mp_radix_smap.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_RADIX_SMAP_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* chars used in radix conversions */
const char *const mp_s_rmap = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/";
const unsigned char mp_s_rmap_reverse[] = {
   0xff, 0xff, 0xff, 0x3e, 0xff, 0xff, 0xff, 0x3f, /* ()*+,-./ */
   0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 01234567 */











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_RADIX_SMAP_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* chars used in radix conversions */
const char *const mp_s_rmap = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/";
const unsigned char mp_s_rmap_reverse[] = {
   0xff, 0xff, 0xff, 0x3e, 0xff, 0xff, 0xff, 0x3f, /* ()*+,-./ */
   0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 01234567 */
Changes to libtommath/bn_mp_rand.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_RAND_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* First the OS-specific special cases
 * - *BSD
 * - Windows
 */
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__)











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_RAND_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* First the OS-specific special cases
 * - *BSD
 * - Windows
 */
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
   if (ret == MP_OKAY) return ret;
#endif

   return ret;
}

/* makes a pseudo-random int of a given size */
static int s_gen_random(mp_digit *r)
{
   int ret = s_rand_digit(r);
   *r &= MP_MASK;
   return ret;
}

int mp_rand(mp_int *a, int digits)
{
   int     res;
   mp_digit d;

   mp_zero(a);
   if (digits <= 0) {
      return MP_OKAY;
   }

   /* first place a random non-zero digit */
   do {
      if (s_gen_random(&d) != MP_OKAY) {
         return MP_VAL;
      }
   } while (d == 0u);

   if ((res = mp_add_d(a, d, a)) != MP_OKAY) {
      return res;
   }

   while (--digits > 0) {
      if ((res = mp_lshd(a, 1)) != MP_OKAY) {
         return res;
      }

      if (s_gen_random(&d) != MP_OKAY) {
         return MP_VAL;
      }
      if ((res = mp_add_d(a, d, a)) != MP_OKAY) {
         return res;
      }
   }








|


















|













|







168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
   if (ret == MP_OKAY) return ret;
#endif

   return ret;
}

/* makes a pseudo-random int of a given size */
int mp_rand_digit(mp_digit *r)
{
   int ret = s_rand_digit(r);
   *r &= MP_MASK;
   return ret;
}

int mp_rand(mp_int *a, int digits)
{
   int     res;
   mp_digit d;

   mp_zero(a);
   if (digits <= 0) {
      return MP_OKAY;
   }

   /* first place a random non-zero digit */
   do {
      if (mp_rand_digit(&d) != MP_OKAY) {
         return MP_VAL;
      }
   } while (d == 0u);

   if ((res = mp_add_d(a, d, a)) != MP_OKAY) {
      return res;
   }

   while (--digits > 0) {
      if ((res = mp_lshd(a, 1)) != MP_OKAY) {
         return res;
      }

      if (mp_rand_digit(&d) != MP_OKAY) {
         return MP_VAL;
      }
      if ((res = mp_add_d(a, d, a)) != MP_OKAY) {
         return res;
      }
   }

Changes to libtommath/bn_mp_read_radix.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_READ_RADIX_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* read a string [ASCII] in a given radix */
int mp_read_radix(mp_int *a, const char *str, int radix)
{
   int     y, res, neg;
   unsigned pos;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_READ_RADIX_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* read a string [ASCII] in a given radix */
int mp_read_radix(mp_int *a, const char *str, int radix)
{
   int     y, res, neg;
   unsigned pos;
Changes to libtommath/bn_mp_read_signed_bin.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_READ_SIGNED_BIN_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* read signed bin, big endian, first byte is 0==positive or 1==negative */
int mp_read_signed_bin(mp_int *a, const unsigned char *b, int c)
{
   int     res;












|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_READ_SIGNED_BIN_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* read signed bin, big endian, first byte is 0==positive or 1==negative */
int mp_read_signed_bin(mp_int *a, const unsigned char *b, int c)
{
   int     res;

Changes to libtommath/bn_mp_read_unsigned_bin.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_READ_UNSIGNED_BIN_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* reads a unsigned char array, assumes the msb is stored first [big endian] */
int mp_read_unsigned_bin(mp_int *a, const unsigned char *b, int c)
{
   int     res;












|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_READ_UNSIGNED_BIN_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* reads a unsigned char array, assumes the msb is stored first [big endian] */
int mp_read_unsigned_bin(mp_int *a, const unsigned char *b, int c)
{
   int     res;

Changes to libtommath/bn_mp_reduce.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_REDUCE_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* reduces x mod m, assumes 0 < x < m**2, mu is
 * precomputed via mp_reduce_setup.
 * From HAC pp.604 Algorithm 14.42
 */
int mp_reduce(mp_int *x, const mp_int *m, const mp_int *mu)











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_REDUCE_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* reduces x mod m, assumes 0 < x < m**2, mu is
 * precomputed via mp_reduce_setup.
 * From HAC pp.604 Algorithm 14.42
 */
int mp_reduce(mp_int *x, const mp_int *m, const mp_int *mu)
Changes to libtommath/bn_mp_reduce_2k.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_REDUCE_2K_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* reduces a modulo n where n is of the form 2**p - d */
int mp_reduce_2k(mp_int *a, const mp_int *n, mp_digit d)
{
   mp_int q;
   int    p, res;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_REDUCE_2K_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* reduces a modulo n where n is of the form 2**p - d */
int mp_reduce_2k(mp_int *a, const mp_int *n, mp_digit d)
{
   mp_int q;
   int    p, res;
Changes to libtommath/bn_mp_reduce_2k_l.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_REDUCE_2K_L_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* reduces a modulo n where n is of the form 2**p - d
   This differs from reduce_2k since "d" can be larger
   than a single digit.
*/
int mp_reduce_2k_l(mp_int *a, const mp_int *n, const mp_int *d)











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_REDUCE_2K_L_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* reduces a modulo n where n is of the form 2**p - d
   This differs from reduce_2k since "d" can be larger
   than a single digit.
*/
int mp_reduce_2k_l(mp_int *a, const mp_int *n, const mp_int *d)
Changes to libtommath/bn_mp_reduce_2k_setup.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_REDUCE_2K_SETUP_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* determines the setup value */
int mp_reduce_2k_setup(const mp_int *a, mp_digit *d)
{
   int res, p;
   mp_int tmp;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_REDUCE_2K_SETUP_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* determines the setup value */
int mp_reduce_2k_setup(const mp_int *a, mp_digit *d)
{
   int res, p;
   mp_int tmp;
Changes to libtommath/bn_mp_reduce_2k_setup_l.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_REDUCE_2K_SETUP_L_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* determines the setup value */
int mp_reduce_2k_setup_l(const mp_int *a, mp_int *d)
{
   int    res;
   mp_int tmp;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_REDUCE_2K_SETUP_L_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* determines the setup value */
int mp_reduce_2k_setup_l(const mp_int *a, mp_int *d)
{
   int    res;
   mp_int tmp;
Changes to libtommath/bn_mp_reduce_is_2k.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_REDUCE_IS_2K_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* determines if mp_reduce_2k can be used */
int mp_reduce_is_2k(const mp_int *a)
{
   int ix, iy, iw;
   mp_digit iz;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_REDUCE_IS_2K_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* determines if mp_reduce_2k can be used */
int mp_reduce_is_2k(const mp_int *a)
{
   int ix, iy, iw;
   mp_digit iz;
Changes to libtommath/bn_mp_reduce_is_2k_l.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_REDUCE_IS_2K_L_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* determines if reduce_2k_l can be used */
int mp_reduce_is_2k_l(const mp_int *a)
{
   int ix, iy;












|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_REDUCE_IS_2K_L_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* determines if reduce_2k_l can be used */
int mp_reduce_is_2k_l(const mp_int *a)
{
   int ix, iy;

Changes to libtommath/bn_mp_reduce_setup.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_REDUCE_SETUP_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* pre-calculate the value required for Barrett reduction
 * For a given modulus "b" it calulates the value required in "a"
 */
int mp_reduce_setup(mp_int *a, const mp_int *b)
{











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_REDUCE_SETUP_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* pre-calculate the value required for Barrett reduction
 * For a given modulus "b" it calulates the value required in "a"
 */
int mp_reduce_setup(mp_int *a, const mp_int *b)
{
Changes to libtommath/bn_mp_rshd.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_RSHD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* shift right a certain amount of digits */
void mp_rshd(mp_int *a, int b)
{
   int     x;












|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_RSHD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* shift right a certain amount of digits */
void mp_rshd(mp_int *a, int b)
{
   int     x;

Changes to libtommath/bn_mp_set.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_SET_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* set to a digit */
void mp_set(mp_int *a, mp_digit b)
{
   mp_zero(a);
   a->dp[0] = b & MP_MASK;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_SET_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* set to a digit */
void mp_set(mp_int *a, mp_digit b)
{
   mp_zero(a);
   a->dp[0] = b & MP_MASK;
Added libtommath/bn_mp_set_double.c.




























































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include "tommath_private.h"
#ifdef BN_MP_SET_DOUBLE_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense
 */

#if defined(__STDC_IEC_559__) || defined(__GCC_IEC_559)
int mp_set_double(mp_int *a, double b)
{
   uint64_t frac;
   int exp, res;
   union {
      double   dbl;
      uint64_t bits;
   } cast;
   cast.dbl = b;

   exp = (int)((unsigned)(cast.bits >> 52) & 0x7FFU);
   frac = (cast.bits & ((1ULL << 52) - 1ULL)) | (1ULL << 52);

   if (exp == 0x7FF) { /* +-inf, NaN */
      return MP_VAL;
   }
   exp -= 1023 + 52;

   res = mp_set_long_long(a, frac);
   if (res != MP_OKAY) {
      return res;
   }

   res = (exp < 0) ? mp_div_2d(a, -exp, a, NULL) : mp_mul_2d(a, exp, a);
   if (res != MP_OKAY) {
      return res;
   }

   if (((cast.bits >> 63) != 0ULL) && (mp_iszero(a) == MP_NO)) {
      SIGN(a) = MP_NEG;
   }

   return MP_OKAY;
}
#else
/* pragma message() not supported by several compilers (in mostly older but still used versions) */
#  ifdef _MSC_VER
#    pragma message("mp_set_double implementation is only available on platforms with IEEE754 floating point format")
#  else
#    warning "mp_set_double implementation is only available on platforms with IEEE754 floating point format"
#  endif
#endif
#endif

/* ref:         $Format:%D$ */
/* git commit:  $Format:%H$ */
/* commit time: $Format:%ai$ */
Changes to libtommath/bn_mp_set_int.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_SET_INT_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* set a 32-bit const */
int mp_set_int(mp_int *a, unsigned long b)
{
   int     x, res;












|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_SET_INT_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* set a 32-bit const */
int mp_set_int(mp_int *a, unsigned long b)
{
   int     x, res;

Changes to libtommath/bn_mp_set_long.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_SET_LONG_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* set a platform dependent unsigned long int */
MP_SET_XLONG(mp_set_long, unsigned long)
#endif

/* ref:         $Format:%D$ */











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_SET_LONG_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* set a platform dependent unsigned long int */
MP_SET_XLONG(mp_set_long, unsigned long)
#endif

/* ref:         $Format:%D$ */
Changes to libtommath/bn_mp_set_long_long.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_SET_LONG_LONG_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* set a platform dependent unsigned long long int */
MP_SET_XLONG(mp_set_long_long, Tcl_WideUInt)
#endif

/* ref:         $Format:%D$ */











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_SET_LONG_LONG_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* set a platform dependent unsigned long long int */
MP_SET_XLONG(mp_set_long_long, Tcl_WideUInt)
#endif

/* ref:         $Format:%D$ */
Changes to libtommath/bn_mp_shrink.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_SHRINK_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* shrink a bignum */
int mp_shrink(mp_int *a)
{
   mp_digit *tmp;
   int used = 1;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_SHRINK_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* shrink a bignum */
int mp_shrink(mp_int *a)
{
   mp_digit *tmp;
   int used = 1;
Changes to libtommath/bn_mp_signed_bin_size.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_SIGNED_BIN_SIZE_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* get the size for an signed equivalent */
int mp_signed_bin_size(const mp_int *a)
{
   return 1 + mp_unsigned_bin_size(a);
}











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_SIGNED_BIN_SIZE_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* get the size for an signed equivalent */
int mp_signed_bin_size(const mp_int *a)
{
   return 1 + mp_unsigned_bin_size(a);
}
Changes to libtommath/bn_mp_sqr.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_SQR_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* computes b = a*a */
int mp_sqr(const mp_int *a, mp_int *b)
{
   int     res;












|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_SQR_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* computes b = a*a */
int mp_sqr(const mp_int *a, mp_int *b)
{
   int     res;

Changes to libtommath/bn_mp_sqrmod.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_SQRMOD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* c = a * a (mod b) */
int mp_sqrmod(const mp_int *a, const mp_int *b, mp_int *c)
{
   int     res;
   mp_int  t;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_SQRMOD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* c = a * a (mod b) */
int mp_sqrmod(const mp_int *a, const mp_int *b, mp_int *c)
{
   int     res;
   mp_int  t;
Changes to libtommath/bn_mp_sqrt.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_SQRT_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

#ifndef NO_FLOATING_POINT
#include <math.h>
#endif

/* this function is less generic than mp_n_root, simpler and faster */











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_SQRT_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

#ifndef NO_FLOATING_POINT
#include <math.h>
#endif

/* this function is less generic than mp_n_root, simpler and faster */
Changes to libtommath/bn_mp_sqrtmod_prime.c.
1
2
3
4
5
6
7
8
9



10
11
12
13
14
15
16
#include "tommath_private.h"
#ifdef BN_MP_SQRTMOD_PRIME_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library is free for all purposes without any express
 * guarantee it works.



 */

/* Tonelli-Shanks algorithm
 * https://en.wikipedia.org/wiki/Tonelli%E2%80%93Shanks_algorithm
 * https://gmplib.org/list-archives/gmp-discuss/2013-April/005300.html
 *
 */







|
|
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_SQRTMOD_PRIME_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense
 */

/* Tonelli-Shanks algorithm
 * https://en.wikipedia.org/wiki/Tonelli%E2%80%93Shanks_algorithm
 * https://gmplib.org/list-archives/gmp-discuss/2013-April/005300.html
 *
 */
118
119
120
121
122
123
124





cleanup:
   mp_clear_multi(&t1, &C, &Q, &S, &Z, &M, &T, &R, &two, NULL);
   return res;
}

#endif











>
>
>
>
121
122
123
124
125
126
127
128
129
130
131

cleanup:
   mp_clear_multi(&t1, &C, &Q, &S, &Z, &M, &T, &R, &two, NULL);
   return res;
}

#endif

/* ref:         $Format:%D$ */
/* git commit:  $Format:%H$ */
/* commit time: $Format:%ai$ */
Changes to libtommath/bn_mp_sub.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_SUB_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* high level subtraction (handles signs) */
int mp_sub(const mp_int *a, const mp_int *b, mp_int *c)
{
   int     sa, sb, res;












|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_SUB_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* high level subtraction (handles signs) */
int mp_sub(const mp_int *a, const mp_int *b, mp_int *c)
{
   int     sa, sb, res;

Changes to libtommath/bn_mp_sub_d.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_SUB_D_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* single digit subtraction */
int mp_sub_d(const mp_int *a, mp_digit b, mp_int *c)
{
   mp_digit *tmpa, *tmpc, mu;
   int       res, ix, oldused;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_SUB_D_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* single digit subtraction */
int mp_sub_d(const mp_int *a, mp_digit b, mp_int *c)
{
   mp_digit *tmpa, *tmpc, mu;
   int       res, ix, oldused;
Changes to libtommath/bn_mp_submod.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_SUBMOD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* d = a - b (mod c) */
int mp_submod(const mp_int *a, const mp_int *b, const mp_int *c, mp_int *d)
{
   int     res;
   mp_int  t;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_SUBMOD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* d = a - b (mod c) */
int mp_submod(const mp_int *a, const mp_int *b, const mp_int *c, mp_int *d)
{
   int     res;
   mp_int  t;
Changes to libtommath/bn_mp_tc_and.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24


25
26
27
28
29
30
31
#include "tommath_private.h"
#ifdef BN_MP_TC_AND_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* two complement and */
int mp_tc_and(const mp_int *a, const mp_int *b, mp_int *c)
{
   int res = MP_OKAY, bits;
   int as = mp_isneg(a), bs = mp_isneg(b);
   mp_int *mx = NULL, _mx, acpy, bcpy;

   if ((as != MP_NO) || (bs != MP_NO)) {
      bits = MAX(mp_count_bits(a), mp_count_bits(b));


      res = mp_init_set_int(&_mx, 1uL);
      if (res != MP_OKAY) {
         goto end;
      }

      mx = &_mx;
      res = mp_mul_2d(mx, bits + 1, mx);











|
<





|




|
>
>







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "tommath_private.h"
#ifdef BN_MP_TC_AND_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* two complement and */
int mp_tc_and(const mp_int *a, const mp_int *b, mp_int *c)
{
   int res = MP_OKAY, bits, abits, bbits;
   int as = mp_isneg(a), bs = mp_isneg(b);
   mp_int *mx = NULL, _mx, acpy, bcpy;

   if ((as != MP_NO) || (bs != MP_NO)) {
      abits = mp_count_bits(a);
      bbits = mp_count_bits(b);
      bits = MAX(abits, bbits);
      res = mp_init_set_int(&_mx, 1uL);
      if (res != MP_OKAY) {
         goto end;
      }

      mx = &_mx;
      res = mp_mul_2d(mx, bits + 1, mx);
Changes to libtommath/bn_mp_tc_div_2d.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_TC_DIV_2D_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* two complement right shift */
int mp_tc_div_2d(const mp_int *a, int b, mp_int *c)
{
   int res;
   if (mp_isneg(a) == MP_NO) {











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_TC_DIV_2D_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* two complement right shift */
int mp_tc_div_2d(const mp_int *a, int b, mp_int *c)
{
   int res;
   if (mp_isneg(a) == MP_NO) {
Changes to libtommath/bn_mp_tc_or.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24


25
26
27
28
29
30
31
#include "tommath_private.h"
#ifdef BN_MP_TC_OR_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* two complement or */
int mp_tc_or(const mp_int *a, const mp_int *b, mp_int *c)
{
   int res = MP_OKAY, bits;
   int as = mp_isneg(a), bs = mp_isneg(b);
   mp_int *mx = NULL, _mx, acpy, bcpy;

   if ((as != MP_NO) || (bs != MP_NO)) {
      bits = MAX(mp_count_bits(a), mp_count_bits(b));


      res = mp_init_set_int(&_mx, 1uL);
      if (res != MP_OKAY) {
         goto end;
      }

      mx = &_mx;
      res = mp_mul_2d(mx, bits + 1, mx);











|
<





|




|
>
>







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "tommath_private.h"
#ifdef BN_MP_TC_OR_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* two complement or */
int mp_tc_or(const mp_int *a, const mp_int *b, mp_int *c)
{
   int res = MP_OKAY, bits, abits, bbits;
   int as = mp_isneg(a), bs = mp_isneg(b);
   mp_int *mx = NULL, _mx, acpy, bcpy;

   if ((as != MP_NO) || (bs != MP_NO)) {
      abits = mp_count_bits(a);
      bbits = mp_count_bits(b);
      bits = MAX(abits, bbits);
      res = mp_init_set_int(&_mx, 1uL);
      if (res != MP_OKAY) {
         goto end;
      }

      mx = &_mx;
      res = mp_mul_2d(mx, bits + 1, mx);
Changes to libtommath/bn_mp_tc_xor.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24


25
26
27
28
29
30
31
#include "tommath_private.h"
#ifdef BN_MP_TC_XOR_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* two complement xor */
int mp_tc_xor(const mp_int *a, const mp_int *b, mp_int *c)
{
   int res = MP_OKAY, bits;
   int as = mp_isneg(a), bs = mp_isneg(b);
   mp_int *mx = NULL, _mx, acpy, bcpy;

   if ((as != MP_NO) || (bs != MP_NO)) {
      bits = MAX(mp_count_bits(a), mp_count_bits(b));


      res = mp_init_set_int(&_mx, 1uL);
      if (res != MP_OKAY) {
         goto end;
      }

      mx = &_mx;
      res = mp_mul_2d(mx, bits + 1, mx);











|
<





|




|
>
>







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "tommath_private.h"
#ifdef BN_MP_TC_XOR_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* two complement xor */
int mp_tc_xor(const mp_int *a, const mp_int *b, mp_int *c)
{
   int res = MP_OKAY, bits, abits, bbits;
   int as = mp_isneg(a), bs = mp_isneg(b);
   mp_int *mx = NULL, _mx, acpy, bcpy;

   if ((as != MP_NO) || (bs != MP_NO)) {
      abits = mp_count_bits(a);
      bbits = mp_count_bits(b);
      bits = MAX(abits, bbits);
      res = mp_init_set_int(&_mx, 1uL);
      if (res != MP_OKAY) {
         goto end;
      }

      mx = &_mx;
      res = mp_mul_2d(mx, bits + 1, mx);
Changes to libtommath/bn_mp_to_signed_bin.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_TO_SIGNED_BIN_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* store in signed [big endian] format */
int mp_to_signed_bin(const mp_int *a, unsigned char *b)
{
   int     res;












|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_TO_SIGNED_BIN_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* store in signed [big endian] format */
int mp_to_signed_bin(const mp_int *a, unsigned char *b)
{
   int     res;

Changes to libtommath/bn_mp_to_signed_bin_n.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_TO_SIGNED_BIN_N_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* store in signed [big endian] format */
int mp_to_signed_bin_n(const mp_int *a, unsigned char *b, unsigned long *outlen)
{
   if (*outlen < (unsigned long)mp_signed_bin_size(a)) {
      return MP_VAL;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_TO_SIGNED_BIN_N_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* store in signed [big endian] format */
int mp_to_signed_bin_n(const mp_int *a, unsigned char *b, unsigned long *outlen)
{
   if (*outlen < (unsigned long)mp_signed_bin_size(a)) {
      return MP_VAL;
Changes to libtommath/bn_mp_to_unsigned_bin.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_TO_UNSIGNED_BIN_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* store in unsigned [big endian] format */
int mp_to_unsigned_bin(const mp_int *a, unsigned char *b)
{
   int     x, res;
   mp_int  t;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_TO_UNSIGNED_BIN_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* store in unsigned [big endian] format */
int mp_to_unsigned_bin(const mp_int *a, unsigned char *b)
{
   int     x, res;
   mp_int  t;
Changes to libtommath/bn_mp_to_unsigned_bin_n.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_TO_UNSIGNED_BIN_N_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* store in unsigned [big endian] format */
int mp_to_unsigned_bin_n(const mp_int *a, unsigned char *b, unsigned long *outlen)
{
   if (*outlen < (unsigned long)mp_unsigned_bin_size(a)) {
      return MP_VAL;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_TO_UNSIGNED_BIN_N_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* store in unsigned [big endian] format */
int mp_to_unsigned_bin_n(const mp_int *a, unsigned char *b, unsigned long *outlen)
{
   if (*outlen < (unsigned long)mp_unsigned_bin_size(a)) {
      return MP_VAL;
Changes to libtommath/bn_mp_toom_mul.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_TOOM_MUL_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* multiplication using the Toom-Cook 3-way algorithm
 *
 * Much more complicated than Karatsuba but has a lower
 * asymptotic running time of O(N**1.464).  This algorithm is
 * only particularly useful on VERY large inputs











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_TOOM_MUL_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* multiplication using the Toom-Cook 3-way algorithm
 *
 * Much more complicated than Karatsuba but has a lower
 * asymptotic running time of O(N**1.464).  This algorithm is
 * only particularly useful on VERY large inputs
Changes to libtommath/bn_mp_toom_sqr.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_TOOM_SQR_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* squaring using Toom-Cook 3-way algorithm */
int mp_toom_sqr(const mp_int *a, mp_int *b)
{
   mp_int w0, w1, w2, w3, w4, tmp1, a0, a1, a2;
   int res, B;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_TOOM_SQR_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* squaring using Toom-Cook 3-way algorithm */
int mp_toom_sqr(const mp_int *a, mp_int *b)
{
   mp_int w0, w1, w2, w3, w4, tmp1, a0, a1, a2;
   int res, B;
Changes to libtommath/bn_mp_toradix.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_TORADIX_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* stores a bignum as a ASCII string in a given radix (2..64) */
int mp_toradix(const mp_int *a, char *str, int radix)
{
   int     res, digs;
   mp_int  t;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_TORADIX_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* stores a bignum as a ASCII string in a given radix (2..64) */
int mp_toradix(const mp_int *a, char *str, int radix)
{
   int     res, digs;
   mp_int  t;
Changes to libtommath/bn_mp_toradix_n.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_TORADIX_N_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* stores a bignum as a ASCII string in a given radix (2..64)
 *
 * Stores upto maxlen-1 chars and always a NULL byte
 */
int mp_toradix_n(const mp_int *a, char *str, int radix, int maxlen)











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_TORADIX_N_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* stores a bignum as a ASCII string in a given radix (2..64)
 *
 * Stores upto maxlen-1 chars and always a NULL byte
 */
int mp_toradix_n(const mp_int *a, char *str, int radix, int maxlen)
Changes to libtommath/bn_mp_unsigned_bin_size.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_UNSIGNED_BIN_SIZE_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* get the size for an unsigned equivalent */
int mp_unsigned_bin_size(const mp_int *a)
{
   int     size = mp_count_bits(a);
   return (size / 8) + ((((unsigned)size & 7u) != 0u) ? 1 : 0);











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_UNSIGNED_BIN_SIZE_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* get the size for an unsigned equivalent */
int mp_unsigned_bin_size(const mp_int *a)
{
   int     size = mp_count_bits(a);
   return (size / 8) + ((((unsigned)size & 7u) != 0u) ? 1 : 0);
Changes to libtommath/bn_mp_xor.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_XOR_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* XOR two ints together */
int mp_xor(const mp_int *a, const mp_int *b, mp_int *c)
{
   int     res, ix, px;
   mp_int  t;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_XOR_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* XOR two ints together */
int mp_xor(const mp_int *a, const mp_int *b, mp_int *c)
{
   int     res, ix, px;
   mp_int  t;
Changes to libtommath/bn_mp_zero.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_MP_ZERO_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* set to zero */
void mp_zero(mp_int *a)
{
   int       n;
   mp_digit *tmp;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_MP_ZERO_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* set to zero */
void mp_zero(mp_int *a)
{
   int       n;
   mp_digit *tmp;
Changes to libtommath/bn_prime_tab.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_PRIME_TAB_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

const mp_digit ltm_prime_tab[] = {
   0x0002, 0x0003, 0x0005, 0x0007, 0x000B, 0x000D, 0x0011, 0x0013,
   0x0017, 0x001D, 0x001F, 0x0025, 0x0029, 0x002B, 0x002F, 0x0035,
   0x003B, 0x003D, 0x0043, 0x0047, 0x0049, 0x004F, 0x0053, 0x0059,
   0x0061, 0x0065, 0x0067, 0x006B, 0x006D, 0x0071, 0x007F,











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_PRIME_TAB_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

const mp_digit ltm_prime_tab[] = {
   0x0002, 0x0003, 0x0005, 0x0007, 0x000B, 0x000D, 0x0011, 0x0013,
   0x0017, 0x001D, 0x001F, 0x0025, 0x0029, 0x002B, 0x002F, 0x0035,
   0x003B, 0x003D, 0x0043, 0x0047, 0x0049, 0x004F, 0x0053, 0x0059,
   0x0061, 0x0065, 0x0067, 0x006B, 0x006D, 0x0071, 0x007F,
Changes to libtommath/bn_reverse.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_REVERSE_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* reverse an array, used for radix code */
void bn_reverse(unsigned char *s, int len)
{
   int     ix, iy;
   unsigned char t;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_REVERSE_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* reverse an array, used for radix code */
void bn_reverse(unsigned char *s, int len)
{
   int     ix, iy;
   unsigned char t;
Changes to libtommath/bn_s_mp_add.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_S_MP_ADD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* low level addition, based on HAC pp.594, Algorithm 14.7 */
int s_mp_add(const mp_int *a, const mp_int *b, mp_int *c)
{
   const mp_int *x;
   int     olduse, res, min, max;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_S_MP_ADD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* low level addition, based on HAC pp.594, Algorithm 14.7 */
int s_mp_add(const mp_int *a, const mp_int *b, mp_int *c)
{
   const mp_int *x;
   int     olduse, res, min, max;
Changes to libtommath/bn_s_mp_exptmod.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_S_MP_EXPTMOD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

#ifdef MP_LOW_MEM
#   define TAB_SIZE 32
#else
#   define TAB_SIZE 256
#endif











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_S_MP_EXPTMOD_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

#ifdef MP_LOW_MEM
#   define TAB_SIZE 32
#else
#   define TAB_SIZE 256
#endif
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
   if ((err = mp_mod(G, P, &M[1])) != MP_OKAY) {
      goto LBL_MU;
   }

   /* compute the value at M[1<<(winsize-1)] by squaring
    * M[1] (winsize-1) times
    */
   if ((err = mp_copy(&M[1], &M[1 << (winsize - 1)])) != MP_OKAY) {
      goto LBL_MU;
   }

   for (x = 0; x < (winsize - 1); x++) {
      /* square it */
      if ((err = mp_sqr(&M[1 << (winsize - 1)],
                        &M[1 << (winsize - 1)])) != MP_OKAY) {
         goto LBL_MU;
      }

      /* reduce modulo P */
      if ((err = redux(&M[1 << (winsize - 1)], P, &mu)) != MP_OKAY) {
         goto LBL_MU;
      }
   }

   /* create upper table, that is M[x] = M[x-1] * M[1] (mod P)
    * for x = (2**(winsize - 1) + 1) to (2**winsize - 1)
    */







|





|
|




|







94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
   if ((err = mp_mod(G, P, &M[1])) != MP_OKAY) {
      goto LBL_MU;
   }

   /* compute the value at M[1<<(winsize-1)] by squaring
    * M[1] (winsize-1) times
    */
   if ((err = mp_copy(&M[1], &M[(size_t)1 << (winsize - 1)])) != MP_OKAY) {
      goto LBL_MU;
   }

   for (x = 0; x < (winsize - 1); x++) {
      /* square it */
      if ((err = mp_sqr(&M[(size_t)1 << (winsize - 1)],
                        &M[(size_t)1 << (winsize - 1)])) != MP_OKAY) {
         goto LBL_MU;
      }

      /* reduce modulo P */
      if ((err = redux(&M[(size_t)1 << (winsize - 1)], P, &mu)) != MP_OKAY) {
         goto LBL_MU;
      }
   }

   /* create upper table, that is M[x] = M[x-1] * M[1] (mod P)
    * for x = (2**(winsize - 1) + 1) to (2**winsize - 1)
    */
Changes to libtommath/bn_s_mp_mul_digs.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_S_MP_MUL_DIGS_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* multiplies |a| * |b| and only computes upto digs digits of result
 * HAC pp. 595, Algorithm 14.12  Modified so you can control how
 * many digits of output are created.
 */
int s_mp_mul_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs)











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_S_MP_MUL_DIGS_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* multiplies |a| * |b| and only computes upto digs digits of result
 * HAC pp. 595, Algorithm 14.12  Modified so you can control how
 * many digits of output are created.
 */
int s_mp_mul_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs)
Changes to libtommath/bn_s_mp_mul_high_digs.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_S_MP_MUL_HIGH_DIGS_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* multiplies |a| * |b| and does not compute the lower digs digits
 * [meant to get the higher part of the product]
 */
int s_mp_mul_high_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs)
{











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_S_MP_MUL_HIGH_DIGS_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* multiplies |a| * |b| and does not compute the lower digs digits
 * [meant to get the higher part of the product]
 */
int s_mp_mul_high_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs)
{
Changes to libtommath/bn_s_mp_sqr.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_S_MP_SQR_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* low level squaring, b = a*a, HAC pp.596-597, Algorithm 14.16 */
int s_mp_sqr(const mp_int *a, mp_int *b)
{
   mp_int  t;
   int     res, ix, iy, pa;











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_S_MP_SQR_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* low level squaring, b = a*a, HAC pp.596-597, Algorithm 14.16 */
int s_mp_sqr(const mp_int *a, mp_int *b)
{
   mp_int  t;
   int     res, ix, iy, pa;
Changes to libtommath/bn_s_mp_sub.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BN_S_MP_SUB_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* low level subtraction (assumes |a| > |b|), HAC pp.595 Algorithm 14.9 */
int s_mp_sub(const mp_int *a, const mp_int *b, mp_int *c)
{
   int     olduse, res, min, max;












|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BN_S_MP_SUB_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* low level subtraction (assumes |a| > |b|), HAC pp.595 Algorithm 14.9 */
int s_mp_sub(const mp_int *a, const mp_int *b, mp_int *c)
{
   int     olduse, res, min, max;

Changes to libtommath/bncore.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "tommath_private.h"
#ifdef BNCORE_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */

/* Known optimal configurations

 CPU                    /Compiler     /MUL CUTOFF/SQR CUTOFF
-------------------------------------------------------------
 Intel P4 Northwood     /GCC v3.4.1   /        88/       128/LTM 0.32 ;-)











|
<







1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
#include "tommath_private.h"
#ifdef BNCORE_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */

/* Known optimal configurations

 CPU                    /Compiler     /MUL CUTOFF/SQR CUTOFF
-------------------------------------------------------------
 Intel P4 Northwood     /GCC v3.4.1   /        88/       128/LTM 0.32 ;-)
Changes to libtommath/callgraph.txt.
89
90
91
92
93
94
95

96
97
98
99
100
101
102
|   +--->BN_S_MP_ADD_C
|   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CMP_MAG_C
|   +--->BN_S_MP_SUB_C
|   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLAMP_C

+--->BN_MP_EXCH_C
+--->BN_MP_CLEAR_MULTI_C
|   +--->BN_MP_CLEAR_C


BN_FAST_MP_MONTGOMERY_REDUCE_C
+--->BN_MP_GROW_C







>







89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|   +--->BN_S_MP_ADD_C
|   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CMP_MAG_C
|   +--->BN_S_MP_SUB_C
|   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLAMP_C
+--->BN_MP_CMP_MAG_C
+--->BN_MP_EXCH_C
+--->BN_MP_CLEAR_MULTI_C
|   +--->BN_MP_CLEAR_C


BN_FAST_MP_MONTGOMERY_REDUCE_C
+--->BN_MP_GROW_C
474
475
476
477
478
479
480

481
482
483
484
485
486
487
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C

|   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_INVMOD_SLOW_C
|   |   +--->BN_MP_INIT_MULTI_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_MOD_C







>







475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CMP_MAG_C
|   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_INVMOD_SLOW_C
|   |   +--->BN_MP_INIT_MULTI_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_MOD_C
2319
2320
2321
2322
2323
2324
2325






2326
2327
2328
2329
2330
2331
2332
|   +--->BN_MP_GROW_C
|   +--->BN_MP_LSHD_C
|   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_ZERO_C
|   +--->BN_MP_CLAMP_C
+--->BN_MP_CLEAR_C








BN_MP_GET_INT_C


BN_MP_GET_LONG_C









>
>
>
>
>
>







2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
|   +--->BN_MP_GROW_C
|   +--->BN_MP_LSHD_C
|   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_ZERO_C
|   +--->BN_MP_CLAMP_C
+--->BN_MP_CLEAR_C


BN_MP_GET_BIT_C


BN_MP_GET_DOUBLE_C


BN_MP_GET_INT_C


BN_MP_GET_LONG_C


2473
2474
2475
2476
2477
2478
2479

2480
2481
2482
2483
2484
2485
2486
|   |   +--->BN_S_MP_ADD_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CMP_MAG_C
|   |   +--->BN_S_MP_SUB_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C

|   +--->BN_MP_EXCH_C
|   +--->BN_MP_CLEAR_MULTI_C
|   |   +--->BN_MP_CLEAR_C
+--->BN_MP_INVMOD_SLOW_C
|   +--->BN_MP_INIT_MULTI_C
|   |   +--->BN_MP_INIT_C
|   |   +--->BN_MP_CLEAR_C







>







2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
|   |   +--->BN_S_MP_ADD_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CMP_MAG_C
|   |   +--->BN_S_MP_SUB_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CMP_MAG_C
|   +--->BN_MP_EXCH_C
|   +--->BN_MP_CLEAR_MULTI_C
|   |   +--->BN_MP_CLEAR_C
+--->BN_MP_INVMOD_SLOW_C
|   +--->BN_MP_INIT_MULTI_C
|   |   +--->BN_MP_INIT_C
|   |   +--->BN_MP_CLEAR_C
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214












3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
















3228
3229
3230

3231
3232




3233
3234
3235
3236

3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
|   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_CLEAR_C
+--->BN_MP_CMP_MAG_C
+--->BN_MP_CLEAR_C


BN_MP_JACOBI_C
+--->BN_MP_CMP_D_C
+--->BN_MP_INIT_COPY_C
|   +--->BN_MP_INIT_SIZE_C
|   +--->BN_MP_COPY_C
|   |   +--->BN_MP_GROW_C
|   +--->BN_MP_CLEAR_C
+--->BN_MP_CNT_LSB_C
+--->BN_MP_DIV_2D_C
|   +--->BN_MP_COPY_C
|   |   +--->BN_MP_GROW_C
|   +--->BN_MP_ZERO_C
|   +--->BN_MP_MOD_2D_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_RSHD_C
|   +--->BN_MP_CLAMP_C
+--->BN_MP_MOD_C
|   +--->BN_MP_INIT_SIZE_C
|   +--->BN_MP_DIV_C
|   |   +--->BN_MP_CMP_MAG_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_ZERO_C












|   |   +--->BN_MP_INIT_MULTI_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_SET_C
|   |   +--->BN_MP_COUNT_BITS_C
|   |   +--->BN_MP_ABS_C
|   |   +--->BN_MP_MUL_2D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_LSHD_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CMP_C
|   |   +--->BN_MP_SUB_C
|   |   |   +--->BN_S_MP_ADD_C
















|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_S_MP_SUB_C

|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C




|   |   +--->BN_MP_ADD_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C

|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_LSHD_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_RSHD_C
|   |   +--->BN_MP_RSHD_C
|   |   +--->BN_MP_MUL_D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_CLEAR_C
|   +--->BN_MP_EXCH_C
|   +--->BN_MP_ADD_C
|   |   +--->BN_S_MP_ADD_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CMP_MAG_C
|   |   +--->BN_S_MP_SUB_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
+--->BN_MP_CLEAR_C


BN_MP_KARATSUBA_MUL_C
+--->BN_MP_MUL_C
|   +--->BN_MP_TOOM_MUL_C
|   |   +--->BN_MP_INIT_MULTI_C
|   |   |   +--->BN_MP_INIT_C







|
|
|
<
|
<
<
<
<
|
<
<
|
|
<
<
|
<
<



>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
|
|
|
|
|
|
|
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

|
|
>


>
>
>
>




>



<
<
<
<
<
<
<
<
<
<
<
<

<
<
<
<
<
<
<
<
<
|







3195
3196
3197
3198
3199
3200
3201
3202
3203
3204

3205




3206


3207
3208


3209


3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271












3272









3273
3274
3275
3276
3277
3278
3279
3280
|   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_CLEAR_C
+--->BN_MP_CMP_MAG_C
+--->BN_MP_CLEAR_C


BN_MP_JACOBI_C
+--->BN_MP_KRONECKER_C
|   +--->BN_MP_INIT_COPY_C
|   |   +--->BN_MP_INIT_SIZE_C

|   |   +--->BN_MP_COPY_C




|   |   |   +--->BN_MP_GROW_C


|   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_CNT_LSB_C


|   +--->BN_MP_DIV_2D_C


|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_MOD_2D_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_RSHD_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CMP_D_C
|   +--->BN_MP_COPY_C
|   |   +--->BN_MP_GROW_C
|   +--->BN_MP_MOD_C
|   |   +--->BN_MP_INIT_SIZE_C
|   |   +--->BN_MP_DIV_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_SET_C
|   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   +--->BN_MP_ABS_C
|   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_C
|   |   |   +--->BN_MP_SUB_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_ADD_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_LSHD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_ADD_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C












|   +--->BN_MP_CLEAR_C









+--->BN_MP_CMP_D_C


BN_MP_KARATSUBA_MUL_C
+--->BN_MP_MUL_C
|   +--->BN_MP_TOOM_MUL_C
|   |   +--->BN_MP_INIT_MULTI_C
|   |   |   +--->BN_MP_INIT_C
3400
3401
3402
3403
3404
3405
3406









































































3407
3408
3409
3410
3411
3412
3413
|   +--->BN_MP_GROW_C
|   +--->BN_MP_RSHD_C
|   |   +--->BN_MP_ZERO_C
+--->BN_MP_ADD_C
|   +--->BN_MP_CMP_MAG_C
+--->BN_MP_CLEAR_C











































































BN_MP_LCM_C
+--->BN_MP_INIT_MULTI_C
|   +--->BN_MP_INIT_C
|   +--->BN_MP_CLEAR_C
+--->BN_MP_GCD_C
|   +--->BN_MP_ABS_C







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
|   +--->BN_MP_GROW_C
|   +--->BN_MP_RSHD_C
|   |   +--->BN_MP_ZERO_C
+--->BN_MP_ADD_C
|   +--->BN_MP_CMP_MAG_C
+--->BN_MP_CLEAR_C


BN_MP_KRONECKER_C
+--->BN_MP_INIT_COPY_C
|   +--->BN_MP_INIT_SIZE_C
|   +--->BN_MP_COPY_C
|   |   +--->BN_MP_GROW_C
|   +--->BN_MP_CLEAR_C
+--->BN_MP_CNT_LSB_C
+--->BN_MP_DIV_2D_C
|   +--->BN_MP_COPY_C
|   |   +--->BN_MP_GROW_C
|   +--->BN_MP_ZERO_C
|   +--->BN_MP_MOD_2D_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_RSHD_C
|   +--->BN_MP_CLAMP_C
+--->BN_MP_CMP_D_C
+--->BN_MP_COPY_C
|   +--->BN_MP_GROW_C
+--->BN_MP_MOD_C
|   +--->BN_MP_INIT_SIZE_C
|   +--->BN_MP_DIV_C
|   |   +--->BN_MP_CMP_MAG_C
|   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_INIT_MULTI_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_SET_C
|   |   +--->BN_MP_COUNT_BITS_C
|   |   +--->BN_MP_ABS_C
|   |   +--->BN_MP_MUL_2D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_LSHD_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CMP_C
|   |   +--->BN_MP_SUB_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_ADD_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_LSHD_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_RSHD_C
|   |   +--->BN_MP_RSHD_C
|   |   +--->BN_MP_MUL_D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_CLEAR_C
|   +--->BN_MP_EXCH_C
|   +--->BN_MP_ADD_C
|   |   +--->BN_S_MP_ADD_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CMP_MAG_C
|   |   +--->BN_S_MP_SUB_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
+--->BN_MP_CLEAR_C


BN_MP_LCM_C
+--->BN_MP_INIT_MULTI_C
|   +--->BN_MP_INIT_C
|   +--->BN_MP_CLEAR_C
+--->BN_MP_GCD_C
|   +--->BN_MP_ABS_C
4586
4587
4588
4589
4590
4591
4592

4593
4594
4595
4596
4597
4598
4599
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C

|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_INVMOD_SLOW_C
|   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_MOD_C







>







4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_INVMOD_SLOW_C
|   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_MOD_C
5511
5512
5513
5514
5515
5516
5517






















































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































5518
5519
5520
5521
5522
5523
5524
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_EXCH_C
+--->BN_MP_CMP_C
|   +--->BN_MP_CMP_MAG_C
+--->BN_MP_CLEAR_C
























































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































BN_MP_PRIME_IS_DIVISIBLE_C
+--->BN_MP_MOD_D_C
|   +--->BN_MP_DIV_D_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_DIV_2D_C







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_EXCH_C
+--->BN_MP_CMP_C
|   +--->BN_MP_CMP_MAG_C
+--->BN_MP_CLEAR_C


BN_MP_PRIME_FROBENIUS_UNDERWOOD_C
+--->BN_MP_PRIME_IS_PRIME_C
|   +--->BN_MP_IS_SQUARE_C
|   |   +--->BN_MP_MOD_D_C
|   |   |   +--->BN_MP_DIV_D_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_INIT_SET_INT_C
|   |   |   +--->BN_MP_INIT_C
|   |   |   +--->BN_MP_SET_INT_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_MOD_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_INIT_C
|   |   |   +--->BN_MP_DIV_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_SET_C
|   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_ADD_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_GET_INT_C
|   |   +--->BN_MP_SQRT_C
|   |   |   +--->BN_MP_N_ROOT_C
|   |   |   |   +--->BN_MP_N_ROOT_EX_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_EXPT_D_EX_C
|   |   |   |   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_MUL_C
|   |   |   |   |   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_SQR_C
|   |   |   |   |   |   |   +--->BN_MP_TOOM_SQR_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   |   +--->BN_MP_KARATSUBA_SQR_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_FAST_S_MP_SQR_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_SQR_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_MUL_C
|   |   |   |   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_SUB_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ADD_D_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_DIV_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_SET_C
|   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_ADD_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_SQR_C
|   |   |   +--->BN_MP_TOOM_SQR_C
|   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_KARATSUBA_SQR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_FAST_S_MP_SQR_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_S_MP_SQR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_CMP_MAG_C
|   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_CMP_D_C
|   +--->BN_MP_PRIME_IS_DIVISIBLE_C
|   |   +--->BN_MP_MOD_D_C
|   |   |   +--->BN_MP_DIV_D_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_INIT_SET_C
|   |   +--->BN_MP_INIT_C
|   |   +--->BN_MP_SET_C
|   |   |   +--->BN_MP_ZERO_C
|   +--->BN_MP_PRIME_MILLER_RABIN_C
|   |   +--->BN_MP_INIT_COPY_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_SUB_D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_ADD_D_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CNT_LSB_C
|   |   +--->BN_MP_DIV_2D_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_EXPTMOD_C
|   |   |   +--->BN_MP_INVMOD_C
|   |   |   |   +--->BN_FAST_MP_INVMOD_C
|   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_MOD_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_INVMOD_SLOW_C
|   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_MOD_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_ABS_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   +--->BN_MP_REDUCE_IS_2K_L_C
|   |   |   +--->BN_S_MP_EXPTMOD_C
|   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   +--->BN_MP_REDUCE_SETUP_C
|   |   |   |   |   +--->BN_MP_2EXPT_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_REDUCE_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_MUL_C
|   |   |   |   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_S_MP_MUL_HIGH_DIGS_C
|   |   |   |   |   |   +--->BN_FAST_S_MP_MUL_HIGH_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_FAST_S_MP_MUL_HIGH_DIGS_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_REDUCE_2K_SETUP_L_C
|   |   |   |   |   +--->BN_MP_2EXPT_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_REDUCE_2K_L_C
|   |   |   |   |   +--->BN_MP_MUL_C
|   |   |   |   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MOD_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_SQR_C
|   |   |   |   |   +--->BN_MP_TOOM_SQR_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_KARATSUBA_SQR_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_FAST_S_MP_SQR_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SQR_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_MUL_C
|   |   |   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_DR_IS_MODULUS_C
|   |   |   +--->BN_MP_REDUCE_IS_2K_C
|   |   |   |   +--->BN_MP_REDUCE_2K_C
|   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   +--->BN_MP_EXPTMOD_FAST_C
|   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_MONTGOMERY_SETUP_C
|   |   |   |   +--->BN_FAST_MP_MONTGOMERY_REDUCE_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_MONTGOMERY_REDUCE_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_DR_SETUP_C
|   |   |   |   +--->BN_MP_DR_REDUCE_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_REDUCE_2K_SETUP_C
|   |   |   |   |   +--->BN_MP_2EXPT_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_REDUCE_2K_C
|   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MONTGOMERY_CALC_NORMALIZATION_C
|   |   |   |   |   +--->BN_MP_2EXPT_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MULMOD_C
|   |   |   |   |   +--->BN_MP_MUL_C
|   |   |   |   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_MOD_C
|   |   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_MOD_C
|   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_SQR_C
|   |   |   |   |   +--->BN_MP_TOOM_SQR_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_KARATSUBA_SQR_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_FAST_S_MP_SQR_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SQR_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_MUL_C
|   |   |   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_CMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   +--->BN_MP_SQRMOD_C
|   |   |   +--->BN_MP_SQR_C
|   |   |   |   +--->BN_MP_TOOM_SQR_C
|   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_KARATSUBA_SQR_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_FAST_S_MP_SQR_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_SQR_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_MOD_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_PRIME_STRONG_LUCAS_SELFRIDGE_C
|   |   +--->BN_MP_MUL_D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_INIT_C
|   |   +--->BN_MP_SET_LONG_C
|   |   +--->BN_MP_MUL_C
|   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_INIT_MULTI_C
|   |   +--->BN_MP_GCD_C
|   |   |   +--->BN_MP_ABS_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CNT_LSB_C
|   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   +--->BN_MP_KRONECKER_C
|   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CNT_LSB_C
|   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_MOD_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_ADD_D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_SUB_D_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CNT_LSB_C
|   |   +--->BN_MP_DIV_2D_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_SET_C
|   |   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_MUL_2_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_COUNT_BITS_C
|   |   +--->BN_MP_MOD_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_DIV_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_ADD_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_SQR_C
|   |   |   +--->BN_MP_TOOM_SQR_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   +--->BN_MP_KARATSUBA_SQR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_FAST_S_MP_SQR_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_S_MP_SQR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_SUB_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_GET_BIT_C
|   |   +--->BN_MP_ADD_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_DIV_2_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_SUB_D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CLEAR_MULTI_C
|   +--->BN_MP_READ_RADIX_C
|   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_MUL_D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_ADD_D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_SUB_D_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CMP_C
|   |   +--->BN_MP_CMP_MAG_C
|   +--->BN_MP_SET_C
|   |   +--->BN_MP_ZERO_C
|   +--->BN_MP_COUNT_BITS_C
|   +--->BN_MP_RAND_C
|   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_ADD_D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_SUB_D_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_LSHD_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_RSHD_C
|   +--->BN_MP_DIV_2D_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_MOD_2D_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_RSHD_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CLEAR_C
+--->BN_MP_INIT_MULTI_C
|   +--->BN_MP_INIT_C
|   +--->BN_MP_CLEAR_C
+--->BN_MP_SET_LONG_C
+--->BN_MP_SQR_C
|   +--->BN_MP_TOOM_SQR_C
|   |   +--->BN_MP_MOD_2D_C
|   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_MUL_2_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_ADD_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_SUB_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_DIV_2_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_MUL_2D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_LSHD_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_MUL_D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_DIV_3_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_INIT_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_LSHD_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_KARATSUBA_SQR_C
|   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_INIT_C
|   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_S_MP_ADD_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_S_MP_SUB_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_LSHD_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_ADD_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   +--->BN_MP_CLEAR_C
|   +--->BN_FAST_S_MP_SQR_C
|   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_S_MP_SQR_C
|   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_INIT_C
|   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_CLEAR_C
+--->BN_MP_SUB_D_C
|   +--->BN_MP_GROW_C
|   +--->BN_MP_ADD_D_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CLAMP_C
+--->BN_MP_KRONECKER_C
|   +--->BN_MP_INIT_COPY_C
|   |   +--->BN_MP_INIT_SIZE_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_CNT_LSB_C
|   +--->BN_MP_DIV_2D_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_MOD_2D_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_RSHD_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CMP_D_C
|   +--->BN_MP_COPY_C
|   |   +--->BN_MP_GROW_C
|   +--->BN_MP_MOD_C
|   |   +--->BN_MP_INIT_SIZE_C
|   |   +--->BN_MP_DIV_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_SET_C
|   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   +--->BN_MP_ABS_C
|   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_C
|   |   |   +--->BN_MP_SUB_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_ADD_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_LSHD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_ADD_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CLEAR_C
+--->BN_MP_GCD_C
|   +--->BN_MP_ABS_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   +--->BN_MP_INIT_COPY_C
|   |   +--->BN_MP_INIT_SIZE_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_CNT_LSB_C
|   +--->BN_MP_DIV_2D_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_MOD_2D_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_RSHD_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CMP_MAG_C
|   +--->BN_MP_EXCH_C
|   +--->BN_S_MP_SUB_C
|   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_MUL_2D_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_LSHD_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CLEAR_C
+--->BN_MP_ADD_D_C
|   +--->BN_MP_GROW_C
|   +--->BN_MP_CLAMP_C
+--->BN_MP_SET_C
|   +--->BN_MP_ZERO_C
+--->BN_MP_COUNT_BITS_C
+--->BN_MP_MUL_2_C
|   +--->BN_MP_GROW_C
+--->BN_MP_MUL_D_C
|   +--->BN_MP_GROW_C
|   +--->BN_MP_CLAMP_C
+--->BN_MP_ADD_C
|   +--->BN_S_MP_ADD_C
|   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CMP_MAG_C
|   +--->BN_S_MP_SUB_C
|   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLAMP_C
+--->BN_MP_MUL_C
|   +--->BN_MP_TOOM_MUL_C
|   |   +--->BN_MP_MOD_2D_C
|   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_SUB_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_DIV_2_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_MUL_2D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_LSHD_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_DIV_3_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_INIT_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_LSHD_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_KARATSUBA_MUL_C
|   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_INIT_C
|   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_S_MP_ADD_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_S_MP_SUB_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_LSHD_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_CLEAR_C
|   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_S_MP_MUL_DIGS_C
|   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_INIT_C
|   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_CLEAR_C
+--->BN_MP_SUB_C
|   +--->BN_S_MP_ADD_C
|   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CMP_MAG_C
|   +--->BN_S_MP_SUB_C
|   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLAMP_C
+--->BN_MP_MOD_C
|   +--->BN_MP_INIT_SIZE_C
|   |   +--->BN_MP_INIT_C
|   +--->BN_MP_DIV_C
|   |   +--->BN_MP_CMP_MAG_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_ABS_C
|   |   +--->BN_MP_MUL_2D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_LSHD_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CMP_C
|   |   +--->BN_MP_DIV_2D_C
|   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_INIT_C
|   |   +--->BN_MP_INIT_COPY_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_LSHD_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_RSHD_C
|   |   +--->BN_MP_RSHD_C
|   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_CLEAR_C
|   +--->BN_MP_EXCH_C
+--->BN_MP_GET_BIT_C
+--->BN_MP_EXCH_C
+--->BN_MP_CMP_C
|   +--->BN_MP_CMP_MAG_C
+--->BN_MP_CLEAR_MULTI_C
|   +--->BN_MP_CLEAR_C


BN_MP_PRIME_IS_DIVISIBLE_C
+--->BN_MP_MOD_D_C
|   +--->BN_MP_DIV_D_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_DIV_2D_C
5537
5538
5539
5540
5541
5542
5543


































































































































































































































































































































































































































































































































5544
5545
5546
5547
5548
5549
5550
|   |   |   +--->BN_MP_INIT_C
|   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_CLEAR_C


BN_MP_PRIME_IS_PRIME_C


































































































































































































































































































































































































































































































































+--->BN_MP_CMP_D_C
+--->BN_MP_PRIME_IS_DIVISIBLE_C
|   +--->BN_MP_MOD_D_C
|   |   +--->BN_MP_DIV_D_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_DIV_2D_C







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
|   |   |   +--->BN_MP_INIT_C
|   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_CLEAR_C


BN_MP_PRIME_IS_PRIME_C
+--->BN_MP_IS_SQUARE_C
|   +--->BN_MP_MOD_D_C
|   |   +--->BN_MP_DIV_D_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_INIT_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_INIT_SET_INT_C
|   |   +--->BN_MP_INIT_C
|   |   +--->BN_MP_SET_INT_C
|   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_MOD_C
|   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_INIT_C
|   |   +--->BN_MP_DIV_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_SET_C
|   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   +--->BN_MP_ABS_C
|   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_C
|   |   |   +--->BN_MP_SUB_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_ADD_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_INIT_C
|   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_LSHD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_ADD_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_GET_INT_C
|   +--->BN_MP_SQRT_C
|   |   +--->BN_MP_N_ROOT_C
|   |   |   +--->BN_MP_N_ROOT_EX_C
|   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_EXPT_D_EX_C
|   |   |   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_MUL_C
|   |   |   |   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_SQR_C
|   |   |   |   |   |   +--->BN_MP_TOOM_SQR_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   +--->BN_MP_KARATSUBA_SQR_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_FAST_S_MP_SQR_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_SQR_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_MUL_C
|   |   |   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_MP_SUB_D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_ADD_D_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_INIT_COPY_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_RSHD_C
|   |   +--->BN_MP_DIV_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_SET_C
|   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   +--->BN_MP_ABS_C
|   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_C
|   |   |   +--->BN_MP_SUB_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_ADD_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_LSHD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_ADD_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_DIV_2_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CMP_MAG_C
|   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_SQR_C
|   |   +--->BN_MP_TOOM_SQR_C
|   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_ADD_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_SUB_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_LSHD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_KARATSUBA_SQR_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_INIT_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_LSHD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_ADD_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_FAST_S_MP_SQR_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_S_MP_SQR_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_INIT_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_CMP_MAG_C
|   +--->BN_MP_CLEAR_C
+--->BN_MP_CMP_D_C
+--->BN_MP_PRIME_IS_DIVISIBLE_C
|   +--->BN_MP_MOD_D_C
|   |   +--->BN_MP_DIV_D_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_DIV_2D_C
5560
5561
5562
5563
5564
5565
5566
5567

5568
5569
5570
5571
5572
5573
5574
5575
5576
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_INIT_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_CLEAR_C
+--->BN_MP_INIT_C

+--->BN_MP_SET_C
|   +--->BN_MP_ZERO_C
+--->BN_MP_PRIME_MILLER_RABIN_C
|   +--->BN_MP_INIT_COPY_C
|   |   +--->BN_MP_INIT_SIZE_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_SUB_D_C







|
>
|
|







8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_INIT_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_CLEAR_C
+--->BN_MP_INIT_SET_C
|   +--->BN_MP_INIT_C
|   +--->BN_MP_SET_C
|   |   +--->BN_MP_ZERO_C
+--->BN_MP_PRIME_MILLER_RABIN_C
|   +--->BN_MP_INIT_COPY_C
|   |   +--->BN_MP_INIT_SIZE_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_SUB_D_C
5595
5596
5597
5598
5599
5600
5601

5602
5603
5604
5605
5606
5607
5608
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_MOD_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C

|   |   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C







>







8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_MOD_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
5639
5640
5641
5642
5643
5644
5645


5646
5647
5648
5649
5650
5651
5652
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C


|   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C







>
>







8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
5660
5661
5662
5663
5664
5665
5666

5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679

5680
5681
5682
5683
5684
5685
5686
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C

|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_INVMOD_SLOW_C
|   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_MOD_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C

|   |   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C







>













>







8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_INVMOD_SLOW_C
|   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_MOD_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
5719
5720
5721
5722
5723
5724
5725


5726
5727
5728
5729
5730
5731
5732
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C


|   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C







>
>







8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
5762
5763
5764
5765
5766
5767
5768

5769
5770
5771
5772
5773
5774
5775
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_INIT_MULTI_C

|   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   +--->BN_MP_SUB_C







>







8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   +--->BN_MP_SUB_C
5889
5890
5891
5892
5893
5894
5895


5896
5897
5898
5899
5900
5901
5902
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C


|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C







>
>







8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
5995
5996
5997
5998
5999
6000
6001

6002
6003
6004
6005
6006
6007
6008
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_INIT_MULTI_C

|   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   +--->BN_MP_SUB_C







>







8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   +--->BN_MP_SUB_C
6161
6162
6163
6164
6165
6166
6167


6168
6169
6170
6171
6172
6173
6174
|   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C


|   |   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_DR_IS_MODULUS_C
|   |   +--->BN_MP_REDUCE_IS_2K_C
|   |   |   +--->BN_MP_REDUCE_2K_C
|   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   +--->BN_MP_GROW_C







>
>







9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
|   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_SET_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_DR_IS_MODULUS_C
|   |   +--->BN_MP_REDUCE_IS_2K_C
|   |   |   +--->BN_MP_REDUCE_2K_C
|   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   +--->BN_MP_GROW_C
6223
6224
6225
6226
6227
6228
6229


6230
6231
6232
6233
6234
6235
6236
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_MONTGOMERY_CALC_NORMALIZATION_C
|   |   |   |   +--->BN_MP_2EXPT_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_GROW_C


|   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_MULMOD_C







>
>







9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_MONTGOMERY_CALC_NORMALIZATION_C
|   |   |   |   +--->BN_MP_2EXPT_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_MULMOD_C
6302
6303
6304
6305
6306
6307
6308

6309
6310
6311
6312
6313
6314
6315
|   |   |   |   +--->BN_MP_MOD_C
|   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C

|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_SUB_C







>







9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
|   |   |   |   +--->BN_MP_MOD_C
|   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_SUB_C
6340
6341
6342
6343
6344
6345
6346


6347
6348
6349
6350
6351
6352
6353
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C


|   |   |   +--->BN_MP_MOD_C
|   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_INIT_MULTI_C







>
>







9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_SET_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_MOD_C
|   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_INIT_MULTI_C
6592
6593
6594
6595
6596
6597
6598



































































































































































































































































































































































































































































































6599
6600
6601
6602
6603
6604
6605
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_DIV_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_INIT_MULTI_C



































































































































































































































































































































































































































































































|   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_DIV_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   +--->BN_MP_SET_C
|   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_ADD_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CLEAR_C
+--->BN_MP_PRIME_FROBENIUS_UNDERWOOD_C
|   +--->BN_MP_INIT_MULTI_C
|   |   +--->BN_MP_INIT_C
|   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_SET_LONG_C
|   +--->BN_MP_SQR_C
|   |   +--->BN_MP_TOOM_SQR_C
|   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_ADD_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_SUB_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_LSHD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_KARATSUBA_SQR_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_INIT_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_LSHD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_ADD_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_FAST_S_MP_SQR_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_S_MP_SQR_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_INIT_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_SUB_D_C
|   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_ADD_D_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_KRONECKER_C
|   |   +--->BN_MP_INIT_COPY_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_CNT_LSB_C
|   |   +--->BN_MP_DIV_2D_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_MOD_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_DIV_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_SET_C
|   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_ADD_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_GCD_C
|   |   +--->BN_MP_ABS_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_INIT_COPY_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_CNT_LSB_C
|   |   +--->BN_MP_DIV_2D_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CMP_MAG_C
|   |   +--->BN_MP_EXCH_C
|   |   +--->BN_S_MP_SUB_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_MUL_2D_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_LSHD_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_ADD_D_C
|   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_SET_C
|   |   +--->BN_MP_ZERO_C
|   +--->BN_MP_COUNT_BITS_C
|   +--->BN_MP_MUL_2_C
|   |   +--->BN_MP_GROW_C
|   +--->BN_MP_MUL_D_C
|   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_ADD_C
|   |   +--->BN_S_MP_ADD_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CMP_MAG_C
|   |   +--->BN_S_MP_SUB_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_MUL_C
|   |   +--->BN_MP_TOOM_MUL_C
|   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_SUB_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_LSHD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_INIT_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_LSHD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_INIT_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_SUB_C
|   |   +--->BN_S_MP_ADD_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CMP_MAG_C
|   |   +--->BN_S_MP_SUB_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_MOD_C
|   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_INIT_C
|   |   +--->BN_MP_DIV_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_ABS_C
|   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_C
|   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_INIT_C
|   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_LSHD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_EXCH_C
|   +--->BN_MP_GET_BIT_C
|   +--->BN_MP_EXCH_C
|   +--->BN_MP_CMP_C
|   |   +--->BN_MP_CMP_MAG_C
|   +--->BN_MP_CLEAR_MULTI_C
|   |   +--->BN_MP_CLEAR_C
+--->BN_MP_PRIME_STRONG_LUCAS_SELFRIDGE_C
|   +--->BN_MP_MUL_D_C
|   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_INIT_C
|   +--->BN_MP_SET_LONG_C
|   +--->BN_MP_MUL_C
|   |   +--->BN_MP_TOOM_MUL_C
|   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_ADD_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_SUB_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_LSHD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_ADD_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_LSHD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_CLEAR_C
|   +--->BN_MP_INIT_MULTI_C
|   +--->BN_MP_GCD_C
|   |   +--->BN_MP_ABS_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_INIT_COPY_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CNT_LSB_C
|   |   +--->BN_MP_DIV_2D_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CMP_MAG_C
|   |   +--->BN_MP_EXCH_C
|   |   +--->BN_S_MP_SUB_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_MUL_2D_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_LSHD_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CMP_C
|   |   +--->BN_MP_CMP_MAG_C
|   +--->BN_MP_KRONECKER_C
|   |   +--->BN_MP_INIT_COPY_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CNT_LSB_C
|   |   +--->BN_MP_DIV_2D_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_MOD_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_DIV_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_SET_C
|   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
6619
6620
6621
6622
6623
6624
6625
6626



6627
6628



































6629














6630



























6631
6632
6633
6634






































6635












6636
6637
6638















6639

































6640
6641
6642
6643
6644
6645
6646
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_MUL_D_C



|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C



































|   |   |   |   +--->BN_MP_CLAMP_C














|   |   |   +--->BN_MP_EXCH_C



























|   |   |   +--->BN_MP_ADD_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C






































|   |   |   |   +--->BN_MP_CMP_MAG_C












|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C















|   +--->BN_MP_CLEAR_C

































+--->BN_MP_CLEAR_C


BN_MP_PRIME_MILLER_RABIN_C
+--->BN_MP_CMP_D_C
+--->BN_MP_INIT_COPY_C
|   +--->BN_MP_INIT_SIZE_C







|
>
>
>


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>




>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_ADD_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_ADD_D_C
|   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_SUB_D_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CNT_LSB_C
|   +--->BN_MP_DIV_2D_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_MOD_2D_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_RSHD_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_SET_C
|   |   +--->BN_MP_ZERO_C
|   +--->BN_MP_MUL_2_C
|   |   +--->BN_MP_GROW_C
|   +--->BN_MP_COUNT_BITS_C
|   +--->BN_MP_MOD_C
|   |   +--->BN_MP_INIT_SIZE_C
|   |   +--->BN_MP_DIV_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_ABS_C
|   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_SUB_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_ADD_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   +--->BN_MP_LSHD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_ADD_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_SQR_C
|   |   +--->BN_MP_TOOM_SQR_C
|   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_ADD_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_SUB_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_LSHD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   +--->BN_MP_KARATSUBA_SQR_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_LSHD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_ADD_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   +--->BN_FAST_S_MP_SQR_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_S_MP_SQR_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_EXCH_C
|   +--->BN_MP_SUB_C
|   |   +--->BN_S_MP_ADD_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CMP_MAG_C
|   |   +--->BN_S_MP_SUB_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_GET_BIT_C
|   +--->BN_MP_ADD_C
|   |   +--->BN_S_MP_ADD_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CMP_MAG_C
|   |   +--->BN_S_MP_SUB_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_DIV_2_C
|   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_SUB_D_C
|   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CLEAR_MULTI_C
+--->BN_MP_READ_RADIX_C
|   +--->BN_MP_ZERO_C
|   +--->BN_MP_MUL_D_C
|   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_ADD_D_C
|   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_SUB_D_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CLAMP_C
+--->BN_MP_CMP_C
|   +--->BN_MP_CMP_MAG_C
+--->BN_MP_SET_C
|   +--->BN_MP_ZERO_C
+--->BN_MP_COUNT_BITS_C
+--->BN_MP_RAND_C
|   +--->BN_MP_ZERO_C
|   +--->BN_MP_ADD_D_C
|   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_SUB_D_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_LSHD_C
|   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_RSHD_C
+--->BN_MP_DIV_2D_C
|   +--->BN_MP_COPY_C
|   |   +--->BN_MP_GROW_C
|   +--->BN_MP_ZERO_C
|   +--->BN_MP_MOD_2D_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_RSHD_C
|   +--->BN_MP_CLAMP_C
+--->BN_MP_CLEAR_C


BN_MP_PRIME_MILLER_RABIN_C
+--->BN_MP_CMP_D_C
+--->BN_MP_INIT_COPY_C
|   +--->BN_MP_INIT_SIZE_C
6737
6738
6739
6740
6741
6742
6743

6744
6745
6746
6747
6748
6749
6750
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C

|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_INVMOD_SLOW_C
|   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_MOD_C







>







10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_INVMOD_SLOW_C
|   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_MOD_C
7761
7762
7763
7764
7765
7766
7767
7768
7769












7770


























































7771








































































7772






7773
7774

























7775


















7776











7777





7778



7779






















































































































7780




7781








































7782













7783

7784
7785
7786
7787





7788
7789






































































































































































































































































































































































































































































































































































































































































































































































































































































7790









































































































































































































































































































































































































































































































































































































































































































































































































































































































































































7791

























































































































































































































































































































7792
7793
7794


7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816





7817
7818
7819
































































































































































































































































































































































































































7820
7821
7822
7823
7824
7825
7826
7827


7828
































































7829














7830


















7831
7832
7833
7834
7835
7836
7837
7838
7839

7840
7841

7842
7843
7844
7845
7846



7847
7848






7849









7850







7851
























7852
















7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
|   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_CLEAR_C
+--->BN_MP_INIT_C
+--->BN_MP_ADD_D_C
|   +--->BN_MP_GROW_C
|   +--->BN_MP_CLAMP_C
+--->BN_MP_PRIME_MILLER_RABIN_C
|   +--->BN_MP_INIT_COPY_C












|   |   +--->BN_MP_INIT_SIZE_C


























































|   |   +--->BN_MP_COPY_C








































































|   |   |   +--->BN_MP_GROW_C






|   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_CNT_LSB_C

























|   +--->BN_MP_DIV_2D_C


















|   |   +--->BN_MP_COPY_C











|   |   |   +--->BN_MP_GROW_C





|   |   +--->BN_MP_ZERO_C



|   |   +--->BN_MP_MOD_2D_C






















































































































|   |   |   +--->BN_MP_CLAMP_C




|   |   +--->BN_MP_RSHD_C








































|   |   +--->BN_MP_CLAMP_C













|   +--->BN_MP_EXPTMOD_C

|   |   +--->BN_MP_INVMOD_C
|   |   |   +--->BN_FAST_MP_INVMOD_C
|   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C





|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C






































































































































































































































































































































































































































































































































































































































































































































































































































































|   |   |   |   +--->BN_MP_MOD_C









































































































































































































































































































































































































































































































































































































































































































































































































































































































































































|   |   |   |   |   +--->BN_MP_INIT_SIZE_C

























































































































































































































































































































|   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C


|   |   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C





|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
































































































































































































































































































































































































































|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C


|   |   |   |   |   |   +--->BN_MP_CLEAR_C
































































|   |   |   |   |   +--->BN_MP_CLEAR_C














|   |   |   |   |   +--->BN_MP_EXCH_C


















|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_2_C

|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C

|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C



|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C






|   |   |   |   |   |   +--->BN_MP_CLAMP_C









|   |   |   |   +--->BN_MP_CMP_C







|   |   |   |   |   +--->BN_MP_CMP_MAG_C
























|   |   |   |   +--->BN_MP_ADD_C
















|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_INVMOD_SLOW_C
|   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_MOD_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_SUB_C







|
|
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
|
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
|
|


>
>
>
>
>


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



>
>








<
<
<
<
<
<
<







>
>
>
>
>



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>








>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>








|
>
|
|
>
|
|
|
|
|
>
>
>
|
|
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







<
<
<
<
<
<







|
|







11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13589
13590
13591
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
13624
13625
13626
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13680
13681
13682
13683
13684
13685
13686
13687
13688
13689
13690
13691
13692
13693
13694
13695
13696
13697
13698
13699
13700
13701
13702
13703
13704
13705
13706
13707
13708
13709
13710
13711
13712
13713
13714
13715
13716
13717
13718
13719
13720
13721
13722
13723
13724
13725
13726
13727
13728
13729
13730
13731
13732
13733
13734
13735
13736
13737
13738
13739
13740
13741
13742
13743
13744
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
13766
13767
13768
13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
13781
13782
13783
13784
13785
13786
13787
13788
13789
13790
13791
13792
13793
13794
13795
13796
13797
13798
13799
13800
13801
13802
13803
13804
13805
13806
13807
13808
13809
13810
13811
13812
13813
13814
13815
13816
13817
13818
13819
13820
13821
13822
13823
13824
13825
13826
13827
13828
13829
13830
13831
13832
13833
13834
13835
13836
13837
13838
13839
13840
13841
13842
13843
13844
13845
13846
13847
13848
13849
13850
13851
13852
13853
13854
13855
13856







13857
13858
13859
13860
13861
13862
13863
13864
13865
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886
13887
13888
13889
13890
13891
13892
13893
13894
13895
13896
13897
13898
13899
13900
13901
13902
13903
13904
13905
13906
13907
13908
13909
13910
13911
13912
13913
13914
13915
13916
13917
13918
13919
13920
13921
13922
13923
13924
13925
13926
13927
13928
13929
13930
13931
13932
13933
13934
13935
13936
13937
13938
13939
13940
13941
13942
13943
13944
13945
13946
13947
13948
13949
13950
13951
13952
13953
13954
13955
13956
13957
13958
13959
13960
13961
13962
13963
13964
13965
13966
13967
13968
13969
13970
13971
13972
13973
13974
13975
13976
13977
13978
13979
13980
13981
13982
13983
13984
13985
13986
13987
13988
13989
13990
13991
13992
13993
13994
13995
13996
13997
13998
13999
14000
14001
14002
14003
14004
14005
14006
14007
14008
14009
14010
14011
14012
14013
14014
14015
14016
14017
14018
14019
14020
14021
14022
14023
14024
14025
14026
14027
14028
14029
14030
14031
14032
14033
14034
14035
14036
14037
14038
14039
14040
14041
14042
14043
14044
14045
14046
14047
14048
14049
14050
14051
14052
14053
14054
14055
14056
14057
14058
14059
14060
14061
14062
14063
14064
14065
14066
14067
14068
14069
14070
14071
14072
14073
14074
14075
14076
14077
14078
14079
14080
14081
14082
14083
14084
14085
14086
14087
14088
14089
14090
14091
14092
14093
14094
14095
14096
14097
14098
14099
14100
14101
14102
14103
14104
14105
14106
14107
14108
14109
14110
14111
14112
14113
14114
14115
14116
14117
14118
14119
14120
14121
14122
14123
14124
14125
14126
14127
14128
14129
14130
14131
14132
14133
14134
14135
14136
14137
14138
14139
14140
14141
14142
14143
14144
14145
14146
14147
14148
14149
14150
14151
14152
14153
14154
14155
14156
14157
14158
14159
14160
14161
14162
14163
14164
14165
14166
14167
14168
14169
14170
14171
14172
14173
14174
14175
14176
14177
14178
14179
14180
14181
14182
14183
14184
14185
14186
14187
14188
14189
14190
14191
14192
14193
14194
14195
14196
14197
14198
14199
14200
14201
14202
14203
14204
14205
14206
14207
14208
14209
14210
14211
14212
14213
14214
14215
14216
14217
14218
14219
14220
14221
14222
14223
14224
14225
14226
14227
14228
14229
14230
14231
14232
14233
14234
14235
14236
14237
14238
14239
14240
14241
14242
14243
14244
14245
14246
14247
14248
14249
14250
14251
14252
14253
14254
14255
14256
14257
14258
14259
14260
14261
14262
14263
14264
14265
14266
14267
14268
14269
14270
14271
14272
14273
14274
14275
14276
14277
14278
14279
14280
14281
14282
14283
14284
14285
14286
14287
14288
14289
14290
14291
14292
14293
14294
14295
14296
14297
14298
14299
14300
14301
14302
14303
14304
14305
14306
14307
14308
14309
14310
14311
14312
14313
14314
14315
14316
14317
14318
14319
14320
14321
14322
14323
14324
14325
14326
14327
14328
14329
14330
14331
14332
14333
14334
14335
14336
14337
14338
14339
14340
14341
14342
14343
14344
14345
14346
14347
14348
14349
14350
14351
14352
14353
14354
14355
14356
14357
14358
14359
14360
14361
14362
14363
14364
14365
14366
14367
14368
14369
14370
14371
14372
14373
14374
14375
14376
14377
14378
14379
14380
14381
14382
14383
14384
14385
14386
14387
14388
14389
14390
14391
14392
14393
14394
14395
14396
14397
14398
14399
14400
14401
14402
14403
14404
14405
14406
14407
14408
14409
14410
14411
14412
14413
14414
14415
14416
14417
14418
14419
14420
14421
14422
14423
14424
14425
14426
14427
14428
14429
14430
14431
14432
14433
14434
14435
14436
14437
14438
14439
14440
14441
14442
14443
14444
14445
14446
14447
14448
14449
14450
14451
14452
14453
14454
14455
14456
14457
14458
14459
14460
14461
14462
14463
14464
14465
14466
14467
14468
14469
14470
14471
14472
14473
14474
14475
14476
14477
14478
14479
14480
14481
14482
14483
14484
14485
14486
14487
14488
14489
14490
14491
14492






14493
14494
14495
14496
14497
14498
14499
14500
14501
14502
14503
14504
14505
14506
14507
14508
|   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_CLEAR_C
+--->BN_MP_INIT_C
+--->BN_MP_ADD_D_C
|   +--->BN_MP_GROW_C
|   +--->BN_MP_CLAMP_C
+--->BN_MP_PRIME_IS_PRIME_C
|   +--->BN_MP_IS_SQUARE_C
|   |   +--->BN_MP_INIT_SET_INT_C
|   |   |   +--->BN_MP_SET_INT_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_MOD_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_DIV_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_ADD_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_GET_INT_C
|   |   +--->BN_MP_SQRT_C
|   |   |   +--->BN_MP_N_ROOT_C
|   |   |   |   +--->BN_MP_N_ROOT_EX_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_EXPT_D_EX_C
|   |   |   |   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_MUL_C
|   |   |   |   |   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_SQR_C
|   |   |   |   |   |   |   +--->BN_MP_TOOM_SQR_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   |   +--->BN_MP_KARATSUBA_SQR_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_FAST_S_MP_SQR_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_SQR_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_MUL_C
|   |   |   |   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_DIV_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_ADD_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_SQR_C
|   |   |   +--->BN_MP_TOOM_SQR_C
|   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_KARATSUBA_SQR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_FAST_S_MP_SQR_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_S_MP_SQR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_CMP_MAG_C
|   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_PRIME_IS_DIVISIBLE_C
|   +--->BN_MP_INIT_SET_C
|   +--->BN_MP_PRIME_MILLER_RABIN_C
|   |   +--->BN_MP_INIT_COPY_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_CNT_LSB_C
|   |   +--->BN_MP_DIV_2D_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_EXPTMOD_C
|   |   |   +--->BN_MP_INVMOD_C
|   |   |   |   +--->BN_FAST_MP_INVMOD_C
|   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_MOD_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_INVMOD_SLOW_C
|   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_MOD_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_ABS_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   +--->BN_MP_REDUCE_IS_2K_L_C
|   |   |   +--->BN_S_MP_EXPTMOD_C
|   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   +--->BN_MP_REDUCE_SETUP_C
|   |   |   |   |   +--->BN_MP_2EXPT_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_REDUCE_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_MUL_C
|   |   |   |   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_S_MP_MUL_HIGH_DIGS_C
|   |   |   |   |   |   +--->BN_FAST_S_MP_MUL_HIGH_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_FAST_S_MP_MUL_HIGH_DIGS_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_REDUCE_2K_SETUP_L_C
|   |   |   |   |   +--->BN_MP_2EXPT_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_REDUCE_2K_L_C
|   |   |   |   |   +--->BN_MP_MUL_C
|   |   |   |   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MOD_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_SQR_C
|   |   |   |   |   +--->BN_MP_TOOM_SQR_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_KARATSUBA_SQR_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_FAST_S_MP_SQR_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SQR_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_MUL_C
|   |   |   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_DR_IS_MODULUS_C
|   |   |   +--->BN_MP_REDUCE_IS_2K_C
|   |   |   |   +--->BN_MP_REDUCE_2K_C
|   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   +--->BN_MP_EXPTMOD_FAST_C
|   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_MONTGOMERY_SETUP_C
|   |   |   |   +--->BN_FAST_MP_MONTGOMERY_REDUCE_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_MONTGOMERY_REDUCE_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_DR_SETUP_C
|   |   |   |   +--->BN_MP_DR_REDUCE_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_REDUCE_2K_SETUP_C
|   |   |   |   |   +--->BN_MP_2EXPT_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_REDUCE_2K_C
|   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MONTGOMERY_CALC_NORMALIZATION_C
|   |   |   |   |   +--->BN_MP_2EXPT_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MULMOD_C
|   |   |   |   |   +--->BN_MP_MUL_C
|   |   |   |   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_MOD_C
|   |   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MOD_C
|   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_SQR_C
|   |   |   |   |   +--->BN_MP_TOOM_SQR_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_KARATSUBA_SQR_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_FAST_S_MP_SQR_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SQR_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_MUL_C
|   |   |   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_CMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   +--->BN_MP_SQRMOD_C
|   |   |   +--->BN_MP_SQR_C
|   |   |   |   +--->BN_MP_TOOM_SQR_C
|   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_KARATSUBA_SQR_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_FAST_S_MP_SQR_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_SQR_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_MOD_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_PRIME_FROBENIUS_UNDERWOOD_C
|   |   +--->BN_MP_INIT_MULTI_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_SET_LONG_C
|   |   +--->BN_MP_SQR_C
|   |   |   +--->BN_MP_TOOM_SQR_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_KARATSUBA_SQR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_FAST_S_MP_SQR_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_S_MP_SQR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_KRONECKER_C
|   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_CNT_LSB_C
|   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_MOD_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_GCD_C
|   |   |   +--->BN_MP_ABS_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_CNT_LSB_C
|   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_COUNT_BITS_C
|   |   +--->BN_MP_MUL_2_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_MUL_D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_ADD_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_MUL_C
|   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_SUB_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_MOD_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_DIV_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_GET_BIT_C
|   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_CMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_PRIME_STRONG_LUCAS_SELFRIDGE_C
|   |   +--->BN_MP_MUL_D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_SET_LONG_C
|   |   +--->BN_MP_MUL_C
|   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_INIT_MULTI_C
|   |   +--->BN_MP_GCD_C
|   |   |   +--->BN_MP_ABS_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CNT_LSB_C
|   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   +--->BN_MP_KRONECKER_C
|   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CNT_LSB_C
|   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_MOD_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CNT_LSB_C
|   |   +--->BN_MP_DIV_2D_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_MUL_2_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_COUNT_BITS_C
|   |   +--->BN_MP_MOD_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_DIV_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_ADD_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_SQR_C
|   |   |   +--->BN_MP_TOOM_SQR_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   +--->BN_MP_KARATSUBA_SQR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_FAST_S_MP_SQR_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_S_MP_SQR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_SUB_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_GET_BIT_C
|   |   +--->BN_MP_ADD_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_DIV_2_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CLEAR_MULTI_C
|   +--->BN_MP_READ_RADIX_C
|   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_MUL_D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CMP_C
|   |   +--->BN_MP_CMP_MAG_C
|   +--->BN_MP_COUNT_BITS_C
|   +--->BN_MP_RAND_C
|   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_LSHD_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_RSHD_C
|   +--->BN_MP_DIV_2D_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_MOD_2D_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_RSHD_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CLEAR_C
+--->BN_MP_CLEAR_C


BN_MP_PRIME_RABIN_MILLER_TRIALS_C


BN_MP_PRIME_RANDOM_EX_C
+--->BN_MP_READ_UNSIGNED_BIN_C
|   +--->BN_MP_GROW_C
|   +--->BN_MP_ZERO_C
|   +--->BN_MP_MUL_2D_C
|   |   +--->BN_MP_COPY_C
|   |   +--->BN_MP_LSHD_C
|   |   |   +--->BN_MP_RSHD_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CLAMP_C
+--->BN_MP_PRIME_IS_PRIME_C
|   +--->BN_MP_IS_SQUARE_C
|   |   +--->BN_MP_MOD_D_C
|   |   |   +--->BN_MP_DIV_D_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_INIT_SET_INT_C
|   |   |   +--->BN_MP_INIT_C
|   |   |   +--->BN_MP_SET_INT_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_MOD_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_INIT_C
|   |   |   +--->BN_MP_DIV_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_SET_C
|   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_ADD_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_GET_INT_C
|   |   +--->BN_MP_SQRT_C
|   |   |   +--->BN_MP_N_ROOT_C
|   |   |   |   +--->BN_MP_N_ROOT_EX_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_EXPT_D_EX_C
|   |   |   |   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_MUL_C
|   |   |   |   |   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_SQR_C
|   |   |   |   |   |   |   +--->BN_MP_TOOM_SQR_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   |   +--->BN_MP_KARATSUBA_SQR_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_FAST_S_MP_SQR_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_SQR_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_MUL_C
|   |   |   |   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_C







|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_SUB_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ADD_D_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_DIV_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_SET_C
|   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_ADD_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_SQR_C
|   |   |   +--->BN_MP_TOOM_SQR_C
|   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_KARATSUBA_SQR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_FAST_S_MP_SQR_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_S_MP_SQR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_CMP_MAG_C
|   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_CMP_D_C
|   +--->BN_MP_PRIME_IS_DIVISIBLE_C
|   |   +--->BN_MP_MOD_D_C
|   |   |   +--->BN_MP_DIV_D_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_INIT_SET_C
|   |   +--->BN_MP_INIT_C
|   |   +--->BN_MP_SET_C
|   |   |   +--->BN_MP_ZERO_C
|   +--->BN_MP_PRIME_MILLER_RABIN_C
|   |   +--->BN_MP_INIT_COPY_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_SUB_D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_ADD_D_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CNT_LSB_C
|   |   +--->BN_MP_DIV_2D_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_EXPTMOD_C
|   |   |   +--->BN_MP_INVMOD_C
|   |   |   |   +--->BN_FAST_MP_INVMOD_C
|   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_MOD_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_INVMOD_SLOW_C
|   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_MOD_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_ABS_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   +--->BN_MP_REDUCE_IS_2K_L_C
|   |   |   +--->BN_S_MP_EXPTMOD_C
|   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   +--->BN_MP_REDUCE_SETUP_C
|   |   |   |   |   +--->BN_MP_2EXPT_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_REDUCE_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_MUL_C
|   |   |   |   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_S_MP_MUL_HIGH_DIGS_C
|   |   |   |   |   |   +--->BN_FAST_S_MP_MUL_HIGH_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_FAST_S_MP_MUL_HIGH_DIGS_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_REDUCE_2K_SETUP_L_C
|   |   |   |   |   +--->BN_MP_2EXPT_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_REDUCE_2K_L_C
|   |   |   |   |   +--->BN_MP_MUL_C
|   |   |   |   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C






|   |   |   |   +--->BN_MP_MOD_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_SUB_C
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_ABS_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLEAR_MULTI_C
|   |   +--->BN_MP_REDUCE_IS_2K_L_C
|   |   +--->BN_S_MP_EXPTMOD_C
|   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   +--->BN_MP_REDUCE_SETUP_C
|   |   |   |   +--->BN_MP_2EXPT_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_REDUCE_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_MUL_C
|   |   |   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_S_MP_MUL_HIGH_DIGS_C
|   |   |   |   |   +--->BN_FAST_S_MP_MUL_HIGH_DIGS_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_FAST_S_MP_MUL_HIGH_DIGS_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_REDUCE_2K_SETUP_L_C
|   |   |   |   +--->BN_MP_2EXPT_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_REDUCE_2K_L_C
|   |   |   |   +--->BN_MP_MUL_C
|   |   |   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C







<
<








<
<











|
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<



<
<

|
|


































|




<
<
<
<




<
|
|
<
|
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|


|
<
<
<
<
|

<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<





<
<

<
<







14516
14517
14518
14519
14520
14521
14522


14523
14524
14525
14526
14527
14528
14529
14530


14531
14532
14533
14534
14535
14536
14537
14538
14539
14540
14541
14542
14543












































































14544
14545
14546


14547
14548
14549
14550
14551
14552
14553
14554
14555
14556
14557
14558
14559
14560
14561
14562
14563
14564
14565
14566
14567
14568
14569
14570
14571
14572
14573
14574
14575
14576
14577
14578
14579
14580
14581
14582
14583
14584
14585
14586
14587
14588




14589
14590
14591
14592

14593
14594

14595

14596
















14597
14598
14599
14600




14601
14602


14603
























14604
14605
14606
14607
14608


14609


14610
14611
14612
14613
14614
14615
14616
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C


|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C


|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_SQR_C
|   |   |   |   |   +--->BN_MP_TOOM_SQR_C












































































|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C


|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_KARATSUBA_SQR_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C




|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C

|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C

|   |   |   |   |   |   +--->BN_MP_ADD_C

|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
















|   |   |   |   |   +--->BN_FAST_S_MP_SQR_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SQR_C




|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C


|   |   |   |   |   |   +--->BN_MP_EXCH_C
























|   |   |   |   +--->BN_MP_MUL_C
|   |   |   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C


|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C


|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197


8198


8199
8200

8201

8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222

8223
8224
8225
8226
8227
8228
8229
8230
8231
8232

8233

8234
8235

8236

8237
8238
8239
8240

8241
8242

8243
8244



8245

8246

8247

8248







8249







8250


8251



8252





8253

8254
8255
8256
8257
8258



8259

8260
8261


8262
8263
8264
8265
8266
8267
8268
8269

8270

8271

8272
8273




8274
8275






8276






8277
8278
8279

8280
8281
8282
8283
8284
8285
8286





8287

8288
8289
8290
8291
8292
8293
8294
8295
8296
8297




8298
8299






8300






8301
8302


8303
8304
8305

8306

8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
|   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_MOD_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C


|   |   |   |   |   |   |   +--->BN_MP_RSHD_C


|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_C

|   |   |   |   |   +--->BN_MP_SUB_C

|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C

|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C

|   |   |   +--->BN_MP_COPY_C

|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_SQR_C

|   |   |   |   +--->BN_MP_TOOM_SQR_C

|   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C

|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C

|   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   +--->BN_MP_GROW_C



|   |   |   |   |   +--->BN_MP_ADD_C

|   |   |   |   |   |   +--->BN_S_MP_ADD_C

|   |   |   |   |   |   |   +--->BN_MP_GROW_C

|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C







|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C







|   |   |   |   |   |   +--->BN_S_MP_SUB_C


|   |   |   |   |   |   |   +--->BN_MP_GROW_C



|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C





|   |   |   |   |   +--->BN_MP_SUB_C

|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C



|   |   |   |   |   |   |   +--->BN_MP_GROW_C

|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_DIV_2_C


|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C

|   |   |   |   |   |   +--->BN_MP_CLAMP_C

|   |   |   |   |   +--->BN_MP_DIV_3_C

|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C




|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_LSHD_C






|   |   |   |   |   |   +--->BN_MP_GROW_C






|   |   |   |   +--->BN_MP_KARATSUBA_SQR_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_CLAMP_C

|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C





|   |   |   |   |   |   |   +--->BN_MP_ZERO_C

|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_FAST_S_MP_SQR_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_SQR_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_MUL_C




|   |   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   |   +--->BN_MP_INIT_MULTI_C






|   |   |   |   |   +--->BN_MP_MOD_2D_C






|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C


|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_MUL_2_C

|   |   |   |   |   |   +--->BN_MP_GROW_C

|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_DR_IS_MODULUS_C
|   |   +--->BN_MP_REDUCE_IS_2K_C
|   |   |   +--->BN_MP_REDUCE_2K_C
|   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_COUNT_BITS_C
|   |   +--->BN_MP_EXPTMOD_FAST_C
|   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_MONTGOMERY_SETUP_C
|   |   |   +--->BN_FAST_MP_MONTGOMERY_REDUCE_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   +--->BN_MP_MONTGOMERY_REDUCE_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   +--->BN_MP_DR_SETUP_C
|   |   |   +--->BN_MP_DR_REDUCE_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   +--->BN_MP_REDUCE_2K_SETUP_C
|   |   |   |   +--->BN_MP_2EXPT_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_REDUCE_2K_C
|   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_MONTGOMERY_CALC_NORMALIZATION_C
|   |   |   |   +--->BN_MP_2EXPT_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_MULMOD_C
|   |   |   |   +--->BN_MP_MUL_C
|   |   |   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C







|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
>
|
>
>
|
|
>
|
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|


>
|
|
|







>
|
>
|
|
>
|
>
|
|
|

>
|
|
>
|
|
>
>
>
|
>
|
>
|
>
|
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
|
>
>
|
>
>
>
|
>
>
>
>
>
|
>
|
|
|
|
|
>
>
>
|
>
|
|
>
>
|
|
|
|
|
|
|
|
>
|
>
|
>
|
|
>
>
>
>
|
|
>
>
>
>
>
>
|
>
>
>
>
>
>
|
|
|
>
|
|
|
|
|
|
|
>
>
>
>
>
|
>
|
|
|
|
|
|
|
|
|
|
>
>
>
>
|
|
>
>
>
>
>
>
|
>
>
>
>
>
>
|
|
>
>
|
|
|
>
|
>








|
<
<
<
<
<
<
<
|
|
<
|
|
|
|
<
|
|
<
<
|
|
<
|
<
<
<
<
|
|
|
|
|
<
|
|
|
|
|
<
|
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
|
|
|
|
<
<
<
<
<
<
|
<
|
|
|
|
<
|
|
|
|
|
<
<
<
|
|
|
<
<
|
|
|
<
|
|
<
|
|
|
<
|
|
|
<
|
|
<
|
|
|
|
|
<
<
|
|
<





<
<

<
<







14661
14662
14663
14664
14665
14666
14667
14668
14669
14670
14671
14672
14673
14674
14675
14676
14677
14678
14679
14680
14681
14682
14683
14684
14685
14686
14687
14688
14689
14690
14691
14692
14693
14694
14695
14696
14697
14698
14699
14700
14701
14702
14703
14704
14705
14706
14707
14708
14709
14710
14711
14712
14713
14714
14715
14716
14717
14718
14719
14720
14721
14722
14723
14724
14725
14726
14727
14728
14729
14730
14731
14732
14733
14734
14735
14736
14737
14738
14739
14740
14741
14742
14743
14744
14745
14746
14747
14748
14749
14750
14751
14752
14753
14754
14755
14756
14757
14758
14759
14760
14761
14762
14763
14764
14765
14766
14767
14768
14769
14770
14771
14772
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785
14786
14787
14788
14789
14790
14791
14792
14793
14794
14795
14796
14797
14798
14799
14800
14801
14802
14803
14804
14805
14806
14807
14808
14809
14810
14811
14812
14813
14814
14815
14816
14817
14818
14819
14820
14821
14822
14823
14824
14825
14826
14827
14828
14829
14830
14831
14832
14833
14834
14835
14836
14837
14838
14839
14840
14841
14842
14843
14844
14845
14846
14847
14848
14849
14850
14851
14852
14853
14854
14855
14856
14857
14858
14859
14860
14861
14862
14863
14864
14865
14866
14867
14868
14869
14870
14871
14872
14873
14874
14875
14876
14877
14878
14879
14880
14881
14882
14883
14884
14885
14886
14887
14888
14889
14890
14891
14892
14893
14894
14895
14896
14897
14898
14899







14900
14901

14902
14903
14904
14905

14906
14907


14908
14909

14910




14911
14912
14913
14914
14915

14916
14917
14918
14919
14920

14921




14922











14923
14924
14925
14926






14927

14928
14929
14930
14931

14932
14933
14934
14935
14936



14937
14938
14939


14940
14941
14942

14943
14944

14945
14946
14947

14948
14949
14950

14951
14952

14953
14954
14955
14956
14957


14958
14959

14960
14961
14962
14963
14964


14965


14966
14967
14968
14969
14970
14971
14972
|   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_DR_IS_MODULUS_C
|   |   |   +--->BN_MP_REDUCE_IS_2K_C
|   |   |   |   +--->BN_MP_REDUCE_2K_C
|   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   +--->BN_MP_EXPTMOD_FAST_C
|   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_MONTGOMERY_SETUP_C
|   |   |   |   +--->BN_FAST_MP_MONTGOMERY_REDUCE_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_MONTGOMERY_REDUCE_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_DR_SETUP_C
|   |   |   |   +--->BN_MP_DR_REDUCE_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_REDUCE_2K_SETUP_C
|   |   |   |   |   +--->BN_MP_2EXPT_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_REDUCE_2K_C
|   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MONTGOMERY_CALC_NORMALIZATION_C
|   |   |   |   |   +--->BN_MP_2EXPT_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MULMOD_C
|   |   |   |   |   +--->BN_MP_MUL_C
|   |   |   |   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_MOD_C
|   |   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_MOD_C
|   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_COPY_C







|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_SQR_C

|   |   |   |   |   +--->BN_MP_TOOM_SQR_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C

|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C


|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_MUL_2_C

|   |   |   |   |   |   |   +--->BN_MP_GROW_C




|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C

|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C

|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C




|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C











|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C






|   |   |   |   |   |   +--->BN_MP_DIV_2_C

|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C

|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C



|   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C


|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_KARATSUBA_SQR_C

|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C

|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C

|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C

|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_ADD_C

|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_FAST_S_MP_SQR_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SQR_C


|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C

|   |   |   |   +--->BN_MP_MUL_C
|   |   |   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C


|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C


|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589

8590
8591


8592


8593
8594
8595
8596
8597
8598
8599
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_MOD_C
|   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_MOD_C
|   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_SQR_C
|   |   |   |   +--->BN_MP_TOOM_SQR_C
|   |   |   |   |   +--->BN_MP_INIT_MULTI_C

|   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C


|   |   |   |   |   |   +--->BN_MP_CLAMP_C


|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

<
<
<
<
|
<
<
<
|
|



>


>
>

>
>







15014
15015
15016
15017
15018
15019
15020

















































































15021




15022



15023
15024
15025
15026
15027
15028
15029
15030
15031
15032
15033
15034
15035
15036
15037
15038
15039
15040
15041
15042
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C

















































































|   |   |   |   +--->BN_MP_EXCH_C




|   |   +--->BN_MP_CMP_C



|   |   |   +--->BN_MP_CMP_MAG_C
|   |   +--->BN_MP_SQRMOD_C
|   |   |   +--->BN_MP_SQR_C
|   |   |   |   +--->BN_MP_TOOM_SQR_C
|   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
8617
8618
8619
8620
8621
8622
8623

8624
8625

8626
8627


8628

8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639

8640
8641
8642
8643

8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668






8669
8670
8671

8672

8673




8674























































































































8675
8676
8677

8678






















8679
8680
8681








8682


8683






























8684













































8685



8686





8687





















































































8688







8689
8690



























































































































8691
8692


8693
8694














8695
8696






























8697




8698
8699






























8700



8701
8702




















8703
8704





8705
8706



8707





















































8708
8709







































8710



















































































































































































































































































































































































































































8711
8712
8713

8714
8715
8716
8717
8718
8719
8720
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_DIV_3_C

|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C

|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C


|   |   |   |   +--->BN_MP_KARATSUBA_SQR_C

|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C

|   |   |   |   +--->BN_FAST_S_MP_SQR_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_SQR_C

|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_MUL_C
|   |   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C






|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C

|   |   |   |   |   +--->BN_MP_DIV_2_C

|   |   |   |   |   |   +--->BN_MP_GROW_C




|   |   |   |   |   |   +--->BN_MP_CLAMP_C























































































































|   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C

|   |   |   |   |   |   +--->BN_MP_CLAMP_C






















|   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C








|   |   |   |   |   +--->BN_MP_DIV_3_C


|   |   |   |   |   |   +--->BN_MP_CLAMP_C






























|   |   |   |   |   |   +--->BN_MP_EXCH_C













































|   |   |   |   |   +--->BN_MP_LSHD_C



|   |   |   |   |   |   +--->BN_MP_GROW_C





|   |   |   |   +--->BN_MP_KARATSUBA_MUL_C





















































































|   |   |   |   |   +--->BN_MP_CLAMP_C







|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C



























































































































|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C


|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C














|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C






























|   |   |   |   |   +--->BN_MP_LSHD_C




|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C






























|   |   |   |   |   |   |   +--->BN_MP_ZERO_C



|   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   +--->BN_MP_GROW_C




















|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_MUL_DIGS_C





|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C



|   |   |   +--->BN_MP_EXCH_C





















































|   +--->BN_MP_CMP_C
|   |   +--->BN_MP_CMP_MAG_C







































|   +--->BN_MP_SQRMOD_C



















































































































































































































































































































































































































































|   |   +--->BN_MP_SQR_C
|   |   |   +--->BN_MP_TOOM_SQR_C
|   |   |   |   +--->BN_MP_INIT_MULTI_C

|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_COPY_C







>


>


>
>

>











>




>


|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|




|
>
>
>
>
>
>



>
|
>

>
>
>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



>
>
>
>
>
>
>
>
|
>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>
>
>
|
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>
>
>
>
>
>
>


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

|
>
>


>
>
>
>
>
>
>
>
>
>
>
>
>
>


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>
>
>
>

|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
|

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

|
>
>
>
>
>


>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



>







15060
15061
15062
15063
15064
15065
15066
15067
15068
15069
15070
15071
15072
15073
15074
15075
15076
15077
15078
15079
15080
15081
15082
15083
15084
15085
15086
15087
15088
15089
15090
15091
15092
15093
15094
15095
15096
15097
15098
15099
15100
15101
15102
15103
15104
15105
15106
15107
15108
15109
15110
15111
15112
15113
15114
15115
15116
15117
15118
15119
15120
15121
15122
15123
15124
15125
15126
15127
15128
15129
15130
15131
15132
15133
15134
15135
15136
15137
15138
15139
15140
15141
15142
15143
15144
15145
15146
15147
15148
15149
15150
15151
15152
15153
15154
15155
15156
15157
15158
15159
15160
15161
15162
15163
15164
15165
15166
15167
15168
15169
15170
15171
15172
15173
15174
15175
15176
15177
15178
15179
15180
15181
15182
15183
15184
15185
15186
15187
15188
15189
15190
15191
15192
15193
15194
15195
15196
15197
15198
15199
15200
15201
15202
15203
15204
15205
15206
15207
15208
15209
15210
15211
15212
15213
15214
15215
15216
15217
15218
15219
15220
15221
15222
15223
15224
15225
15226
15227
15228
15229
15230
15231
15232
15233
15234
15235
15236
15237
15238
15239
15240
15241
15242
15243
15244
15245
15246
15247
15248
15249
15250
15251
15252
15253
15254
15255
15256
15257
15258
15259
15260
15261
15262
15263
15264
15265
15266
15267
15268
15269
15270
15271
15272
15273
15274
15275
15276
15277
15278
15279
15280
15281
15282
15283
15284
15285
15286
15287
15288
15289
15290
15291
15292
15293
15294
15295
15296
15297
15298
15299
15300
15301
15302
15303
15304
15305
15306
15307
15308
15309
15310
15311
15312
15313
15314
15315
15316
15317
15318
15319
15320
15321
15322
15323
15324
15325
15326
15327
15328
15329
15330
15331
15332
15333
15334
15335
15336
15337
15338
15339
15340
15341
15342
15343
15344
15345
15346
15347
15348
15349
15350
15351
15352
15353
15354
15355
15356
15357
15358
15359
15360
15361
15362
15363
15364
15365
15366
15367
15368
15369
15370
15371
15372
15373
15374
15375
15376
15377
15378
15379
15380
15381
15382
15383
15384
15385
15386
15387
15388
15389
15390
15391
15392
15393
15394
15395
15396
15397
15398
15399
15400
15401
15402
15403
15404
15405
15406
15407
15408
15409
15410
15411
15412
15413
15414
15415
15416
15417
15418
15419
15420
15421
15422
15423
15424
15425
15426
15427
15428
15429
15430
15431
15432
15433
15434
15435
15436
15437
15438
15439
15440
15441
15442
15443
15444
15445
15446
15447
15448
15449
15450
15451
15452
15453
15454
15455
15456
15457
15458
15459
15460
15461
15462
15463
15464
15465
15466
15467
15468
15469
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
15483
15484
15485
15486
15487
15488
15489
15490
15491
15492
15493
15494
15495
15496
15497
15498
15499
15500
15501
15502
15503
15504
15505
15506
15507
15508
15509
15510
15511
15512
15513
15514
15515
15516
15517
15518
15519
15520
15521
15522
15523
15524
15525
15526
15527
15528
15529
15530
15531
15532
15533
15534
15535
15536
15537
15538
15539
15540
15541
15542
15543
15544
15545
15546
15547
15548
15549
15550
15551
15552
15553
15554
15555
15556
15557
15558
15559
15560
15561
15562
15563
15564
15565
15566
15567
15568
15569
15570
15571
15572
15573
15574
15575
15576
15577
15578
15579
15580
15581
15582
15583
15584
15585
15586
15587
15588
15589
15590
15591
15592
15593
15594
15595
15596
15597
15598
15599
15600
15601
15602
15603
15604
15605
15606
15607
15608
15609
15610
15611
15612
15613
15614
15615
15616
15617
15618
15619
15620
15621
15622
15623
15624
15625
15626
15627
15628
15629
15630
15631
15632
15633
15634
15635
15636
15637
15638
15639
15640
15641
15642
15643
15644
15645
15646
15647
15648
15649
15650
15651
15652
15653
15654
15655
15656
15657
15658
15659
15660
15661
15662
15663
15664
15665
15666
15667
15668
15669
15670
15671
15672
15673
15674
15675
15676
15677
15678
15679
15680
15681
15682
15683
15684
15685
15686
15687
15688
15689
15690
15691
15692
15693
15694
15695
15696
15697
15698
15699
15700
15701
15702
15703
15704
15705
15706
15707
15708
15709
15710
15711
15712
15713
15714
15715
15716
15717
15718
15719
15720
15721
15722
15723
15724
15725
15726
15727
15728
15729
15730
15731
15732
15733
15734
15735
15736
15737
15738
15739
15740
15741
15742
15743
15744
15745
15746
15747
15748
15749
15750
15751
15752
15753
15754
15755
15756
15757
15758
15759
15760
15761
15762
15763
15764
15765
15766
15767
15768
15769
15770
15771
15772
15773
15774
15775
15776
15777
15778
15779
15780
15781
15782
15783
15784
15785
15786
15787
15788
15789
15790
15791
15792
15793
15794
15795
15796
15797
15798
15799
15800
15801
15802
15803
15804
15805
15806
15807
15808
15809
15810
15811
15812
15813
15814
15815
15816
15817
15818
15819
15820
15821
15822
15823
15824
15825
15826
15827
15828
15829
15830
15831
15832
15833
15834
15835
15836
15837
15838
15839
15840
15841
15842
15843
15844
15845
15846
15847
15848
15849
15850
15851
15852
15853
15854
15855
15856
15857
15858
15859
15860
15861
15862
15863
15864
15865
15866
15867
15868
15869
15870
15871
15872
15873
15874
15875
15876
15877
15878
15879
15880
15881
15882
15883
15884
15885
15886
15887
15888
15889
15890
15891
15892
15893
15894
15895
15896
15897
15898
15899
15900
15901
15902
15903
15904
15905
15906
15907
15908
15909
15910
15911
15912
15913
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
16001
16002
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
16196
16197
16198
16199
16200
16201
16202
16203
16204
16205
16206
16207
16208
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_KARATSUBA_SQR_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_FAST_S_MP_SQR_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_SQR_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_MOD_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_PRIME_FROBENIUS_UNDERWOOD_C
|   |   +--->BN_MP_INIT_MULTI_C
|   |   |   +--->BN_MP_INIT_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_SET_LONG_C
|   |   +--->BN_MP_SQR_C
|   |   |   +--->BN_MP_TOOM_SQR_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_KARATSUBA_SQR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_FAST_S_MP_SQR_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_S_MP_SQR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_SUB_D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_ADD_D_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_KRONECKER_C
|   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_CNT_LSB_C
|   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_MOD_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_GCD_C
|   |   |   +--->BN_MP_ABS_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_CNT_LSB_C
|   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_ADD_D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_SET_C
|   |   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_COUNT_BITS_C
|   |   +--->BN_MP_MUL_2_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_MUL_D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_ADD_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_MUL_C
|   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_SUB_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_MOD_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_INIT_C
|   |   |   +--->BN_MP_DIV_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_GET_BIT_C
|   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_CMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_PRIME_STRONG_LUCAS_SELFRIDGE_C
|   |   +--->BN_MP_MUL_D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_INIT_C
|   |   +--->BN_MP_SET_LONG_C
|   |   +--->BN_MP_MUL_C
|   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_INIT_MULTI_C
|   |   +--->BN_MP_GCD_C
|   |   |   +--->BN_MP_ABS_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CNT_LSB_C
|   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   +--->BN_MP_KRONECKER_C
|   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CNT_LSB_C
|   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_MOD_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_ADD_D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_SUB_D_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CNT_LSB_C
|   |   +--->BN_MP_DIV_2D_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_SET_C
|   |   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_MUL_2_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_COUNT_BITS_C
|   |   +--->BN_MP_MOD_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_DIV_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_ADD_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_SQR_C
|   |   |   +--->BN_MP_TOOM_SQR_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   +--->BN_MP_KARATSUBA_SQR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_FAST_S_MP_SQR_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_S_MP_SQR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_SUB_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_GET_BIT_C
|   |   +--->BN_MP_ADD_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_DIV_2_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_SUB_D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CLEAR_MULTI_C
|   +--->BN_MP_READ_RADIX_C
|   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_MUL_D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_ADD_D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_SUB_D_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CMP_C
|   |   +--->BN_MP_CMP_MAG_C
|   +--->BN_MP_SET_C
|   |   +--->BN_MP_ZERO_C
|   +--->BN_MP_COUNT_BITS_C
|   +--->BN_MP_RAND_C
|   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_ADD_D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_SUB_D_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_LSHD_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_RSHD_C
|   +--->BN_MP_DIV_2D_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_MOD_2D_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_RSHD_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CLEAR_C
+--->BN_MP_SUB_D_C
|   +--->BN_MP_GROW_C
|   +--->BN_MP_ADD_D_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CLAMP_C
+--->BN_MP_DIV_2_C
|   +--->BN_MP_GROW_C
|   +--->BN_MP_CLAMP_C
+--->BN_MP_MUL_2_C
|   +--->BN_MP_GROW_C
+--->BN_MP_ADD_D_C
|   +--->BN_MP_GROW_C
|   +--->BN_MP_CLAMP_C


BN_MP_PRIME_STRONG_LUCAS_SELFRIDGE_C
+--->BN_MP_PRIME_IS_PRIME_C
|   +--->BN_MP_IS_SQUARE_C
|   |   +--->BN_MP_MOD_D_C
|   |   |   +--->BN_MP_DIV_D_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_INIT_SET_INT_C
|   |   |   +--->BN_MP_INIT_C
|   |   |   +--->BN_MP_SET_INT_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_MOD_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_INIT_C
|   |   |   +--->BN_MP_DIV_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_SET_C
|   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_ADD_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_GET_INT_C
|   |   +--->BN_MP_SQRT_C
|   |   |   +--->BN_MP_N_ROOT_C
|   |   |   |   +--->BN_MP_N_ROOT_EX_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_EXPT_D_EX_C
|   |   |   |   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_MUL_C
|   |   |   |   |   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_SQR_C
|   |   |   |   |   |   |   +--->BN_MP_TOOM_SQR_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   |   +--->BN_MP_KARATSUBA_SQR_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_FAST_S_MP_SQR_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_SQR_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_MUL_C
|   |   |   |   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_SUB_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ADD_D_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_DIV_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_SET_C
|   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_ADD_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_SQR_C
|   |   |   +--->BN_MP_TOOM_SQR_C
|   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_COPY_C
8747
8748
8749
8750
8751
8752
8753

8754
8755
8756
8757
8758
8759
8760
8761
8762

8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779

8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C

|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_KARATSUBA_SQR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C

|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_FAST_S_MP_SQR_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_S_MP_SQR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C

|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_MOD_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_DIV_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_ADD_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CLEAR_C
+--->BN_MP_CLEAR_C


BN_MP_PRIME_RABIN_MILLER_TRIALS_C


BN_MP_PRIME_RANDOM_EX_C
+--->BN_MP_READ_UNSIGNED_BIN_C
|   +--->BN_MP_GROW_C
|   +--->BN_MP_ZERO_C
|   +--->BN_MP_MUL_2D_C
|   |   +--->BN_MP_COPY_C
|   |   +--->BN_MP_LSHD_C
|   |   |   +--->BN_MP_RSHD_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CLAMP_C
+--->BN_MP_PRIME_IS_PRIME_C
|   +--->BN_MP_CMP_D_C
|   +--->BN_MP_PRIME_IS_DIVISIBLE_C
|   |   +--->BN_MP_MOD_D_C
|   |   |   +--->BN_MP_DIV_D_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_DIV_2D_C







>









>

















>



|
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321
16322
16323
16324
16325
16326
16327
16328
16329
16330
16331
16332
16333
16334
16335
16336
16337
16338

































































16339
16340
16341
16342
16343
16344
16345
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_KARATSUBA_SQR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_FAST_S_MP_SQR_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_S_MP_SQR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_CMP_MAG_C
|   |   +--->BN_MP_CLEAR_C

































































|   +--->BN_MP_CMP_D_C
|   +--->BN_MP_PRIME_IS_DIVISIBLE_C
|   |   +--->BN_MP_MOD_D_C
|   |   |   +--->BN_MP_DIV_D_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_DIV_2D_C
8866
8867
8868
8869
8870
8871
8872
8873

8874
8875
8876
8877
8878
8879
8880
8881
8882
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_INIT_C

|   +--->BN_MP_SET_C
|   |   +--->BN_MP_ZERO_C
|   +--->BN_MP_PRIME_MILLER_RABIN_C
|   |   +--->BN_MP_INIT_COPY_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_SUB_D_C







|
>
|
|







16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
16369
16370
16371
16372
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_INIT_SET_C
|   |   +--->BN_MP_INIT_C
|   |   +--->BN_MP_SET_C
|   |   |   +--->BN_MP_ZERO_C
|   +--->BN_MP_PRIME_MILLER_RABIN_C
|   |   +--->BN_MP_INIT_COPY_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_SUB_D_C
8901
8902
8903
8904
8905
8906
8907

8908
8909
8910
8911
8912
8913
8914
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_MOD_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C

|   |   |   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C







>







16391
16392
16393
16394
16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_MOD_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
8945
8946
8947
8948
8949
8950
8951


8952
8953
8954
8955
8956
8957
8958
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C


|   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C







>
>







16436
16437
16438
16439
16440
16441
16442
16443
16444
16445
16446
16447
16448
16449
16450
16451
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
8966
8967
8968
8969
8970
8971
8972

8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985

8986
8987
8988
8989
8990
8991
8992
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C

|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_INVMOD_SLOW_C
|   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_MOD_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C

|   |   |   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C







>













>







16459
16460
16461
16462
16463
16464
16465
16466
16467
16468
16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
16487
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_INVMOD_SLOW_C
|   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_MOD_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
9025
9026
9027
9028
9029
9030
9031


9032
9033
9034
9035
9036
9037
9038
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C


|   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C







>
>







16520
16521
16522
16523
16524
16525
16526
16527
16528
16529
16530
16531
16532
16533
16534
16535
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
9068
9069
9070
9071
9072
9073
9074

9075
9076
9077
9078
9079
9080
9081
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C

|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_SUB_C







>







16565
16566
16567
16568
16569
16570
16571
16572
16573
16574
16575
16576
16577
16578
16579
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_SUB_C
9195
9196
9197
9198
9199
9200
9201


9202
9203
9204
9205
9206
9207
9208
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C


|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C







>
>







16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
9301
9302
9303
9304
9305
9306
9307

9308
9309
9310
9311
9312
9313
9314
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C

|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_SUB_C







>







16801
16802
16803
16804
16805
16806
16807
16808
16809
16810
16811
16812
16813
16814
16815
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   +--->BN_MP_SUB_C
9467
9468
9469
9470
9471
9472
9473


9474
9475
9476
9477
9478
9479
9480
|   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C


|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_DR_IS_MODULUS_C
|   |   |   +--->BN_MP_REDUCE_IS_2K_C
|   |   |   |   +--->BN_MP_REDUCE_2K_C
|   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C







>
>







16968
16969
16970
16971
16972
16973
16974
16975
16976
16977
16978
16979
16980
16981
16982
16983
|   |   |   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_DR_IS_MODULUS_C
|   |   |   +--->BN_MP_REDUCE_IS_2K_C
|   |   |   |   +--->BN_MP_REDUCE_2K_C
|   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
9529
9530
9531
9532
9533
9534
9535


9536
9537
9538
9539
9540
9541
9542
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MONTGOMERY_CALC_NORMALIZATION_C
|   |   |   |   |   +--->BN_MP_2EXPT_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_GROW_C


|   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MULMOD_C







>
>







17032
17033
17034
17035
17036
17037
17038
17039
17040
17041
17042
17043
17044
17045
17046
17047
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MONTGOMERY_CALC_NORMALIZATION_C
|   |   |   |   |   +--->BN_MP_2EXPT_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MULMOD_C
9608
9609
9610
9611
9612
9613
9614

9615
9616
9617
9618
9619
9620
9621
|   |   |   |   |   +--->BN_MP_MOD_C
|   |   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C

|   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   |   +--->BN_MP_SUB_C







>







17113
17114
17115
17116
17117
17118
17119
17120
17121
17122
17123
17124
17125
17126
17127
|   |   |   |   |   +--->BN_MP_MOD_C
|   |   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   |   |   +--->BN_MP_SUB_C
9646
9647
9648
9649
9650
9651
9652


9653
9654
9655
9656
9657
9658
9659
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C


|   |   |   |   +--->BN_MP_MOD_C
|   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C







>
>







17152
17153
17154
17155
17156
17157
17158
17159
17160
17161
17162
17163
17164
17165
17166
17167
|   |   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_MOD_C
|   |   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   |   +--->BN_MP_INIT_MULTI_C
9898
9899
9900
9901
9902
9903
9904

9905
9906
9907
9908
9909
9910
9911




















































































































































9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927

9928
9929
9930
9931
9932
9933
9934
9935


9936
9937
9938
9939
9940
9941
9942
9943
9944
9945






























































































































































































9946
9947










































































































































































9948
9949
9950
9951











9952
9953


9954
























































































































9955
9956

9957
9958
9959

9960
9961
9962
9963
9964
9965
9966
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_INIT_MULTI_C

|   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C




















































































































































|   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C

|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CLAMP_C


|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CLEAR_C






























































































































































































|   +--->BN_MP_CLEAR_C
+--->BN_MP_SUB_D_C










































































































































































|   +--->BN_MP_GROW_C
|   +--->BN_MP_ADD_D_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CLAMP_C











+--->BN_MP_DIV_2_C
|   +--->BN_MP_GROW_C


|   +--->BN_MP_CLAMP_C
























































































































+--->BN_MP_MUL_2_C
|   +--->BN_MP_GROW_C

+--->BN_MP_ADD_D_C
|   +--->BN_MP_GROW_C
|   +--->BN_MP_CLAMP_C



BN_MP_RADIX_SIZE_C
+--->BN_MP_COUNT_BITS_C
+--->BN_MP_INIT_COPY_C
|   +--->BN_MP_INIT_SIZE_C
|   +--->BN_MP_COPY_C







>







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
















>








>
>









|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

|


>
>
>
>
>
>
>
>
>
>
>
|

>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|

>
|


>







17406
17407
17408
17409
17410
17411
17412
17413
17414
17415
17416
17417
17418
17419
17420
17421
17422
17423
17424
17425
17426
17427
17428
17429
17430
17431
17432
17433
17434
17435
17436
17437
17438
17439
17440
17441
17442
17443
17444
17445
17446
17447
17448
17449
17450
17451
17452
17453
17454
17455
17456
17457
17458
17459
17460
17461
17462
17463
17464
17465
17466
17467
17468
17469
17470
17471
17472
17473
17474
17475
17476
17477
17478
17479
17480
17481
17482
17483
17484
17485
17486
17487
17488
17489
17490
17491
17492
17493
17494
17495
17496
17497
17498
17499
17500
17501
17502
17503
17504
17505
17506
17507
17508
17509
17510
17511
17512
17513
17514
17515
17516
17517
17518
17519
17520
17521
17522
17523
17524
17525
17526
17527
17528
17529
17530
17531
17532
17533
17534
17535
17536
17537
17538
17539
17540
17541
17542
17543
17544
17545
17546
17547
17548
17549
17550
17551
17552
17553
17554
17555
17556
17557
17558
17559
17560
17561
17562
17563
17564
17565
17566
17567
17568
17569
17570
17571
17572
17573
17574
17575
17576
17577
17578
17579
17580
17581
17582
17583
17584
17585
17586
17587
17588
17589
17590
17591
17592
17593
17594
17595
17596
17597
17598
17599
17600
17601
17602
17603
17604
17605
17606
17607
17608
17609
17610
17611
17612
17613
17614
17615
17616
17617
17618
17619
17620
17621
17622
17623
17624
17625
17626
17627
17628
17629
17630
17631
17632
17633
17634
17635
17636
17637
17638
17639
17640
17641
17642
17643
17644
17645
17646
17647
17648
17649
17650
17651
17652
17653
17654
17655
17656
17657
17658
17659
17660
17661
17662
17663
17664
17665
17666
17667
17668
17669
17670
17671
17672
17673
17674
17675
17676
17677
17678
17679
17680
17681
17682
17683
17684
17685
17686
17687
17688
17689
17690
17691
17692
17693
17694
17695
17696
17697
17698
17699
17700
17701
17702
17703
17704
17705
17706
17707
17708
17709
17710
17711
17712
17713
17714
17715
17716
17717
17718
17719
17720
17721
17722
17723
17724
17725
17726
17727
17728
17729
17730
17731
17732
17733
17734
17735
17736
17737
17738
17739
17740
17741
17742
17743
17744
17745
17746
17747
17748
17749
17750
17751
17752
17753
17754
17755
17756
17757
17758
17759
17760
17761
17762
17763
17764
17765
17766
17767
17768
17769
17770
17771
17772
17773
17774
17775
17776
17777
17778
17779
17780
17781
17782
17783
17784
17785
17786
17787
17788
17789
17790
17791
17792
17793
17794
17795
17796
17797
17798
17799
17800
17801
17802
17803
17804
17805
17806
17807
17808
17809
17810
17811
17812
17813
17814
17815
17816
17817
17818
17819
17820
17821
17822
17823
17824
17825
17826
17827
17828
17829
17830
17831
17832
17833
17834
17835
17836
17837
17838
17839
17840
17841
17842
17843
17844
17845
17846
17847
17848
17849
17850
17851
17852
17853
17854
17855
17856
17857
17858
17859
17860
17861
17862
17863
17864
17865
17866
17867
17868
17869
17870
17871
17872
17873
17874
17875
17876
17877
17878
17879
17880
17881
17882
17883
17884
17885
17886
17887
17888
17889
17890
17891
17892
17893
17894
17895
17896
17897
17898
17899
17900
17901
17902
17903
17904
17905
17906
17907
17908
17909
17910
17911
17912
17913
17914
17915
17916
17917
17918
17919
17920
17921
17922
17923
17924
17925
17926
17927
17928
17929
17930
17931
17932
17933
17934
17935
17936
17937
17938
17939
17940
17941
17942
17943
17944
17945
17946
17947
17948
17949
17950
17951
17952
17953
17954
17955
17956
17957
17958
17959
17960
17961
17962
17963
17964
17965
17966
17967
17968
17969
17970
17971
17972
17973
17974
17975
17976
17977
17978
17979
17980
17981
17982
17983
17984
17985
17986
17987
17988
17989
17990
17991
17992
17993
17994
17995
17996
17997
17998
17999
18000
18001
18002
18003
18004
18005
18006
18007
18008
18009
18010
18011
18012
18013
18014
18015
18016
18017
18018
18019
18020
18021
18022
18023
18024
18025
18026
18027
18028
18029
18030
18031
18032
18033
18034
18035
18036
18037
18038
18039
18040
18041
18042
18043
18044
18045
18046
18047
18048
18049
18050
18051
18052
18053
18054
18055
18056
18057
18058
18059
18060
18061
18062
18063
18064
18065
18066
18067
18068
18069
18070
18071
18072
18073
18074
18075
18076
18077
18078
18079
18080
18081
18082
18083
18084
18085
18086
18087
18088
18089
18090
18091
18092
18093
18094
18095
18096
18097
18098
18099
18100
18101
18102
18103
18104
18105
18106
18107
18108
18109
18110
18111
18112
18113
18114
18115
18116
18117
18118
18119
18120
18121
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_PRIME_FROBENIUS_UNDERWOOD_C
|   |   +--->BN_MP_INIT_MULTI_C
|   |   |   +--->BN_MP_INIT_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_SET_LONG_C
|   |   +--->BN_MP_SQR_C
|   |   |   +--->BN_MP_TOOM_SQR_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_MUL_2_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_KARATSUBA_SQR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_FAST_S_MP_SQR_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_S_MP_SQR_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_SUB_D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_ADD_D_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_KRONECKER_C
|   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_CNT_LSB_C
|   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_MOD_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_DIV_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_SET_C
|   |   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_GCD_C
|   |   |   +--->BN_MP_ABS_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_CNT_LSB_C
|   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_ADD_D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_SET_C
|   |   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_COUNT_BITS_C
|   |   +--->BN_MP_MUL_2_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_MUL_D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_ADD_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_MUL_C
|   |   |   +--->BN_MP_TOOM_MUL_C
|   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_2_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_DIV_3_C
|   |   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_KARATSUBA_MUL_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_S_MP_MUL_DIGS_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_SUB_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_MOD_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_INIT_C
|   |   |   +--->BN_MP_DIV_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_MP_COPY_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   +--->BN_MP_DIV_2D_C
|   |   |   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_INIT_C
|   |   |   |   +--->BN_MP_INIT_COPY_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_GET_BIT_C
|   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_CMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_READ_RADIX_C
|   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_MUL_D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_ADD_D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_SUB_D_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CMP_C
|   |   +--->BN_MP_CMP_MAG_C
|   +--->BN_MP_SET_C
|   |   +--->BN_MP_ZERO_C
|   +--->BN_MP_COUNT_BITS_C
|   +--->BN_MP_RAND_C
|   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_ADD_D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_SUB_D_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_LSHD_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_RSHD_C
|   +--->BN_MP_DIV_2D_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_MOD_2D_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_RSHD_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CLEAR_C
+--->BN_MP_MUL_D_C
|   +--->BN_MP_GROW_C
|   +--->BN_MP_CLAMP_C
+--->BN_MP_INIT_C
+--->BN_MP_SET_LONG_C
+--->BN_MP_MUL_C
|   +--->BN_MP_TOOM_MUL_C
|   |   +--->BN_MP_INIT_MULTI_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_MOD_2D_C
|   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_MUL_2_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_ADD_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_SUB_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_DIV_2_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_MUL_2D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_LSHD_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_DIV_3_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_LSHD_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_KARATSUBA_MUL_C
|   |   +--->BN_MP_INIT_SIZE_C
|   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_S_MP_ADD_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_ADD_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_S_MP_SUB_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_LSHD_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_CLEAR_C
|   +--->BN_FAST_S_MP_MUL_DIGS_C
|   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_S_MP_MUL_DIGS_C
|   |   +--->BN_MP_INIT_SIZE_C
|   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_CLEAR_C
+--->BN_MP_CLEAR_C
+--->BN_MP_INIT_MULTI_C
+--->BN_MP_GCD_C
|   +--->BN_MP_ABS_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   +--->BN_MP_INIT_COPY_C
|   |   +--->BN_MP_INIT_SIZE_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   +--->BN_MP_CNT_LSB_C
|   +--->BN_MP_DIV_2D_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_MOD_2D_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_RSHD_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CMP_MAG_C
|   +--->BN_MP_EXCH_C
|   +--->BN_S_MP_SUB_C
|   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_MUL_2D_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_LSHD_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_CLAMP_C
+--->BN_MP_CMP_D_C
+--->BN_MP_CMP_C
|   +--->BN_MP_CMP_MAG_C
+--->BN_MP_KRONECKER_C
|   +--->BN_MP_INIT_COPY_C
|   |   +--->BN_MP_INIT_SIZE_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   +--->BN_MP_CNT_LSB_C
|   +--->BN_MP_DIV_2D_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_MOD_2D_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_RSHD_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_COPY_C
|   |   +--->BN_MP_GROW_C
|   +--->BN_MP_MOD_C
|   |   +--->BN_MP_INIT_SIZE_C
|   |   +--->BN_MP_DIV_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_SET_C
|   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   +--->BN_MP_ABS_C
|   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_SUB_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_ADD_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   +--->BN_MP_LSHD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_ADD_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
+--->BN_MP_ADD_D_C
|   +--->BN_MP_GROW_C
|   +--->BN_MP_SUB_D_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CLAMP_C
+--->BN_MP_CNT_LSB_C
+--->BN_MP_DIV_2D_C
|   +--->BN_MP_COPY_C
|   |   +--->BN_MP_GROW_C
|   +--->BN_MP_ZERO_C
|   +--->BN_MP_MOD_2D_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_RSHD_C
|   +--->BN_MP_CLAMP_C
+--->BN_MP_SET_C
|   +--->BN_MP_ZERO_C
+--->BN_MP_MUL_2_C
|   +--->BN_MP_GROW_C
+--->BN_MP_COUNT_BITS_C
+--->BN_MP_MOD_C
|   +--->BN_MP_INIT_SIZE_C
|   +--->BN_MP_DIV_C
|   |   +--->BN_MP_CMP_MAG_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_ABS_C
|   |   +--->BN_MP_MUL_2D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_LSHD_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_SUB_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_ADD_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_CLEAR_MULTI_C
|   |   +--->BN_MP_INIT_COPY_C
|   |   +--->BN_MP_LSHD_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_RSHD_C
|   |   +--->BN_MP_RSHD_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_EXCH_C
|   +--->BN_MP_ADD_C
|   |   +--->BN_S_MP_ADD_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_CMP_MAG_C
|   |   +--->BN_S_MP_SUB_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
+--->BN_MP_SQR_C
|   +--->BN_MP_TOOM_SQR_C
|   |   +--->BN_MP_MOD_2D_C
|   |   |   +--->BN_MP_ZERO_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_ADD_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_SUB_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_DIV_2_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_MUL_2D_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_LSHD_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_DIV_3_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_LSHD_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLEAR_MULTI_C
|   +--->BN_MP_KARATSUBA_SQR_C
|   |   +--->BN_MP_INIT_SIZE_C
|   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_S_MP_ADD_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_S_MP_SUB_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_LSHD_C
|   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_ZERO_C
|   |   +--->BN_MP_ADD_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   +--->BN_FAST_S_MP_SQR_C
|   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_S_MP_SQR_C
|   |   +--->BN_MP_INIT_SIZE_C
|   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_EXCH_C
+--->BN_MP_SUB_C
|   +--->BN_S_MP_ADD_C
|   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CMP_MAG_C
|   +--->BN_S_MP_SUB_C
|   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLAMP_C
+--->BN_MP_GET_BIT_C
+--->BN_MP_ADD_C
|   +--->BN_S_MP_ADD_C
|   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CMP_MAG_C
|   +--->BN_S_MP_SUB_C
|   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLAMP_C
+--->BN_MP_DIV_2_C
|   +--->BN_MP_GROW_C
|   +--->BN_MP_CLAMP_C
+--->BN_MP_SUB_D_C
|   +--->BN_MP_GROW_C
|   +--->BN_MP_CLAMP_C
+--->BN_MP_CLEAR_MULTI_C


BN_MP_RADIX_SIZE_C
+--->BN_MP_COUNT_BITS_C
+--->BN_MP_INIT_COPY_C
|   +--->BN_MP_INIT_SIZE_C
|   +--->BN_MP_COPY_C
10459
10460
10461
10462
10463
10464
10465




















10466
10467
10468
10469
10470
10471
10472
BN_MP_RSHD_C
+--->BN_MP_ZERO_C


BN_MP_SET_C
+--->BN_MP_ZERO_C






















BN_MP_SET_INT_C
+--->BN_MP_ZERO_C
+--->BN_MP_MUL_2D_C
|   +--->BN_MP_COPY_C
|   |   +--->BN_MP_GROW_C
|   +--->BN_MP_GROW_C







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







18614
18615
18616
18617
18618
18619
18620
18621
18622
18623
18624
18625
18626
18627
18628
18629
18630
18631
18632
18633
18634
18635
18636
18637
18638
18639
18640
18641
18642
18643
18644
18645
18646
18647
BN_MP_RSHD_C
+--->BN_MP_ZERO_C


BN_MP_SET_C
+--->BN_MP_ZERO_C


BN_MP_SET_DOUBLE_C
+--->BN_MP_SET_LONG_LONG_C
+--->BN_MP_DIV_2D_C
|   +--->BN_MP_COPY_C
|   |   +--->BN_MP_GROW_C
|   +--->BN_MP_ZERO_C
|   +--->BN_MP_MOD_2D_C
|   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_RSHD_C
|   +--->BN_MP_CLAMP_C
+--->BN_MP_MUL_2D_C
|   +--->BN_MP_COPY_C
|   |   +--->BN_MP_GROW_C
|   +--->BN_MP_GROW_C
|   +--->BN_MP_LSHD_C
|   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_ZERO_C
|   +--->BN_MP_CLAMP_C


BN_MP_SET_INT_C
+--->BN_MP_ZERO_C
+--->BN_MP_MUL_2D_C
|   +--->BN_MP_COPY_C
|   |   +--->BN_MP_GROW_C
|   +--->BN_MP_GROW_C
10623
10624
10625
10626
10627
10628
10629

10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642


10643
10644
10645
10646










10647
10648






10649

















10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670

10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
|   |   |   +--->BN_MP_CLAMP_C


BN_MP_SQRTMOD_PRIME_C
+--->BN_MP_CMP_D_C
+--->BN_MP_ZERO_C
+--->BN_MP_JACOBI_C

|   +--->BN_MP_INIT_COPY_C
|   |   +--->BN_MP_INIT_SIZE_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_CLEAR_C
|   +--->BN_MP_CNT_LSB_C
|   +--->BN_MP_DIV_2D_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_MOD_2D_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_RSHD_C
|   |   +--->BN_MP_CLAMP_C


|   +--->BN_MP_MOD_C
|   |   +--->BN_MP_INIT_SIZE_C
|   |   +--->BN_MP_DIV_C
|   |   |   +--->BN_MP_CMP_MAG_C










|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C






|   |   |   +--->BN_MP_INIT_MULTI_C

















|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_SET_C
|   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   +--->BN_MP_ABS_C
|   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_C
|   |   |   +--->BN_MP_SUB_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_ADD_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C

|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_LSHD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_EXCH_C
|   |   +--->BN_MP_ADD_C
|   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   +--->BN_MP_CLEAR_C
+--->BN_MP_INIT_MULTI_C
|   +--->BN_MP_INIT_C
|   +--->BN_MP_CLEAR_C
+--->BN_MP_MOD_D_C
|   +--->BN_MP_DIV_D_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C







>
|
|
|
|
|
|
|
|
|
|
|
|
|
>
>
|
|
|
|
>
>
>
>
>
>
>
>
>
>
|
|
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

|
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<




>



<
<
<
<
<
<
<
<
<
<
<
<

<
<
<
<
<
<
<
<
<
<







18798
18799
18800
18801
18802
18803
18804
18805
18806
18807
18808
18809
18810
18811
18812
18813
18814
18815
18816
18817
18818
18819
18820
18821
18822
18823
18824
18825
18826
18827
18828
18829
18830
18831
18832
18833
18834
18835
18836
18837
18838
18839
18840
18841
18842
18843
18844
18845
18846
18847
18848
18849
18850
18851
18852
18853
18854
18855
18856
18857
18858
18859
18860
18861
18862
18863














18864
18865
18866
18867
18868
18869
18870
18871












18872










18873
18874
18875
18876
18877
18878
18879
|   |   |   +--->BN_MP_CLAMP_C


BN_MP_SQRTMOD_PRIME_C
+--->BN_MP_CMP_D_C
+--->BN_MP_ZERO_C
+--->BN_MP_JACOBI_C
|   +--->BN_MP_KRONECKER_C
|   |   +--->BN_MP_INIT_COPY_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_CNT_LSB_C
|   |   +--->BN_MP_DIV_2D_C
|   |   |   +--->BN_MP_COPY_C
|   |   |   |   +--->BN_MP_GROW_C
|   |   |   +--->BN_MP_MOD_2D_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_RSHD_C
|   |   |   +--->BN_MP_CLAMP_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
|   |   +--->BN_MP_MOD_C
|   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   +--->BN_MP_DIV_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_MP_INIT_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_SET_C
|   |   |   |   +--->BN_MP_COUNT_BITS_C
|   |   |   |   +--->BN_MP_ABS_C
|   |   |   |   +--->BN_MP_MUL_2D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_C
|   |   |   |   +--->BN_MP_SUB_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_ADD_C
|   |   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_EXCH_C
|   |   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   |   +--->BN_MP_LSHD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_RSHD_C
|   |   |   |   +--->BN_MP_MUL_D_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_CLEAR_C
|   |   |   +--->BN_MP_EXCH_C














|   |   |   +--->BN_MP_ADD_C
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C












|   |   +--->BN_MP_CLEAR_C










+--->BN_MP_INIT_MULTI_C
|   +--->BN_MP_INIT_C
|   +--->BN_MP_CLEAR_C
+--->BN_MP_MOD_D_C
|   +--->BN_MP_DIV_D_C
|   |   +--->BN_MP_COPY_C
|   |   |   +--->BN_MP_GROW_C
10802
10803
10804
10805
10806
10807
10808

10809
10810
10811
10812
10813
10814
10815
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C

|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_INVMOD_SLOW_C
|   |   |   +--->BN_MP_MOD_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_DIV_C







>







18978
18979
18980
18981
18982
18983
18984
18985
18986
18987
18988
18989
18990
18991
18992
|   |   |   |   +--->BN_S_MP_ADD_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   |   +--->BN_S_MP_SUB_C
|   |   |   |   |   +--->BN_MP_GROW_C
|   |   |   |   |   +--->BN_MP_CLAMP_C
|   |   |   +--->BN_MP_CMP_MAG_C
|   |   |   +--->BN_MP_EXCH_C
|   |   |   +--->BN_MP_CLEAR_MULTI_C
|   |   |   |   +--->BN_MP_CLEAR_C
|   |   +--->BN_MP_INVMOD_SLOW_C
|   |   |   +--->BN_MP_MOD_C
|   |   |   |   +--->BN_MP_INIT_SIZE_C
|   |   |   |   +--->BN_MP_DIV_C
Changes to libtommath/changes.txt.






















1
2
3
4
5
6
7






















Aug 29th, 2017
v1.0.1
       -- Dmitry Kovalenko provided fixes to mp_add_d() and mp_init_copy()
       -- Matt Johnston contributed some improvements to mp_div_2d(),
          mp_exptmod_fast(), mp_mod() and mp_mulmod()
       -- Julien Nabet provided a fix to the error handling in mp_init_multi()
       -- Ben Gardner provided a fix regarding usage of reserved keywords
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Jan 28th, 2019
v1.1.0
       -- Christoph Zurnieden contributed FIPS 186.4 compliant
          prime-checking (PR #113), several other fixes and a load of documentation
       -- Daniel Mendler provided two's-complement functions (PR #124)
          and mp_{set,get}_double() (PR #123)
       -- Francois Perrad took care of linting the sources, provided all fixes and
          a astylerc to auto-format the sources.
       -- A bunch of patches by Kevin B Kenny have been back-ported from TCL
       -- Jan Nijtmans provided the patches to `const`ify all API
          function arguments (also from TCL)
       -- mp_rand() has now several native random provider implementations
          and doesn't rely on `rand()` anymore
       -- Karel Miko provided fixes when building for MS Windows
          and re-worked the makefile generating process
       -- The entire environment and build logic has been extended and improved
          regarding auto-detection of platforms, libtool and a lot more
       -- Prevent some potential BOF cases
       -- Improved/fixed mp_lshd() and mp_invmod()
       -- A load more bugs were fixed by various contributors


Aug 29th, 2017
v1.0.1
       -- Dmitry Kovalenko provided fixes to mp_add_d() and mp_init_copy()
       -- Matt Johnston contributed some improvements to mp_div_2d(),
          mp_exptmod_fast(), mp_mod() and mp_mulmod()
       -- Julien Nabet provided a fix to the error handling in mp_init_multi()
       -- Ben Gardner provided a fix regarding usage of reserved keywords
Deleted libtommath/libtommath.dsp.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
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
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
# Microsoft Developer Studio Project File - Name="libtommath" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **

# TARGTYPE "Win32 (x86) Static Library" 0x0104

CFG=libtommath - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE 
!MESSAGE NMAKE /f "libtommath.mak".
!MESSAGE 
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE 
!MESSAGE NMAKE /f "libtommath.mak" CFG="libtommath - Win32 Debug"
!MESSAGE 
!MESSAGE Possible choices for configuration are:
!MESSAGE 
!MESSAGE "libtommath - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "libtommath - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE 

# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName "libtommath"
# PROP Scc_LocalPath "."
CPP=cl.exe
RSC=rc.exe

!IF  "$(CFG)" == "libtommath - Win32 Release"

# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /I "." /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"Release\tommath.lib"

!ELSEIF  "$(CFG)" == "libtommath - Win32 Debug"

# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "." /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"Debug\tommath.lib"

!ENDIF 

# Begin Target

# Name "libtommath - Win32 Release"
# Name "libtommath - Win32 Debug"
# Begin Source File

SOURCE=.\bn_error.c
# End Source File
# Begin Source File

SOURCE=.\bn_fast_mp_invmod.c
# End Source File
# Begin Source File

SOURCE=.\bn_fast_mp_montgomery_reduce.c
# End Source File
# Begin Source File

SOURCE=.\bn_fast_s_mp_mul_digs.c
# End Source File
# Begin Source File

SOURCE=.\bn_fast_s_mp_mul_high_digs.c
# End Source File
# Begin Source File

SOURCE=.\bn_fast_s_mp_sqr.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_2expt.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_abs.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_add.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_add_d.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_addmod.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_and.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_clamp.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_clear.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_clear_multi.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_cmp.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_cmp_d.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_cmp_mag.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_cnt_lsb.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_copy.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_count_bits.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_div.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_div_2.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_div_2d.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_div_3.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_div_d.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_dr_is_modulus.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_dr_reduce.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_dr_setup.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_exch.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_expt_d.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_exptmod.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_exptmod_fast.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_exteuclid.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_fread.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_fwrite.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_gcd.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_get_int.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_grow.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_init.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_init_copy.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_init_multi.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_init_set.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_init_set_int.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_init_size.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_invmod.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_invmod_slow.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_is_square.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_jacobi.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_karatsuba_mul.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_karatsuba_sqr.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_lcm.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_lshd.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_mod.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_mod_2d.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_mod_d.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_montgomery_calc_normalization.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_montgomery_reduce.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_montgomery_setup.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_mul.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_mul_2.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_mul_2d.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_mul_d.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_mulmod.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_n_root.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_neg.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_or.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_prime_fermat.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_prime_is_divisible.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_prime_is_prime.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_prime_miller_rabin.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_prime_next_prime.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_prime_rabin_miller_trials.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_prime_random_ex.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_radix_size.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_radix_smap.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_rand.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_read_radix.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_read_signed_bin.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_read_unsigned_bin.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_reduce.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_reduce_2k.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_reduce_2k_l.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_reduce_2k_setup.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_reduce_2k_setup_l.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_reduce_is_2k.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_reduce_is_2k_l.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_reduce_setup.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_rshd.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_set.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_set_int.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_shrink.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_signed_bin_size.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_sqr.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_sqrmod.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_sqrt.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_sub.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_sub_d.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_submod.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_to_signed_bin.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_to_signed_bin_n.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_to_unsigned_bin.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_to_unsigned_bin_n.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_toom_mul.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_toom_sqr.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_toradix.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_toradix_n.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_unsigned_bin_size.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_xor.c
# End Source File
# Begin Source File

SOURCE=.\bn_mp_zero.c
# End Source File
# Begin Source File

SOURCE=.\bn_prime_tab.c
# End Source File
# Begin Source File

SOURCE=.\bn_reverse.c
# End Source File
# Begin Source File

SOURCE=.\bn_s_mp_add.c
# End Source File
# Begin Source File

SOURCE=.\bn_s_mp_exptmod.c
# End Source File
# Begin Source File

SOURCE=.\bn_s_mp_mul_digs.c
# End Source File
# Begin Source File

SOURCE=.\bn_s_mp_mul_high_digs.c
# End Source File
# Begin Source File

SOURCE=.\bn_s_mp_sqr.c
# End Source File
# Begin Source File

SOURCE=.\bn_s_mp_sub.c
# End Source File
# Begin Source File

SOURCE=.\bncore.c
# End Source File
# Begin Source File

SOURCE=.\tommath.h
# End Source File
# Begin Source File

SOURCE=.\tommath_class.h
# End Source File
# Begin Source File

SOURCE=.\tommath_superclass.h
# End Source File
# End Target
# End Project
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
























































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































Deleted libtommath/libtommath_VS2005.sln.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtommath", "libtommath_VS2005.vcproj", "{0272C9B2-D68B-4F24-B32D-C1FD552F7E51}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Win32 = Debug|Win32
		Release|Win32 = Release|Win32
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{0272C9B2-D68B-4F24-B32D-C1FD552F7E51}.Debug|Win32.ActiveCfg = Debug|Win32
		{0272C9B2-D68B-4F24-B32D-C1FD552F7E51}.Debug|Win32.Build.0 = Debug|Win32
		{0272C9B2-D68B-4F24-B32D-C1FD552F7E51}.Release|Win32.ActiveCfg = Release|Win32
		{0272C9B2-D68B-4F24-B32D-C1FD552F7E51}.Release|Win32.Build.0 = Release|Win32
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
EndGlobal
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<








































Deleted libtommath/libtommath_VS2005.vcproj.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
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
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
	ProjectType="Visual C++"
	Version="8,00"
	Name="libtommath"
	ProjectGUID="{0272C9B2-D68B-4F24-B32D-C1FD552F7E51}"
	>
	<Platforms>
		<Platform
			Name="Win32"
		/>
	</Platforms>
	<ToolFiles>
	</ToolFiles>
	<Configurations>
		<Configuration
			Name="Debug|Win32"
			OutputDirectory=".\Debug"
			IntermediateDirectory=".\Debug"
			ConfigurationType="4"
			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
			UseOfMFC="0"
			ATLMinimizesCRunTimeLibraryUsage="false"
			CharacterSet="2"
			>
			<Tool
				Name="VCPreBuildEventTool"
			/>
			<Tool
				Name="VCCustomBuildTool"
			/>
			<Tool
				Name="VCXMLDataGeneratorTool"
			/>
			<Tool
				Name="VCWebServiceProxyGeneratorTool"
			/>
			<Tool
				Name="VCMIDLTool"
			/>
			<Tool
				Name="VCCLCompilerTool"
				Optimization="0"
				AdditionalIncludeDirectories="."
				PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
				MinimalRebuild="true"
				BasicRuntimeChecks="3"
				RuntimeLibrary="1"
				PrecompiledHeaderFile=".\Debug/libtommath.pch"
				AssemblerListingLocation=".\Debug/"
				ObjectFile=".\Debug/"
				ProgramDataBaseFileName=".\Debug/"
				WarningLevel="3"
				SuppressStartupBanner="true"
				DebugInformationFormat="4"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
				Name="VCResourceCompilerTool"
				PreprocessorDefinitions="_DEBUG"
				Culture="1033"
			/>
			<Tool
				Name="VCPreLinkEventTool"
			/>
			<Tool
				Name="VCLibrarianTool"
				OutputFile="Debug\tommath.lib"
				SuppressStartupBanner="true"
			/>
			<Tool
				Name="VCALinkTool"
			/>
			<Tool
				Name="VCXDCMakeTool"
			/>
			<Tool
				Name="VCBscMakeTool"
				SuppressStartupBanner="true"
				OutputFile=".\Debug/libtommath.bsc"
			/>
			<Tool
				Name="VCFxCopTool"
			/>
			<Tool
				Name="VCPostBuildEventTool"
			/>
		</Configuration>
		<Configuration
			Name="Release|Win32"
			OutputDirectory=".\Release"
			IntermediateDirectory=".\Release"
			ConfigurationType="4"
			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
			UseOfMFC="0"
			ATLMinimizesCRunTimeLibraryUsage="false"
			CharacterSet="2"
			>
			<Tool
				Name="VCPreBuildEventTool"
			/>
			<Tool
				Name="VCCustomBuildTool"
			/>
			<Tool
				Name="VCXMLDataGeneratorTool"
			/>
			<Tool
				Name="VCWebServiceProxyGeneratorTool"
			/>
			<Tool
				Name="VCMIDLTool"
			/>
			<Tool
				Name="VCCLCompilerTool"
				Optimization="2"
				InlineFunctionExpansion="1"
				AdditionalIncludeDirectories="."
				PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
				StringPooling="true"
				RuntimeLibrary="0"
				EnableFunctionLevelLinking="true"
				PrecompiledHeaderFile=".\Release/libtommath.pch"
				AssemblerListingLocation=".\Release/"
				ObjectFile=".\Release/"
				ProgramDataBaseFileName=".\Release/"
				WarningLevel="3"
				SuppressStartupBanner="true"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
				Name="VCResourceCompilerTool"
				PreprocessorDefinitions="NDEBUG"
				Culture="1033"
			/>
			<Tool
				Name="VCPreLinkEventTool"
			/>
			<Tool
				Name="VCLibrarianTool"
				OutputFile="Release\tommath.lib"
				SuppressStartupBanner="true"
			/>
			<Tool
				Name="VCALinkTool"
			/>
			<Tool
				Name="VCXDCMakeTool"
			/>
			<Tool
				Name="VCBscMakeTool"
				SuppressStartupBanner="true"
				OutputFile=".\Release/libtommath.bsc"
			/>
			<Tool
				Name="VCFxCopTool"
			/>
			<Tool
				Name="VCPostBuildEventTool"
			/>
		</Configuration>
	</Configurations>
	<References>
	</References>
	<Files>
		<File
			RelativePath="bn_error.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_fast_mp_invmod.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_fast_mp_montgomery_reduce.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_fast_s_mp_mul_digs.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_fast_s_mp_mul_high_digs.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_fast_s_mp_sqr.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_2expt.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_abs.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_add.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_add_d.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_addmod.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_and.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_clamp.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_clear.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_clear_multi.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_cmp.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_cmp_d.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_cmp_mag.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_cnt_lsb.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_copy.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_count_bits.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_div.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_div_2.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_div_2d.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_div_3.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_div_d.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_dr_is_modulus.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_dr_reduce.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_dr_setup.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_exch.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_export.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_expt_d.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_exptmod.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_exptmod_fast.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_exteuclid.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_fread.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_fwrite.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_gcd.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_get_int.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_grow.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_import.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_init.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_init_copy.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_init_multi.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_init_set.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_init_set_int.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_init_size.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_invmod.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_invmod_slow.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_is_square.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_jacobi.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_karatsuba_mul.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_karatsuba_sqr.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_lcm.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_lshd.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_mod.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_mod_2d.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_mod_d.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_montgomery_calc_normalization.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_montgomery_reduce.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_montgomery_setup.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_mul.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_mul_2.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_mul_2d.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_mul_d.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_mulmod.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_n_root.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_neg.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_or.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_prime_fermat.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_prime_is_divisible.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_prime_is_prime.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_prime_miller_rabin.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_prime_next_prime.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_prime_rabin_miller_trials.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_prime_random_ex.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_radix_size.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_radix_smap.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_rand.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_read_radix.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_read_signed_bin.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_read_unsigned_bin.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_reduce.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_reduce_2k.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_reduce_2k_l.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_reduce_2k_setup.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_reduce_2k_setup_l.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_reduce_is_2k.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_reduce_is_2k_l.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_reduce_setup.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_rshd.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_set.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_set_int.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_shrink.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_signed_bin_size.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_sqr.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_sqrmod.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_sqrt.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_sub.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_sub_d.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_submod.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_to_signed_bin.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_to_signed_bin_n.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_to_unsigned_bin.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_to_unsigned_bin_n.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_toom_mul.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_toom_sqr.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_toradix.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_toradix_n.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_unsigned_bin_size.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_xor.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_zero.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_prime_tab.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_reverse.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_s_mp_add.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_s_mp_exptmod.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_s_mp_mul_digs.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_s_mp_mul_high_digs.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_s_mp_sqr.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_s_mp_sub.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bncore.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="tommath.h"
			>
		</File>
		<File
			RelativePath="tommath_class.h"
			>
		</File>
		<File
			RelativePath="tommath_superclass.h"
			>
		</File>
	</Files>
	<Globals>
	</Globals>
</VisualStudioProject>
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






























































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































Changes to libtommath/libtommath_VS2008.sln.
1
2
3
4
5
6
7
8

9

10
11
12
13


14
15


16
17
18
19



20

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtommath", "libtommath_VS2008.vcproj", "{42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Win32 = Debug|Win32

		Release|Win32 = Release|Win32

	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Debug|Win32.ActiveCfg = Debug|Win32
		{42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Debug|Win32.Build.0 = Debug|Win32


		{42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Release|Win32.ActiveCfg = Release|Win32
		{42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Release|Win32.Build.0 = Release|Win32


	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection



EndGlobal



|




>

>




>
>


>
>




>
>
>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tommath", "libtommath_VS2008.vcproj", "{42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Win32 = Debug|Win32
		Debug|x64 = Debug|x64
		Release|Win32 = Release|Win32
		Release|x64 = Release|x64
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Debug|Win32.ActiveCfg = Debug|Win32
		{42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Debug|Win32.Build.0 = Debug|Win32
		{42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Debug|x64.ActiveCfg = Debug|x64
		{42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Debug|x64.Build.0 = Debug|x64
		{42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Release|Win32.ActiveCfg = Release|Win32
		{42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Release|Win32.Build.0 = Release|Win32
		{42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Release|x64.ActiveCfg = Release|x64
		{42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}.Release|x64.Build.0 = Release|x64
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
	GlobalSection(ExtensibilityGlobals) = postSolution
		SolutionGuid = {83B84178-7B4F-4B78-9C5D-17B8201D5B61}
	EndGlobalSection
EndGlobal
Changes to libtommath/libtommath_VS2008.vcproj.
1
2
3
4
5
6
7
8
9
10
11
12
13



14
15
16
17
18
19
20
21
22
23








































































24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

42
43
44
45
46
47
48

49
50
51
52
53
54
55
56
57

58
59
60
61
62
63
64
65
66
67
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116

117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
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
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970

971
972

973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992

993
994

995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667

1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799

1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338

2339
2340

2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360

2361
2362

2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804




2805
2806
2807
2808
2809
2810
2811
2812
2813
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
	ProjectType="Visual C++"
	Version="9.00"
	Name="libtommath"
	ProjectGUID="{42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}"
	RootNamespace="libtommath"
	TargetFrameworkVersion="0"
	>
	<Platforms>
		<Platform
			Name="Win32"
		/>



	</Platforms>
	<ToolFiles>
	</ToolFiles>
	<Configurations>
		<Configuration
			Name="Debug|Win32"
			OutputDirectory=".\Debug"
			IntermediateDirectory=".\Debug"
			ConfigurationType="4"
			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"








































































			UseOfMFC="0"
			ATLMinimizesCRunTimeLibraryUsage="false"
			CharacterSet="2"
			>
			<Tool
				Name="VCPreBuildEventTool"
			/>
			<Tool
				Name="VCCustomBuildTool"
			/>
			<Tool
				Name="VCXMLDataGeneratorTool"
			/>
			<Tool
				Name="VCWebServiceProxyGeneratorTool"
			/>
			<Tool
				Name="VCMIDLTool"

			/>
			<Tool
				Name="VCCLCompilerTool"
				Optimization="0"
				AdditionalIncludeDirectories="."
				PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
				MinimalRebuild="true"

				BasicRuntimeChecks="3"
				RuntimeLibrary="1"
				PrecompiledHeaderFile=".\Debug/libtommath.pch"
				AssemblerListingLocation=".\Debug/"
				ObjectFile=".\Debug/"
				ProgramDataBaseFileName=".\Debug/"
				WarningLevel="3"
				SuppressStartupBanner="true"
				DebugInformationFormat="4"

			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
				Name="VCResourceCompilerTool"
				PreprocessorDefinitions="_DEBUG"
				Culture="1033"
			/>
			<Tool
				Name="VCPreLinkEventTool"
			/>
			<Tool
				Name="VCLibrarianTool"
				OutputFile="Debug\tommath.lib"







































































				SuppressStartupBanner="true"
			/>
			<Tool
				Name="VCALinkTool"
			/>
			<Tool
				Name="VCXDCMakeTool"
			/>
			<Tool
				Name="VCBscMakeTool"
				SuppressStartupBanner="true"
				OutputFile=".\Debug/libtommath.bsc"
			/>
			<Tool
				Name="VCFxCopTool"
			/>
			<Tool
				Name="VCPostBuildEventTool"
			/>
		</Configuration>
		<Configuration
			Name="Release|Win32"
			OutputDirectory=".\Release"
			IntermediateDirectory=".\Release"
			ConfigurationType="4"
			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
			UseOfMFC="0"
			ATLMinimizesCRunTimeLibraryUsage="false"
			CharacterSet="2"
			>
			<Tool
				Name="VCPreBuildEventTool"
			/>
			<Tool
				Name="VCCustomBuildTool"
			/>
			<Tool
				Name="VCXMLDataGeneratorTool"
			/>
			<Tool
				Name="VCWebServiceProxyGeneratorTool"
			/>
			<Tool
				Name="VCMIDLTool"

			/>
			<Tool
				Name="VCCLCompilerTool"
				Optimization="2"
				InlineFunctionExpansion="1"
				AdditionalIncludeDirectories="."
				PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
				StringPooling="true"
				RuntimeLibrary="0"
				EnableFunctionLevelLinking="true"
				PrecompiledHeaderFile=".\Release/libtommath.pch"
				AssemblerListingLocation=".\Release/"
				ObjectFile=".\Release/"
				ProgramDataBaseFileName=".\Release/"
				WarningLevel="3"
				SuppressStartupBanner="true"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
				Name="VCResourceCompilerTool"
				PreprocessorDefinitions="NDEBUG"
				Culture="1033"
			/>
			<Tool
				Name="VCPreLinkEventTool"
			/>
			<Tool
				Name="VCLibrarianTool"
				OutputFile="Release\tommath.lib"
				SuppressStartupBanner="true"
			/>
			<Tool
				Name="VCALinkTool"
			/>
			<Tool
				Name="VCXDCMakeTool"
			/>
			<Tool
				Name="VCBscMakeTool"
				SuppressStartupBanner="true"
				OutputFile=".\Release/libtommath.bsc"
			/>
			<Tool
				Name="VCFxCopTool"
			/>
			<Tool
				Name="VCPostBuildEventTool"
			/>
		</Configuration>
	</Configurations>
	<References>
	</References>
	<Files>
		<File
			RelativePath="bn_error.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_fast_mp_invmod.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_fast_mp_montgomery_reduce.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_fast_s_mp_mul_digs.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_fast_s_mp_mul_high_digs.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_fast_s_mp_sqr.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_2expt.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_abs.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_add.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_add_d.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_addmod.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_and.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_clamp.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_clear.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_clear_multi.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_cmp.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_cmp_d.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_cmp_mag.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_cnt_lsb.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_copy.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_count_bits.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_div.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_div_2.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_div_2d.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_div_3.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_div_d.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_dr_is_modulus.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_dr_reduce.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_dr_setup.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_exch.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath=".\bn_mp_export.c"
			>
		</File>
		<File
			RelativePath="bn_mp_expt_d.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_exptmod.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_exptmod_fast.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_exteuclid.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_fread.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_fwrite.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_gcd.c"
			>

			<FileConfiguration
				Name="Debug|Win32"

				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_get_int.c"
			>

			<FileConfiguration
				Name="Debug|Win32"

				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_grow.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath=".\bn_mp_import.c"
			>
		</File>
		<File
			RelativePath="bn_mp_init.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_init_copy.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_init_multi.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_init_set.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_init_set_int.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_init_size.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_invmod.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_invmod_slow.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_is_square.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_jacobi.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_karatsuba_mul.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_karatsuba_sqr.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_lcm.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_lshd.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_mod.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_mod_2d.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_mod_d.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_montgomery_calc_normalization.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_montgomery_reduce.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_montgomery_setup.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_mul.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_mul_2.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_mul_2d.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_mul_d.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_mulmod.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_n_root.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_neg.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_or.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_prime_fermat.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"

				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_prime_is_divisible.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_prime_is_prime.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_prime_miller_rabin.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_prime_next_prime.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_prime_rabin_miller_trials.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_prime_random_ex.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"

				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_radix_size.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_radix_smap.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_rand.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_read_radix.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_read_signed_bin.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_read_unsigned_bin.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_reduce.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_reduce_2k.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_reduce_2k_l.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_reduce_2k_setup.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_reduce_2k_setup_l.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_reduce_is_2k.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_reduce_is_2k_l.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_reduce_setup.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_rshd.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_set.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_set_int.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_shrink.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_signed_bin_size.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_sqr.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_sqrmod.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_sqrt.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_sub.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_sub_d.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_submod.c"
			>

			<FileConfiguration
				Name="Debug|Win32"

				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_to_signed_bin.c"
			>

			<FileConfiguration
				Name="Debug|Win32"

				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_to_signed_bin_n.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_to_unsigned_bin.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_to_unsigned_bin_n.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_toom_mul.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_toom_sqr.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_toradix.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_toradix_n.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_unsigned_bin_size.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_xor.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_mp_zero.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_prime_tab.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_reverse.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_s_mp_add.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_s_mp_exptmod.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_s_mp_mul_digs.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_s_mp_mul_high_digs.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_s_mp_sqr.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bn_s_mp_sub.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="bncore.c"
			>
			<FileConfiguration
				Name="Debug|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
			<FileConfiguration
				Name="Release|Win32"
				>
				<Tool
					Name="VCCLCompilerTool"
					AdditionalIncludeDirectories=""
					PreprocessorDefinitions=""
				/>
			</FileConfiguration>
		</File>
		<File
			RelativePath="tommath.h"
			>
		</File>
		<File
			RelativePath="tommath_class.h"
			>




		</File>
		<File
			RelativePath="tommath_superclass.h"
			>
		</File>
	</Files>
	<Globals>
	</Globals>
</VisualStudioProject>




|

|






>
>
>






|
|

|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


|











<
<
<

>





|

>


|
|
|
|


|
>














|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>











|









|
|
|

<


|











<
<
<

>






|



|
|
|
|
















|











|















<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
|
|
|
|
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


|





<
<
<
<
<
<
<
<
|
|
|
|
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




>
|
<
>
|
<
<
<
<
<
|
|
|
|
<
<
<
<
<
<




>
|
<
>
|
<
<
<
<
<
|
|
|
|
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


|





<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
|
|
|
|
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
|
|
|
|
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
|
|
<
>
|
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
|
|
<
>
|
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
|
|
|
|
<
<
<
<
<
<




<
<
<
<
<
<
<
<
|
|
|
|
<
<
<
<
<
<


|

<
<
<
<
<
<
<
<
|
|
|
|
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
|
|
|
|
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




>
|
<
>
|
<
<
<
<
<
|
|
|
|
<
<
<
<
<
<


|

>
|
<
>
|
<
<
<
<
<
|
|
|
|
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<








>
>
>
>









1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317


















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
343
344
345


















346
347
348
349


















350
351
352
353


















354
355
356
357


















358
359
360
361


















362
363
364
365


















366
367
368
369


















370
371
372
373


















374
375
376
377


















378
379
380
381


















382
383
384
385


















386
387
388
389








390
391
392
393






394
395
396
397


















398
399
400
401


















402
403
404
405


















406
407
408
409


















410
411
412
413


















414
415
416
417


















418
419
420
421


















422
423
424
425


















426
427
428
429


















430
431
432
433


















434
435
436
437


















438
439
440
441
442
443
444
445








446
447
448
449






450
451
452
453


















454
455
456
457


















458
459
460
461


















462
463
464
465


















466
467
468
469


















470
471
472
473
474
475

476
477





478
479
480
481






482
483
484
485
486
487

488
489





490
491
492
493






494
495
496
497


















498
499
500
501
502
503
504
505


















506
507
508
509


















510
511
512
513


















514
515
516
517


















518
519
520
521


















522
523
524
525


















526
527
528
529


















530
531
532
533


















534
535
536
537


















538
539
540
541


















542
543
544
545


















546
547
548
549








550
551
552
553






554
555
556
557


















558
559
560
561


















562
563
564
565


















566
567
568
569


















570
571
572
573


















574
575
576
577


















578
579
580
581


















582
583
584
585


















586
587
588
589


















590
591
592
593


















594
595
596
597


















598
599
600
601


















602
603
604
605


















606
607
608
609








610
611
612
613






614
615
616
617


















618
619
620
621


















622
623
624
625








626
627

628
629






630
631
632
633


















634
635
636
637


















638
639
640
641


















642
643
644
645


















646
647
648
649


















650
651
652
653








654
655

656
657






658
659
660
661


















662
663
664
665


















666
667
668
669


















670
671
672
673


















674
675
676
677


















678
679
680
681


















682
683
684
685


















686
687
688
689


















690
691
692
693


















694
695
696
697


















698
699
700
701


















702
703
704
705


















706
707
708
709


















710
711
712
713


















714
715
716
717


















718
719
720
721








722
723
724
725






726
727
728
729








730
731
732
733






734
735
736
737








738
739
740
741






742
743
744
745


















746
747
748
749


















750
751
752
753


















754
755
756
757








758
759
760
761






762
763
764
765


















766
767
768
769


















770
771
772
773
774
775

776
777





778
779
780
781






782
783
784
785
786
787

788
789





790
791
792
793






794
795
796
797


















798
799
800
801


















802
803
804
805


















806
807
808
809


















810
811
812
813


















814
815
816
817


















818
819
820
821


















822
823
824
825


















826
827
828
829


















830
831
832
833


















834
835
836
837


















838
839
840
841


















842
843
844
845


















846
847
848
849


















850
851
852
853


















854
855
856
857


















858
859
860
861


















862
863
864
865


















866
867
868
869


















870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
	ProjectType="Visual C++"
	Version="9.00"
	Name="tommath"
	ProjectGUID="{42109FEE-B0B9-4FCD-9E56-2863BF8C55D2}"
	RootNamespace="tommath"
	TargetFrameworkVersion="0"
	>
	<Platforms>
		<Platform
			Name="Win32"
		/>
		<Platform
			Name="x64"
		/>
	</Platforms>
	<ToolFiles>
	</ToolFiles>
	<Configurations>
		<Configuration
			Name="Debug|Win32"
			OutputDirectory="MSVC_$(PlatformName)_$(ConfigurationName)"
			IntermediateDirectory="MSVC_$(PlatformName)_$(ConfigurationName)\Intermediate"
			ConfigurationType="4"
			UseOfMFC="0"
			ATLMinimizesCRunTimeLibraryUsage="false"
			CharacterSet="0"
			>
			<Tool
				Name="VCPreBuildEventTool"
			/>
			<Tool
				Name="VCCustomBuildTool"
			/>
			<Tool
				Name="VCXMLDataGeneratorTool"
			/>
			<Tool
				Name="VCMIDLTool"
			/>
			<Tool
				Name="VCCLCompilerTool"
				Optimization="0"
				AdditionalIncludeDirectories="."
				PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE"
				MinimalRebuild="true"
				ExceptionHandling="0"
				BasicRuntimeChecks="3"
				RuntimeLibrary="1"
				PrecompiledHeaderFile="$(IntDir)\libtomcrypt.pch"
				AssemblerListingLocation="$(IntDir)\"
				ObjectFile="$(IntDir)\"
				ProgramDataBaseFileName="$(IntDir)\"
				WarningLevel="3"
				SuppressStartupBanner="true"
				DebugInformationFormat="4"
				CompileAs="1"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
				Name="VCResourceCompilerTool"
				PreprocessorDefinitions="_DEBUG"
				Culture="1033"
			/>
			<Tool
				Name="VCPreLinkEventTool"
			/>
			<Tool
				Name="VCLibrarianTool"
				OutputFile="$(OutDir)\tommath.lib"
				SuppressStartupBanner="true"
			/>
			<Tool
				Name="VCALinkTool"
			/>
			<Tool
				Name="VCXDCMakeTool"
			/>
			<Tool
				Name="VCBscMakeTool"
				SuppressStartupBanner="true"
				OutputFile="$(OutDir)\tommath.bsc"
			/>
			<Tool
				Name="VCFxCopTool"
			/>
			<Tool
				Name="VCPostBuildEventTool"
			/>
		</Configuration>
		<Configuration
			Name="Debug|x64"
			OutputDirectory="MSVC_$(PlatformName)_$(ConfigurationName)"
			IntermediateDirectory="MSVC_$(PlatformName)_$(ConfigurationName)\Intermediate"
			ConfigurationType="4"
			UseOfMFC="0"
			ATLMinimizesCRunTimeLibraryUsage="false"
			CharacterSet="0"
			>
			<Tool
				Name="VCPreBuildEventTool"
			/>
			<Tool
				Name="VCCustomBuildTool"
			/>
			<Tool
				Name="VCXMLDataGeneratorTool"
			/>
			<Tool



				Name="VCMIDLTool"
				TargetEnvironment="3"
			/>
			<Tool
				Name="VCCLCompilerTool"
				Optimization="0"
				AdditionalIncludeDirectories="."
				PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE"
				MinimalRebuild="true"
				ExceptionHandling="0"
				BasicRuntimeChecks="3"
				RuntimeLibrary="1"
				PrecompiledHeaderFile="$(IntDir)\libtomcrypt.pch"
				AssemblerListingLocation="$(IntDir)\"
				ObjectFile="$(IntDir)\"
				ProgramDataBaseFileName="$(IntDir)\"
				WarningLevel="3"
				SuppressStartupBanner="true"
				DebugInformationFormat="3"
				CompileAs="1"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
				Name="VCResourceCompilerTool"
				PreprocessorDefinitions="_DEBUG"
				Culture="1033"
			/>
			<Tool
				Name="VCPreLinkEventTool"
			/>
			<Tool
				Name="VCLibrarianTool"
				OutputFile="$(OutDir)\tommath.lib"
				SuppressStartupBanner="true"
			/>
			<Tool
				Name="VCALinkTool"
			/>
			<Tool
				Name="VCXDCMakeTool"
			/>
			<Tool
				Name="VCBscMakeTool"
				SuppressStartupBanner="true"
				OutputFile="$(OutDir)\tommath.bsc"
			/>
			<Tool
				Name="VCFxCopTool"
			/>
			<Tool
				Name="VCPostBuildEventTool"
			/>
		</Configuration>
		<Configuration
			Name="Release|Win32"
			OutputDirectory="MSVC_$(PlatformName)_$(ConfigurationName)"
			IntermediateDirectory="MSVC_$(PlatformName)_$(ConfigurationName)\Intermediate"
			ConfigurationType="4"
			UseOfMFC="0"
			ATLMinimizesCRunTimeLibraryUsage="false"
			CharacterSet="0"
			>
			<Tool
				Name="VCPreBuildEventTool"
			/>
			<Tool
				Name="VCCustomBuildTool"
			/>
			<Tool
				Name="VCXMLDataGeneratorTool"
			/>
			<Tool
				Name="VCMIDLTool"
			/>
			<Tool
				Name="VCCLCompilerTool"
				Optimization="2"
				InlineFunctionExpansion="1"
				AdditionalIncludeDirectories="."
				PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE"
				StringPooling="true"
				RuntimeLibrary="0"
				EnableFunctionLevelLinking="true"
				PrecompiledHeaderFile="$(IntDir)\libtomcrypt.pch"
				AssemblerListingLocation="$(IntDir)\"
				ObjectFile="$(IntDir)\"
				ProgramDataBaseFileName="$(IntDir)\"
				WarningLevel="3"
				SuppressStartupBanner="true"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
				Name="VCResourceCompilerTool"
				PreprocessorDefinitions="NDEBUG"
				Culture="1033"
			/>
			<Tool
				Name="VCPreLinkEventTool"
			/>
			<Tool
				Name="VCLibrarianTool"
				OutputFile="$(OutDir)\tommath.lib"
				SuppressStartupBanner="true"
			/>
			<Tool
				Name="VCALinkTool"
			/>
			<Tool
				Name="VCXDCMakeTool"
			/>
			<Tool
				Name="VCBscMakeTool"
				SuppressStartupBanner="true"
				OutputFile="$(OutDir)\tommath.bsc"
			/>
			<Tool
				Name="VCFxCopTool"
			/>
			<Tool
				Name="VCPostBuildEventTool"
			/>
		</Configuration>
		<Configuration
			Name="Release|x64"
			OutputDirectory="MSVC_$(PlatformName)_$(ConfigurationName)"
			IntermediateDirectory="MSVC_$(PlatformName)_$(ConfigurationName)\Intermediate"
			ConfigurationType="4"

			UseOfMFC="0"
			ATLMinimizesCRunTimeLibraryUsage="false"
			CharacterSet="0"
			>
			<Tool
				Name="VCPreBuildEventTool"
			/>
			<Tool
				Name="VCCustomBuildTool"
			/>
			<Tool
				Name="VCXMLDataGeneratorTool"
			/>
			<Tool



				Name="VCMIDLTool"
				TargetEnvironment="3"
			/>
			<Tool
				Name="VCCLCompilerTool"
				Optimization="2"
				InlineFunctionExpansion="1"
				AdditionalIncludeDirectories="."
				PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE"
				StringPooling="true"
				RuntimeLibrary="0"
				EnableFunctionLevelLinking="true"
				PrecompiledHeaderFile="$(IntDir)\libtomcrypt.pch"
				AssemblerListingLocation="$(IntDir)\"
				ObjectFile="$(IntDir)\"
				ProgramDataBaseFileName="$(IntDir)\"
				WarningLevel="3"
				SuppressStartupBanner="true"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
				Name="VCResourceCompilerTool"
				PreprocessorDefinitions="NDEBUG"
				Culture="1033"
			/>
			<Tool
				Name="VCPreLinkEventTool"
			/>
			<Tool
				Name="VCLibrarianTool"
				OutputFile="$(OutDir)\tommath.lib"
				SuppressStartupBanner="true"
			/>
			<Tool
				Name="VCALinkTool"
			/>
			<Tool
				Name="VCXDCMakeTool"
			/>
			<Tool
				Name="VCBscMakeTool"
				SuppressStartupBanner="true"
				OutputFile="$(OutDir)\tommath.bsc"
			/>
			<Tool
				Name="VCFxCopTool"
			/>
			<Tool
				Name="VCPostBuildEventTool"
			/>
		</Configuration>
	</Configurations>
	<References>
	</References>
	<Files>
		<File
			RelativePath="bn_error.c"
			>


















		</File>
		<File
			RelativePath="bn_fast_mp_invmod.c"
			>


















		</File>
		<File
			RelativePath="bn_fast_mp_montgomery_reduce.c"
			>


















		</File>
		<File
			RelativePath="bn_fast_s_mp_mul_digs.c"
			>


















		</File>
		<File
			RelativePath="bn_fast_s_mp_mul_high_digs.c"
			>


















		</File>
		<File
			RelativePath="bn_fast_s_mp_sqr.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_2expt.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_abs.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_add.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_add_d.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_addmod.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_and.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_clamp.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_clear.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_clear_multi.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_cmp.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_cmp_d.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_cmp_mag.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_cnt_lsb.c"
			>








		</File>
		<File
			RelativePath="bn_mp_complement.c"
			>






		</File>
		<File
			RelativePath="bn_mp_copy.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_count_bits.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_div.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_div_2.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_div_2d.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_div_3.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_div_d.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_dr_is_modulus.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_dr_reduce.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_dr_setup.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_exch.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_export.c"
			>
		</File>
		<File
			RelativePath="bn_mp_expt_d.c"
			>








		</File>
		<File
			RelativePath="bn_mp_expt_d_ex.c"
			>






		</File>
		<File
			RelativePath="bn_mp_exptmod.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_exptmod_fast.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_exteuclid.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_fread.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_fwrite.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_gcd.c"
			>
		</File>
		<File

			RelativePath="bn_mp_get_bit.c"
			>





		</File>
		<File
			RelativePath="bn_mp_get_double.c"
			>






		</File>
		<File
			RelativePath="bn_mp_get_int.c"
			>
		</File>
		<File

			RelativePath="bn_mp_get_long.c"
			>





		</File>
		<File
			RelativePath="bn_mp_get_long_long.c"
			>






		</File>
		<File
			RelativePath="bn_mp_grow.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_import.c"
			>
		</File>
		<File
			RelativePath="bn_mp_init.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_init_copy.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_init_multi.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_init_set.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_init_set_int.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_init_size.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_invmod.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_invmod_slow.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_is_square.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_jacobi.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_karatsuba_mul.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_karatsuba_sqr.c"
			>








		</File>
		<File
			RelativePath="bn_mp_kronecker.c"
			>






		</File>
		<File
			RelativePath="bn_mp_lcm.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_lshd.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_mod.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_mod_2d.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_mod_d.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_montgomery_calc_normalization.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_montgomery_reduce.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_montgomery_setup.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_mul.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_mul_2.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_mul_2d.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_mul_d.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_mulmod.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_n_root.c"
			>








		</File>
		<File
			RelativePath="bn_mp_n_root_ex.c"
			>






		</File>
		<File
			RelativePath="bn_mp_neg.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_or.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_prime_fermat.c"
			>








		</File>
		<File

			RelativePath="bn_mp_prime_frobenius_underwood.c"
			>






		</File>
		<File
			RelativePath="bn_mp_prime_is_divisible.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_prime_is_prime.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_prime_miller_rabin.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_prime_next_prime.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_prime_rabin_miller_trials.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_prime_random_ex.c"
			>








		</File>
		<File

			RelativePath="bn_mp_prime_strong_lucas_selfridge.c"
			>






		</File>
		<File
			RelativePath="bn_mp_radix_size.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_radix_smap.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_rand.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_read_radix.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_read_signed_bin.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_read_unsigned_bin.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_reduce.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_reduce_2k.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_reduce_2k_l.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_reduce_2k_setup.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_reduce_2k_setup_l.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_reduce_is_2k.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_reduce_is_2k_l.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_reduce_setup.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_rshd.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_set.c"
			>








		</File>
		<File
			RelativePath="bn_mp_set_double.c"
			>






		</File>
		<File
			RelativePath="bn_mp_set_int.c"
			>








		</File>
		<File
			RelativePath="bn_mp_set_long.c"
			>






		</File>
		<File
			RelativePath="bn_mp_set_long_long.c"
			>








		</File>
		<File
			RelativePath="bn_mp_shrink.c"
			>






		</File>
		<File
			RelativePath="bn_mp_signed_bin_size.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_sqr.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_sqrmod.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_sqrt.c"
			>








		</File>
		<File
			RelativePath="bn_mp_sqrtmod_prime.c"
			>






		</File>
		<File
			RelativePath="bn_mp_sub.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_sub_d.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_submod.c"
			>
		</File>
		<File

			RelativePath="bn_mp_tc_and.c"
			>





		</File>
		<File
			RelativePath="bn_mp_tc_div_2d.c"
			>






		</File>
		<File
			RelativePath="bn_mp_tc_or.c"
			>
		</File>
		<File

			RelativePath="bn_mp_tc_xor.c"
			>





		</File>
		<File
			RelativePath="bn_mp_to_signed_bin.c"
			>






		</File>
		<File
			RelativePath="bn_mp_to_signed_bin_n.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_to_unsigned_bin.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_to_unsigned_bin_n.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_toom_mul.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_toom_sqr.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_toradix.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_toradix_n.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_unsigned_bin_size.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_xor.c"
			>


















		</File>
		<File
			RelativePath="bn_mp_zero.c"
			>


















		</File>
		<File
			RelativePath="bn_prime_tab.c"
			>


















		</File>
		<File
			RelativePath="bn_reverse.c"
			>


















		</File>
		<File
			RelativePath="bn_s_mp_add.c"
			>


















		</File>
		<File
			RelativePath="bn_s_mp_exptmod.c"
			>


















		</File>
		<File
			RelativePath="bn_s_mp_mul_digs.c"
			>


















		</File>
		<File
			RelativePath="bn_s_mp_mul_high_digs.c"
			>


















		</File>
		<File
			RelativePath="bn_s_mp_sqr.c"
			>


















		</File>
		<File
			RelativePath="bn_s_mp_sub.c"
			>


















		</File>
		<File
			RelativePath="bncore.c"
			>


















		</File>
		<File
			RelativePath="tommath.h"
			>
		</File>
		<File
			RelativePath="tommath_class.h"
			>
		</File>
		<File
			RelativePath="tommath_private.h"
			>
		</File>
		<File
			RelativePath="tommath_superclass.h"
			>
		</File>
	</Files>
	<Globals>
	</Globals>
</VisualStudioProject>
Changes to libtommath/makefile.
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

41
42
43
44
45
46
47
48
49
50

51
52
53
54
55
56
57
58
59
	@echo "   * ${CC} $@"
endif
	${silent} ${CC} -c ${CFLAGS} $< -o $@

LCOV_ARGS=--directory .

#START_INS
OBJECTS=bncore.o bn_error.o bn_fast_mp_invmod.o bn_fast_mp_montgomery_reduce.o bn_fast_s_mp_mul_digs.o \
bn_fast_s_mp_mul_high_digs.o bn_fast_s_mp_sqr.o bn_mp_2expt.o bn_mp_abs.o bn_mp_add.o bn_mp_add_d.o \
bn_mp_addmod.o bn_mp_and.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_complement.o bn_mp_copy.o bn_mp_count_bits.o bn_mp_div_2.o \
bn_mp_div_2d.o bn_mp_div_3.o bn_mp_div.o bn_mp_div_d.o bn_mp_dr_is_modulus.o bn_mp_dr_reduce.o \
bn_mp_dr_setup.o bn_mp_exch.o bn_mp_export.o bn_mp_expt_d.o bn_mp_expt_d_ex.o bn_mp_exptmod.o \
bn_mp_exptmod_fast.o bn_mp_exteuclid.o bn_mp_fread.o bn_mp_fwrite.o bn_mp_gcd.o bn_mp_get_int.o \
bn_mp_get_long.o bn_mp_get_long_long.o bn_mp_grow.o bn_mp_import.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_invmod.o \
bn_mp_invmod_slow.o bn_mp_is_square.o bn_mp_jacobi.o bn_mp_karatsuba_mul.o bn_mp_karatsuba_sqr.o \
bn_mp_lcm.o bn_mp_lshd.o bn_mp_mod_2d.o bn_mp_mod.o bn_mp_mod_d.o bn_mp_montgomery_calc_normalization.o \
bn_mp_montgomery_reduce.o bn_mp_montgomery_setup.o bn_mp_mul_2.o bn_mp_mul_2d.o bn_mp_mul.o bn_mp_mul_d.o \

bn_mp_mulmod.o bn_mp_neg.o bn_mp_n_root.o bn_mp_n_root_ex.o bn_mp_or.o bn_mp_prime_fermat.o \
bn_mp_prime_is_divisible.o bn_mp_prime_is_prime.o bn_mp_prime_miller_rabin.o bn_mp_prime_next_prime.o \
bn_mp_prime_rabin_miller_trials.o bn_mp_prime_random_ex.o bn_mp_radix_size.o bn_mp_radix_smap.o \
bn_mp_rand.o bn_mp_read_radix.o bn_mp_read_signed_bin.o bn_mp_read_unsigned_bin.o bn_mp_reduce_2k.o \
bn_mp_reduce_2k_l.o bn_mp_reduce_2k_setup.o bn_mp_reduce_2k_setup_l.o bn_mp_reduce.o \
bn_mp_reduce_is_2k.o bn_mp_reduce_is_2k_l.o bn_mp_reduce_setup.o bn_mp_rshd.o bn_mp_set.o bn_mp_set_int.o \
bn_mp_set_long.o bn_mp_set_long_long.o bn_mp_shrink.o bn_mp_signed_bin_size.o bn_mp_sqr.o bn_mp_sqrmod.o \
bn_mp_sqrt.o bn_mp_sqrtmod_prime.o bn_mp_sub.o bn_mp_sub_d.o bn_mp_submod.o bn_mp_tc_and.o \
bn_mp_tc_div_2d.o bn_mp_tc_or.o bn_mp_tc_xor.o bn_mp_toom_mul.o bn_mp_toom_sqr.o bn_mp_toradix.o \
bn_mp_toradix_n.o bn_mp_to_signed_bin.o bn_mp_to_signed_bin_n.o bn_mp_to_unsigned_bin.o \

bn_mp_to_unsigned_bin_n.o bn_mp_unsigned_bin_size.o bn_mp_xor.o bn_mp_zero.o bn_prime_tab.o bn_reverse.o \
bn_s_mp_add.o bn_s_mp_exptmod.o bn_s_mp_mul_digs.o bn_s_mp_mul_high_digs.o bn_s_mp_sqr.o bn_s_mp_sub.o

#END_INS

$(OBJECTS): $(HEADERS)

$(LIBNAME):  $(OBJECTS)
	$(AR) $(ARFLAGS) $@ $(OBJECTS)







|


|
|

|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
>
|
|







22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
	@echo "   * ${CC} $@"
endif
	${silent} ${CC} -c ${CFLAGS} $< -o $@

LCOV_ARGS=--directory .

#START_INS
OBJECTS=bn_error.o bn_fast_mp_invmod.o bn_fast_mp_montgomery_reduce.o bn_fast_s_mp_mul_digs.o \
bn_fast_s_mp_mul_high_digs.o bn_fast_s_mp_sqr.o bn_mp_2expt.o bn_mp_abs.o bn_mp_add.o bn_mp_add_d.o \
bn_mp_addmod.o bn_mp_and.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_complement.o bn_mp_copy.o bn_mp_count_bits.o bn_mp_div.o \
bn_mp_div_2.o bn_mp_div_2d.o bn_mp_div_3.o bn_mp_div_d.o bn_mp_dr_is_modulus.o bn_mp_dr_reduce.o \
bn_mp_dr_setup.o bn_mp_exch.o bn_mp_export.o bn_mp_expt_d.o bn_mp_expt_d_ex.o bn_mp_exptmod.o \
bn_mp_exptmod_fast.o bn_mp_exteuclid.o bn_mp_fread.o bn_mp_fwrite.o bn_mp_gcd.o bn_mp_get_bit.o \
bn_mp_get_double.o bn_mp_get_int.o bn_mp_get_long.o bn_mp_get_long_long.o bn_mp_grow.o bn_mp_import.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_invmod.o bn_mp_invmod_slow.o bn_mp_is_square.o bn_mp_jacobi.o bn_mp_karatsuba_mul.o \
bn_mp_karatsuba_sqr.o bn_mp_kronecker.o bn_mp_lcm.o bn_mp_lshd.o bn_mp_mod.o bn_mp_mod_2d.o bn_mp_mod_d.o \
bn_mp_montgomery_calc_normalization.o bn_mp_montgomery_reduce.o bn_mp_montgomery_setup.o bn_mp_mul.o \
bn_mp_mul_2.o bn_mp_mul_2d.o bn_mp_mul_d.o bn_mp_mulmod.o bn_mp_n_root.o bn_mp_n_root_ex.o bn_mp_neg.o \
bn_mp_or.o bn_mp_prime_fermat.o bn_mp_prime_frobenius_underwood.o bn_mp_prime_is_divisible.o \
bn_mp_prime_is_prime.o bn_mp_prime_miller_rabin.o bn_mp_prime_next_prime.o \
bn_mp_prime_rabin_miller_trials.o bn_mp_prime_random_ex.o bn_mp_prime_strong_lucas_selfridge.o \
bn_mp_radix_size.o bn_mp_radix_smap.o bn_mp_rand.o bn_mp_read_radix.o bn_mp_read_signed_bin.o \
bn_mp_read_unsigned_bin.o bn_mp_reduce.o bn_mp_reduce_2k.o bn_mp_reduce_2k_l.o bn_mp_reduce_2k_setup.o \
bn_mp_reduce_2k_setup_l.o bn_mp_reduce_is_2k.o bn_mp_reduce_is_2k_l.o bn_mp_reduce_setup.o bn_mp_rshd.o \
bn_mp_set.o bn_mp_set_double.o bn_mp_set_int.o bn_mp_set_long.o bn_mp_set_long_long.o bn_mp_shrink.o \
bn_mp_signed_bin_size.o bn_mp_sqr.o bn_mp_sqrmod.o bn_mp_sqrt.o bn_mp_sqrtmod_prime.o bn_mp_sub.o \
bn_mp_sub_d.o bn_mp_submod.o bn_mp_tc_and.o bn_mp_tc_div_2d.o bn_mp_tc_or.o bn_mp_tc_xor.o \
bn_mp_to_signed_bin.o bn_mp_to_signed_bin_n.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.o bn_mp_toradix_n.o bn_mp_unsigned_bin_size.o bn_mp_xor.o \
bn_mp_zero.o bn_prime_tab.o bn_reverse.o bn_s_mp_add.o bn_s_mp_exptmod.o bn_s_mp_mul_digs.o \
bn_s_mp_mul_high_digs.o bn_s_mp_sqr.o bn_s_mp_sub.o bncore.o

#END_INS

$(OBJECTS): $(HEADERS)

$(LIBNAME):  $(OBJECTS)
	$(AR) $(ARFLAGS) $@ $(OBJECTS)
135
136
137
138
139
140
141


142
143
144
145
146
147
148
149
150
151
152
153
154
	@echo 'fixme check'
	-@(find libtommath-$(VERSION)/ -type f | xargs grep 'FIXM[E]') && echo '############## BEWARE: the "fixme" marker was found !!! ##############' || true
	mkdir -p libtommath-$(VERSION)/doc
	cp doc/bn.pdf doc/tommath.pdf doc/poster.pdf libtommath-$(VERSION)/doc/
	$(MAKE) -C libtommath-$(VERSION)/ pre_gen
	tar -c libtommath-$(VERSION)/ | xz -6e -c - > ltm-$(VERSION).tar.xz
	zip -9rq ltm-$(VERSION).zip libtommath-$(VERSION)


	rm -rf libtommath-$(VERSION)
	gpg -b -a ltm-$(VERSION).tar.xz
	gpg -b -a ltm-$(VERSION).zip

new_file:
	bash updatemakes.sh
	perl dep.pl

perlcritic:
	perlcritic *.pl doc/*.pl

astyle:
	astyle --options=astylerc $(OBJECTS:.o=.c) tommath*.h demo/*.c etc/*.c mtest/mtest.c







>
>













137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
	@echo 'fixme check'
	-@(find libtommath-$(VERSION)/ -type f | xargs grep 'FIXM[E]') && echo '############## BEWARE: the "fixme" marker was found !!! ##############' || true
	mkdir -p libtommath-$(VERSION)/doc
	cp doc/bn.pdf doc/tommath.pdf doc/poster.pdf libtommath-$(VERSION)/doc/
	$(MAKE) -C libtommath-$(VERSION)/ pre_gen
	tar -c libtommath-$(VERSION)/ | xz -6e -c - > ltm-$(VERSION).tar.xz
	zip -9rq ltm-$(VERSION).zip libtommath-$(VERSION)
	cp doc/bn.pdf bn-$(VERSION).pdf
	cp doc/tommath.pdf tommath-$(VERSION).pdf
	rm -rf libtommath-$(VERSION)
	gpg -b -a ltm-$(VERSION).tar.xz
	gpg -b -a ltm-$(VERSION).zip

new_file:
	bash updatemakes.sh
	perl dep.pl

perlcritic:
	perlcritic *.pl doc/*.pl

astyle:
	astyle --options=astylerc $(OBJECTS:.o=.c) tommath*.h demo/*.c etc/*.c mtest/mtest.c
Deleted libtommath/makefile.bcc.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#
# Borland C++Builder Makefile (makefile.bcc)
#


LIB = tlib
CC = bcc32
CFLAGS = -c -O2 -I.

#START_INS
OBJECTS=bncore.obj bn_error.obj bn_fast_mp_invmod.obj bn_fast_mp_montgomery_reduce.obj bn_fast_s_mp_mul_digs.obj \
bn_fast_s_mp_mul_high_digs.obj bn_fast_s_mp_sqr.obj bn_mp_2expt.obj bn_mp_abs.obj bn_mp_add.obj bn_mp_add_d.obj \
bn_mp_addmod.obj bn_mp_and.obj bn_mp_clamp.obj bn_mp_clear.obj bn_mp_clear_multi.obj bn_mp_cmp.obj bn_mp_cmp_d.obj \
bn_mp_cmp_mag.obj bn_mp_cnt_lsb.obj bn_mp_complement.obj bn_mp_copy.obj bn_mp_count_bits.obj bn_mp_div_2.obj \
bn_mp_div_2d.obj bn_mp_div_3.obj bn_mp_div.obj bn_mp_div_d.obj bn_mp_dr_is_modulus.obj bn_mp_dr_reduce.obj \
bn_mp_dr_setup.obj bn_mp_exch.obj bn_mp_export.obj bn_mp_expt_d.obj bn_mp_expt_d_ex.obj bn_mp_exptmod.obj \
bn_mp_exptmod_fast.obj bn_mp_exteuclid.obj bn_mp_fread.obj bn_mp_fwrite.obj bn_mp_gcd.obj bn_mp_get_int.obj \
bn_mp_get_long.obj bn_mp_get_long_long.obj bn_mp_grow.obj bn_mp_import.obj bn_mp_init.obj bn_mp_init_copy.obj \
bn_mp_init_multi.obj bn_mp_init_set.obj bn_mp_init_set_int.obj bn_mp_init_size.obj bn_mp_invmod.obj \
bn_mp_invmod_slow.obj bn_mp_is_square.obj bn_mp_jacobi.obj bn_mp_karatsuba_mul.obj bn_mp_karatsuba_sqr.obj \
bn_mp_lcm.obj bn_mp_lshd.obj bn_mp_mod_2d.obj bn_mp_mod.obj bn_mp_mod_d.obj bn_mp_montgomery_calc_normalization.obj \
bn_mp_montgomery_reduce.obj bn_mp_montgomery_setup.obj bn_mp_mul_2.obj bn_mp_mul_2d.obj bn_mp_mul.obj bn_mp_mul_d.obj \
bn_mp_mulmod.obj bn_mp_neg.obj bn_mp_n_root.obj bn_mp_n_root_ex.obj bn_mp_or.obj bn_mp_prime_fermat.obj \
bn_mp_prime_is_divisible.obj bn_mp_prime_is_prime.obj bn_mp_prime_miller_rabin.obj bn_mp_prime_next_prime.obj \
bn_mp_prime_rabin_miller_trials.obj bn_mp_prime_random_ex.obj bn_mp_radix_size.obj bn_mp_radix_smap.obj \
bn_mp_rand.obj bn_mp_read_radix.obj bn_mp_read_signed_bin.obj bn_mp_read_unsigned_bin.obj bn_mp_reduce_2k.obj \
bn_mp_reduce_2k_l.obj bn_mp_reduce_2k_setup.obj bn_mp_reduce_2k_setup_l.obj bn_mp_reduce.obj \
bn_mp_reduce_is_2k.obj bn_mp_reduce_is_2k_l.obj bn_mp_reduce_setup.obj bn_mp_rshd.obj bn_mp_set.obj bn_mp_set_int.obj \
bn_mp_set_long.obj bn_mp_set_long_long.obj bn_mp_shrink.obj bn_mp_signed_bin_size.obj bn_mp_sqr.obj bn_mp_sqrmod.obj \
bn_mp_sqrt.obj bn_mp_sqrtmod_prime.obj bn_mp_sub.obj bn_mp_sub_d.obj bn_mp_submod.obj bn_mp_tc_and.obj \
bn_mp_tc_div_2d.obj bn_mp_tc_or.obj bn_mp_tc_xor.obj bn_mp_toom_mul.obj bn_mp_toom_sqr.obj bn_mp_toradix.obj \
bn_mp_toradix_n.obj bn_mp_to_signed_bin.obj bn_mp_to_signed_bin_n.obj bn_mp_to_unsigned_bin.obj \
bn_mp_to_unsigned_bin_n.obj bn_mp_unsigned_bin_size.obj bn_mp_xor.obj bn_mp_zero.obj bn_prime_tab.obj bn_reverse.obj \
bn_s_mp_add.obj bn_s_mp_exptmod.obj bn_s_mp_mul_digs.obj bn_s_mp_mul_high_digs.obj bn_s_mp_sqr.obj bn_s_mp_sub.obj

#END_INS

HEADERS=tommath.h tommath_class.h tommath_superclass.h

TARGET = libtommath.lib

$(TARGET): $(OBJECTS)

.c.obj:
	$(CC) $(CFLAGS) $<
	$(LIB) $(TARGET) -+$@
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




























































































Deleted libtommath/makefile.cygwin_dll.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#Makefile for Cygwin-GCC
#
#This makefile will build a Windows DLL [doesn't require cygwin to run] in the file
#libtommath.dll.  The import library is in libtommath.dll.a.  Remember to add
#"-Wl,--enable-auto-import" to your client build to avoid the auto-import warnings
#
#Tom St Denis
CFLAGS  +=  -I./ -Wall -W -Wshadow -O3 -funroll-loops -mno-cygwin

#x86 optimizations [should be valid for any GCC install though]
CFLAGS  += -fomit-frame-pointer

default: windll

#START_INS
OBJECTS=bncore.o bn_error.o bn_fast_mp_invmod.o bn_fast_mp_montgomery_reduce.o bn_fast_s_mp_mul_digs.o \
bn_fast_s_mp_mul_high_digs.o bn_fast_s_mp_sqr.o bn_mp_2expt.o bn_mp_abs.o bn_mp_add.o bn_mp_add_d.o \
bn_mp_addmod.o bn_mp_and.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_complement.o bn_mp_copy.o bn_mp_count_bits.o bn_mp_div_2.o \
bn_mp_div_2d.o bn_mp_div_3.o bn_mp_div.o bn_mp_div_d.o bn_mp_dr_is_modulus.o bn_mp_dr_reduce.o \
bn_mp_dr_setup.o bn_mp_exch.o bn_mp_export.o bn_mp_expt_d.o bn_mp_expt_d_ex.o bn_mp_exptmod.o \
bn_mp_exptmod_fast.o bn_mp_exteuclid.o bn_mp_fread.o bn_mp_fwrite.o bn_mp_gcd.o bn_mp_get_int.o \
bn_mp_get_long.o bn_mp_get_long_long.o bn_mp_grow.o bn_mp_import.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_invmod.o \
bn_mp_invmod_slow.o bn_mp_is_square.o bn_mp_jacobi.o bn_mp_karatsuba_mul.o bn_mp_karatsuba_sqr.o \
bn_mp_lcm.o bn_mp_lshd.o bn_mp_mod_2d.o bn_mp_mod.o bn_mp_mod_d.o bn_mp_montgomery_calc_normalization.o \
bn_mp_montgomery_reduce.o bn_mp_montgomery_setup.o bn_mp_mul_2.o bn_mp_mul_2d.o bn_mp_mul.o bn_mp_mul_d.o \
bn_mp_mulmod.o bn_mp_neg.o bn_mp_n_root.o bn_mp_n_root_ex.o bn_mp_or.o bn_mp_prime_fermat.o \
bn_mp_prime_is_divisible.o bn_mp_prime_is_prime.o bn_mp_prime_miller_rabin.o bn_mp_prime_next_prime.o \
bn_mp_prime_rabin_miller_trials.o bn_mp_prime_random_ex.o bn_mp_radix_size.o bn_mp_radix_smap.o \
bn_mp_rand.o bn_mp_read_radix.o bn_mp_read_signed_bin.o bn_mp_read_unsigned_bin.o bn_mp_reduce_2k.o \
bn_mp_reduce_2k_l.o bn_mp_reduce_2k_setup.o bn_mp_reduce_2k_setup_l.o bn_mp_reduce.o \
bn_mp_reduce_is_2k.o bn_mp_reduce_is_2k_l.o bn_mp_reduce_setup.o bn_mp_rshd.o bn_mp_set.o bn_mp_set_int.o \
bn_mp_set_long.o bn_mp_set_long_long.o bn_mp_shrink.o bn_mp_signed_bin_size.o bn_mp_sqr.o bn_mp_sqrmod.o \
bn_mp_sqrt.o bn_mp_sqrtmod_prime.o bn_mp_sub.o bn_mp_sub_d.o bn_mp_submod.o bn_mp_tc_and.o \
bn_mp_tc_div_2d.o bn_mp_tc_or.o bn_mp_tc_xor.o bn_mp_toom_mul.o bn_mp_toom_sqr.o bn_mp_toradix.o \
bn_mp_toradix_n.o bn_mp_to_signed_bin.o bn_mp_to_signed_bin_n.o bn_mp_to_unsigned_bin.o \
bn_mp_to_unsigned_bin_n.o bn_mp_unsigned_bin_size.o bn_mp_xor.o bn_mp_zero.o bn_prime_tab.o bn_reverse.o \
bn_s_mp_add.o bn_s_mp_exptmod.o bn_s_mp_mul_digs.o bn_s_mp_mul_high_digs.o bn_s_mp_sqr.o bn_s_mp_sub.o

#END_INS

HEADERS=tommath.h tommath_class.h tommath_superclass.h

# make a Windows DLL via Cygwin
windll:  $(OBJECTS)
	gcc -mno-cygwin -mdll -o libtommath.dll -Wl,--out-implib=libtommath.dll.a -Wl,--export-all-symbols *.o
	ranlib libtommath.dll.a

# build the test program using the windows DLL
test: $(OBJECTS) windll
	gcc $(CFLAGS) demo/demo.c libtommath.dll.a -Wl,--enable-auto-import -o test -s
	cd mtest ; $(CC) -O3 -fomit-frame-pointer -funroll-loops mtest.c -o mtest -s

/* $Source: /cvs/libtom/libtommath/makefile.cygwin_dll,v $ */
/* $Revision: 1.2 $ */
/* $Date: 2005/05/05 14:38:45 $ */
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


















































































































Deleted libtommath/makefile.icc.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#Makefile for ICC
#
#Tom St Denis
CC=icc

CFLAGS  +=  -I./

# optimize for SPEED
#
# -mcpu= can be pentium, pentiumpro (covers PII through PIII) or pentium4
# -ax?   specifies make code specifically for ? but compatible with IA-32
# -x?    specifies compile solely for ? [not specifically IA-32 compatible]
#
# where ? is
#   K - PIII
#   W - first P4 [Williamette]
#   N - P4 Northwood
#   P - P4 Prescott
#   B - Blend of P4 and PM [mobile]
#
# Default to just generic max opts
CFLAGS += -O3 -xP -ip

#install as this user
USER=root
GROUP=root

default: libtommath.a

#default files to install
LIBNAME=libtommath.a

#LIBPATH-The directory for libtomcrypt to be installed to.
#INCPATH-The directory to install the header files for libtommath.
#DATAPATH-The directory to install the pdf docs.
DESTDIR=
LIBPATH=/usr/lib
INCPATH=/usr/include
DATAPATH=/usr/share/doc/libtommath/pdf

#START_INS
OBJECTS=bncore.o bn_error.o bn_fast_mp_invmod.o bn_fast_mp_montgomery_reduce.o bn_fast_s_mp_mul_digs.o \
bn_fast_s_mp_mul_high_digs.o bn_fast_s_mp_sqr.o bn_mp_2expt.o bn_mp_abs.o bn_mp_add.o bn_mp_add_d.o \
bn_mp_addmod.o bn_mp_and.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_complement.o bn_mp_copy.o bn_mp_count_bits.o bn_mp_div_2.o \
bn_mp_div_2d.o bn_mp_div_3.o bn_mp_div.o bn_mp_div_d.o bn_mp_dr_is_modulus.o bn_mp_dr_reduce.o \
bn_mp_dr_setup.o bn_mp_exch.o bn_mp_export.o bn_mp_expt_d.o bn_mp_expt_d_ex.o bn_mp_exptmod.o \
bn_mp_exptmod_fast.o bn_mp_exteuclid.o bn_mp_fread.o bn_mp_fwrite.o bn_mp_gcd.o bn_mp_get_int.o \
bn_mp_get_long.o bn_mp_get_long_long.o bn_mp_grow.o bn_mp_import.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_invmod.o \
bn_mp_invmod_slow.o bn_mp_is_square.o bn_mp_jacobi.o bn_mp_karatsuba_mul.o bn_mp_karatsuba_sqr.o \
bn_mp_lcm.o bn_mp_lshd.o bn_mp_mod_2d.o bn_mp_mod.o bn_mp_mod_d.o bn_mp_montgomery_calc_normalization.o \
bn_mp_montgomery_reduce.o bn_mp_montgomery_setup.o bn_mp_mul_2.o bn_mp_mul_2d.o bn_mp_mul.o bn_mp_mul_d.o \
bn_mp_mulmod.o bn_mp_neg.o bn_mp_n_root.o bn_mp_n_root_ex.o bn_mp_or.o bn_mp_prime_fermat.o \
bn_mp_prime_is_divisible.o bn_mp_prime_is_prime.o bn_mp_prime_miller_rabin.o bn_mp_prime_next_prime.o \
bn_mp_prime_rabin_miller_trials.o bn_mp_prime_random_ex.o bn_mp_radix_size.o bn_mp_radix_smap.o \
bn_mp_rand.o bn_mp_read_radix.o bn_mp_read_signed_bin.o bn_mp_read_unsigned_bin.o bn_mp_reduce_2k.o \
bn_mp_reduce_2k_l.o bn_mp_reduce_2k_setup.o bn_mp_reduce_2k_setup_l.o bn_mp_reduce.o \
bn_mp_reduce_is_2k.o bn_mp_reduce_is_2k_l.o bn_mp_reduce_setup.o bn_mp_rshd.o bn_mp_set.o bn_mp_set_int.o \
bn_mp_set_long.o bn_mp_set_long_long.o bn_mp_shrink.o bn_mp_signed_bin_size.o bn_mp_sqr.o bn_mp_sqrmod.o \
bn_mp_sqrt.o bn_mp_sqrtmod_prime.o bn_mp_sub.o bn_mp_sub_d.o bn_mp_submod.o bn_mp_tc_and.o \
bn_mp_tc_div_2d.o bn_mp_tc_or.o bn_mp_tc_xor.o bn_mp_toom_mul.o bn_mp_toom_sqr.o bn_mp_toradix.o \
bn_mp_toradix_n.o bn_mp_to_signed_bin.o bn_mp_to_signed_bin_n.o bn_mp_to_unsigned_bin.o \
bn_mp_to_unsigned_bin_n.o bn_mp_unsigned_bin_size.o bn_mp_xor.o bn_mp_zero.o bn_prime_tab.o bn_reverse.o \
bn_s_mp_add.o bn_s_mp_exptmod.o bn_s_mp_mul_digs.o bn_s_mp_mul_high_digs.o bn_s_mp_sqr.o bn_s_mp_sub.o

#END_INS

HEADERS=tommath.h tommath_class.h tommath_superclass.h

libtommath.a:  $(OBJECTS)
	$(AR) $(ARFLAGS) libtommath.a $(OBJECTS)
	ranlib libtommath.a

#make a profiled library (takes a while!!!)
#
# This will build the library with profile generation
# then run the test demo and rebuild the library.
#
# So far I've seen improvements in the MP math
profiled:
	make -f makefile.icc CFLAGS="$(CFLAGS) -prof_gen -DTESTING" timing
	./timing
	rm -f *.a *.o timing
	make -f makefile.icc CFLAGS="$(CFLAGS) -prof_use"

#make a single object profiled library
profiled_single:
	perl gen.pl
	$(CC) $(CFLAGS) -prof_gen -DTESTING -c mpi.c -o mpi.o
	$(CC) $(CFLAGS) -DTESTING -DTIMER demo/demo.c mpi.o -o timing
	./timing
	rm -f *.o timing
	$(CC) $(CFLAGS) -prof_use -ip -DTESTING -c mpi.c -o mpi.o
	$(AR) $(ARFLAGS) libtommath.a mpi.o
	ranlib libtommath.a

install: libtommath.a
	install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH)
	install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH)
	install -g $(GROUP) -o $(USER) $(LIBNAME) $(DESTDIR)$(LIBPATH)
	install -g $(GROUP) -o $(USER) $(HEADERS) $(DESTDIR)$(INCPATH)

test: libtommath.a demo/demo.o
	$(CC) demo/demo.o libtommath.a -o test

mtest: test
	cd mtest ; $(CC) $(CFLAGS) mtest.c -o mtest

timing: libtommath.a demo/timing.c
	$(CC) $(CFLAGS) -DTIMER demo/timing.c libtommath.a -o timing

clean:
	rm -f *.bat *.pdf *.o *.a *.obj *.lib *.exe *.dll etclib/*.o demo/demo.o test timing mpitest mtest/mtest mtest/mtest.exe \
        *.idx *.toc *.log *.aux *.dvi *.lof *.ind *.ilg *.ps *.log *.s mpi.c *.il etc/*.il *.dyn
	cd etc ; make clean
	cd pics ; make clean
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<










































































































































































































































Added libtommath/makefile.mingw.




















































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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
97
98
99
100
101
102
103
104
105
106
# MAKEFILE for MS Windows (mingw + gcc + gmake)
#
# BEWARE: variable OBJECTS is updated via ./updatemakes.sh

### USAGE:
# Open a command prompt with gcc + gmake in PATH and start:
#
# gmake -f makefile.mingw all
# test.exe
# gmake -f makefile.mingw PREFIX=c:\devel\libtom install

#The following can be overridden from command line e.g. make -f makefile.mingw CC=gcc ARFLAGS=rcs
PREFIX    = c:\mingw
CC        = gcc
AR        = ar
ARFLAGS   = r
RANLIB    = ranlib
STRIP     = strip
CFLAGS    = -O2
LDFLAGS   =

#Compilation flags
LTM_CFLAGS  = -I. $(CFLAGS)
LTM_LDFLAGS = $(LDFLAGS)

#Libraries to be created
LIBMAIN_S =libtommath.a
LIBMAIN_I =libtommath.dll.a
LIBMAIN_D =libtommath.dll

#List of objects to compile (all goes to libtommath.a)
OBJECTS=bn_error.o bn_fast_mp_invmod.o bn_fast_mp_montgomery_reduce.o bn_fast_s_mp_mul_digs.o \
bn_fast_s_mp_mul_high_digs.o bn_fast_s_mp_sqr.o bn_mp_2expt.o bn_mp_abs.o bn_mp_add.o bn_mp_add_d.o \
bn_mp_addmod.o bn_mp_and.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_complement.o bn_mp_copy.o bn_mp_count_bits.o bn_mp_div.o \
bn_mp_div_2.o bn_mp_div_2d.o bn_mp_div_3.o bn_mp_div_d.o bn_mp_dr_is_modulus.o bn_mp_dr_reduce.o \
bn_mp_dr_setup.o bn_mp_exch.o bn_mp_export.o bn_mp_expt_d.o bn_mp_expt_d_ex.o bn_mp_exptmod.o \
bn_mp_exptmod_fast.o bn_mp_exteuclid.o bn_mp_fread.o bn_mp_fwrite.o bn_mp_gcd.o bn_mp_get_bit.o \
bn_mp_get_double.o bn_mp_get_int.o bn_mp_get_long.o bn_mp_get_long_long.o bn_mp_grow.o bn_mp_import.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_invmod.o bn_mp_invmod_slow.o bn_mp_is_square.o bn_mp_jacobi.o bn_mp_karatsuba_mul.o \
bn_mp_karatsuba_sqr.o bn_mp_kronecker.o bn_mp_lcm.o bn_mp_lshd.o bn_mp_mod.o bn_mp_mod_2d.o bn_mp_mod_d.o \
bn_mp_montgomery_calc_normalization.o bn_mp_montgomery_reduce.o bn_mp_montgomery_setup.o bn_mp_mul.o \
bn_mp_mul_2.o bn_mp_mul_2d.o bn_mp_mul_d.o bn_mp_mulmod.o bn_mp_n_root.o bn_mp_n_root_ex.o bn_mp_neg.o \
bn_mp_or.o bn_mp_prime_fermat.o bn_mp_prime_frobenius_underwood.o bn_mp_prime_is_divisible.o \
bn_mp_prime_is_prime.o bn_mp_prime_miller_rabin.o bn_mp_prime_next_prime.o \
bn_mp_prime_rabin_miller_trials.o bn_mp_prime_random_ex.o bn_mp_prime_strong_lucas_selfridge.o \
bn_mp_radix_size.o bn_mp_radix_smap.o bn_mp_rand.o bn_mp_read_radix.o bn_mp_read_signed_bin.o \
bn_mp_read_unsigned_bin.o bn_mp_reduce.o bn_mp_reduce_2k.o bn_mp_reduce_2k_l.o bn_mp_reduce_2k_setup.o \
bn_mp_reduce_2k_setup_l.o bn_mp_reduce_is_2k.o bn_mp_reduce_is_2k_l.o bn_mp_reduce_setup.o bn_mp_rshd.o \
bn_mp_set.o bn_mp_set_double.o bn_mp_set_int.o bn_mp_set_long.o bn_mp_set_long_long.o bn_mp_shrink.o \
bn_mp_signed_bin_size.o bn_mp_sqr.o bn_mp_sqrmod.o bn_mp_sqrt.o bn_mp_sqrtmod_prime.o bn_mp_sub.o \
bn_mp_sub_d.o bn_mp_submod.o bn_mp_tc_and.o bn_mp_tc_div_2d.o bn_mp_tc_or.o bn_mp_tc_xor.o \
bn_mp_to_signed_bin.o bn_mp_to_signed_bin_n.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.o bn_mp_toradix_n.o bn_mp_unsigned_bin_size.o bn_mp_xor.o \
bn_mp_zero.o bn_prime_tab.o bn_reverse.o bn_s_mp_add.o bn_s_mp_exptmod.o bn_s_mp_mul_digs.o \
bn_s_mp_mul_high_digs.o bn_s_mp_sqr.o bn_s_mp_sub.o bncore.o

HEADERS_PUB=tommath.h tommath_class.h tommath_superclass.h

HEADERS=tommath_private.h $(HEADERS_PUB)

#The default rule for make builds the libtommath.a library (static)
default: $(LIBMAIN_S)

#Dependencies on *.h
$(OBJECTS): $(HEADERS)

.c.o:
	$(CC) $(LTM_CFLAGS) -c $< -o $@

#Create libtommath.a
$(LIBMAIN_S): $(OBJECTS)
	$(AR) $(ARFLAGS) $@ $(OBJECTS)
	$(RANLIB) $@

#Create DLL + import library libtommath.dll.a
$(LIBMAIN_D) $(LIBMAIN_I): $(OBJECTS)
	$(CC) -s -shared -o $(LIBMAIN_D) $^ -Wl,--enable-auto-import,--export-all -Wl,--out-implib=$(LIBMAIN_I) $(LTM_LDFLAGS)
	$(STRIP) -S $(LIBMAIN_D)

#Build test_standalone suite
test.exe: $(LIBMAIN_S) demo/demo.c
	$(CC) $(LTM_CFLAGS) $(LTM_LDFLAGS) demo/demo.c $(LIBMAIN_S) -DLTM_DEMO_TEST_VS_MTEST=0 -o $@
	@echo NOTICE: start the tests by launching test.exe

test_standalone: test.exe

all: $(LIBMAIN_S) test_standalone

clean:
	@-cmd /c del /Q /S *.o *.a *.exe *.dll 2>nul

#Install the library + headers
install: $(LIBMAIN_S) $(LIBMAIN_I) $(LIBMAIN_D)
	cmd /c if not exist "$(PREFIX)\bin" mkdir "$(PREFIX)\bin"
	cmd /c if not exist "$(PREFIX)\lib" mkdir "$(PREFIX)\lib"
	cmd /c if not exist "$(PREFIX)\include" mkdir "$(PREFIX)\include"
	copy /Y $(LIBMAIN_S) "$(PREFIX)\lib"
	copy /Y $(LIBMAIN_I) "$(PREFIX)\lib"
	copy /Y $(LIBMAIN_D) "$(PREFIX)\bin"
	copy /Y tommath*.h "$(PREFIX)\include"

# ref:         $Format:%D$
# git commit:  $Format:%H$
# commit time: $Format:%ai$
Changes to libtommath/makefile.msvc.



1


2



3



4

5

6

7
8
9

10
11
12
13
14
15
16
17
18
19

20
21
22
23
24
25
26
27
28
29
30
31

32
33
34
35

36
37
38


39

40
41
42
43































#MSVC Makefile


#



#Tom St Denis





LTM_CFLAGS  = /Ox /nologo /I. /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /W3 $(CFLAGS)



default: library

#START_INS

OBJECTS=bncore.obj bn_error.obj bn_fast_mp_invmod.obj bn_fast_mp_montgomery_reduce.obj bn_fast_s_mp_mul_digs.obj \
bn_fast_s_mp_mul_high_digs.obj bn_fast_s_mp_sqr.obj bn_mp_2expt.obj bn_mp_abs.obj bn_mp_add.obj bn_mp_add_d.obj \
bn_mp_addmod.obj bn_mp_and.obj bn_mp_clamp.obj bn_mp_clear.obj bn_mp_clear_multi.obj bn_mp_cmp.obj bn_mp_cmp_d.obj \
bn_mp_cmp_mag.obj bn_mp_cnt_lsb.obj bn_mp_complement.obj bn_mp_copy.obj bn_mp_count_bits.obj bn_mp_div_2.obj \
bn_mp_div_2d.obj bn_mp_div_3.obj bn_mp_div.obj bn_mp_div_d.obj bn_mp_dr_is_modulus.obj bn_mp_dr_reduce.obj \
bn_mp_dr_setup.obj bn_mp_exch.obj bn_mp_export.obj bn_mp_expt_d.obj bn_mp_expt_d_ex.obj bn_mp_exptmod.obj \
bn_mp_exptmod_fast.obj bn_mp_exteuclid.obj bn_mp_fread.obj bn_mp_fwrite.obj bn_mp_gcd.obj bn_mp_get_int.obj \
bn_mp_get_long.obj bn_mp_get_long_long.obj bn_mp_grow.obj bn_mp_import.obj bn_mp_init.obj bn_mp_init_copy.obj \
bn_mp_init_multi.obj bn_mp_init_set.obj bn_mp_init_set_int.obj bn_mp_init_size.obj bn_mp_invmod.obj \
bn_mp_invmod_slow.obj bn_mp_is_square.obj bn_mp_jacobi.obj bn_mp_karatsuba_mul.obj bn_mp_karatsuba_sqr.obj \

bn_mp_lcm.obj bn_mp_lshd.obj bn_mp_mod_2d.obj bn_mp_mod.obj bn_mp_mod_d.obj bn_mp_montgomery_calc_normalization.obj \
bn_mp_montgomery_reduce.obj bn_mp_montgomery_setup.obj bn_mp_mul_2.obj bn_mp_mul_2d.obj bn_mp_mul.obj bn_mp_mul_d.obj \
bn_mp_mulmod.obj bn_mp_neg.obj bn_mp_n_root.obj bn_mp_n_root_ex.obj bn_mp_or.obj bn_mp_prime_fermat.obj \
bn_mp_prime_is_divisible.obj bn_mp_prime_is_prime.obj bn_mp_prime_miller_rabin.obj bn_mp_prime_next_prime.obj \
bn_mp_prime_rabin_miller_trials.obj bn_mp_prime_random_ex.obj bn_mp_radix_size.obj bn_mp_radix_smap.obj \
bn_mp_rand.obj bn_mp_read_radix.obj bn_mp_read_signed_bin.obj bn_mp_read_unsigned_bin.obj bn_mp_reduce_2k.obj \
bn_mp_reduce_2k_l.obj bn_mp_reduce_2k_setup.obj bn_mp_reduce_2k_setup_l.obj bn_mp_reduce.obj \
bn_mp_reduce_is_2k.obj bn_mp_reduce_is_2k_l.obj bn_mp_reduce_setup.obj bn_mp_rshd.obj bn_mp_set.obj bn_mp_set_int.obj \
bn_mp_set_long.obj bn_mp_set_long_long.obj bn_mp_shrink.obj bn_mp_signed_bin_size.obj bn_mp_sqr.obj bn_mp_sqrmod.obj \
bn_mp_sqrt.obj bn_mp_sqrtmod_prime.obj bn_mp_sub.obj bn_mp_sub_d.obj bn_mp_submod.obj bn_mp_tc_and.obj \
bn_mp_tc_div_2d.obj bn_mp_tc_or.obj bn_mp_tc_xor.obj bn_mp_toom_mul.obj bn_mp_toom_sqr.obj bn_mp_toradix.obj \
bn_mp_toradix_n.obj bn_mp_to_signed_bin.obj bn_mp_to_signed_bin_n.obj bn_mp_to_unsigned_bin.obj \

bn_mp_to_unsigned_bin_n.obj bn_mp_unsigned_bin_size.obj bn_mp_xor.obj bn_mp_zero.obj bn_prime_tab.obj bn_reverse.obj \
bn_s_mp_add.obj bn_s_mp_exptmod.obj bn_s_mp_mul_digs.obj bn_s_mp_mul_high_digs.obj bn_s_mp_sqr.obj bn_s_mp_sub.obj

#END_INS


HEADERS=tommath.h tommath_class.h tommath_private.h tommath_superclass.h



library: $(OBJECTS)

	lib /out:tommath.lib $(OBJECTS)

.c.obj:
	$(CC) $(LTM_CFLAGS) /c $< /Fo$@




























>
>
>
|
>
>

>
>
>
|
>
>
>

>
|
>

>
|

<
>
|


|
|

|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
|
|
>
|
|

<
>

|

>
>
|
>
|



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# MAKEFILE for MS Windows (nmake + Windows SDK)
#
# BEWARE: variable OBJECTS is updated via ./updatemakes.sh

### USAGE:
# Open a command prompt with WinSDK variables set and start:
#
# nmake -f makefile.msvc all
# test.exe
# nmake -f makefile.msvc PREFIX=c:\devel\libtom install

#The following can be overridden from command line e.g. make -f makefile.msvc CC=gcc ARFLAGS=rcs
PREFIX    = c:\devel
CFLAGS    = /Ox

#Compilation flags
LTM_CFLAGS  = /nologo /I./ /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /W3 $(CFLAGS)
LTM_LDFLAGS = advapi32.lib

#Libraries to be created (this makefile builds only static libraries)
LIBMAIN_S =tommath.lib


#List of objects to compile (all goes to tommath.lib)
OBJECTS=bn_error.obj bn_fast_mp_invmod.obj bn_fast_mp_montgomery_reduce.obj bn_fast_s_mp_mul_digs.obj \
bn_fast_s_mp_mul_high_digs.obj bn_fast_s_mp_sqr.obj bn_mp_2expt.obj bn_mp_abs.obj bn_mp_add.obj bn_mp_add_d.obj \
bn_mp_addmod.obj bn_mp_and.obj bn_mp_clamp.obj bn_mp_clear.obj bn_mp_clear_multi.obj bn_mp_cmp.obj bn_mp_cmp_d.obj \
bn_mp_cmp_mag.obj bn_mp_cnt_lsb.obj bn_mp_complement.obj bn_mp_copy.obj bn_mp_count_bits.obj bn_mp_div.obj \
bn_mp_div_2.obj bn_mp_div_2d.obj bn_mp_div_3.obj bn_mp_div_d.obj bn_mp_dr_is_modulus.obj bn_mp_dr_reduce.obj \
bn_mp_dr_setup.obj bn_mp_exch.obj bn_mp_export.obj bn_mp_expt_d.obj bn_mp_expt_d_ex.obj bn_mp_exptmod.obj \
bn_mp_exptmod_fast.obj bn_mp_exteuclid.obj bn_mp_fread.obj bn_mp_fwrite.obj bn_mp_gcd.obj bn_mp_get_bit.obj \
bn_mp_get_double.obj bn_mp_get_int.obj bn_mp_get_long.obj bn_mp_get_long_long.obj bn_mp_grow.obj bn_mp_import.obj \
bn_mp_init.obj bn_mp_init_copy.obj bn_mp_init_multi.obj bn_mp_init_set.obj bn_mp_init_set_int.obj bn_mp_init_size.obj \
bn_mp_invmod.obj bn_mp_invmod_slow.obj bn_mp_is_square.obj bn_mp_jacobi.obj bn_mp_karatsuba_mul.obj \
bn_mp_karatsuba_sqr.obj bn_mp_kronecker.obj bn_mp_lcm.obj bn_mp_lshd.obj bn_mp_mod.obj bn_mp_mod_2d.obj bn_mp_mod_d.obj \
bn_mp_montgomery_calc_normalization.obj bn_mp_montgomery_reduce.obj bn_mp_montgomery_setup.obj bn_mp_mul.obj \
bn_mp_mul_2.obj bn_mp_mul_2d.obj bn_mp_mul_d.obj bn_mp_mulmod.obj bn_mp_n_root.obj bn_mp_n_root_ex.obj bn_mp_neg.obj \
bn_mp_or.obj bn_mp_prime_fermat.obj bn_mp_prime_frobenius_underwood.obj bn_mp_prime_is_divisible.obj \
bn_mp_prime_is_prime.obj bn_mp_prime_miller_rabin.obj bn_mp_prime_next_prime.obj \
bn_mp_prime_rabin_miller_trials.obj bn_mp_prime_random_ex.obj bn_mp_prime_strong_lucas_selfridge.obj \
bn_mp_radix_size.obj bn_mp_radix_smap.obj bn_mp_rand.obj bn_mp_read_radix.obj bn_mp_read_signed_bin.obj \
bn_mp_read_unsigned_bin.obj bn_mp_reduce.obj bn_mp_reduce_2k.obj bn_mp_reduce_2k_l.obj bn_mp_reduce_2k_setup.obj \
bn_mp_reduce_2k_setup_l.obj bn_mp_reduce_is_2k.obj bn_mp_reduce_is_2k_l.obj bn_mp_reduce_setup.obj bn_mp_rshd.obj \
bn_mp_set.obj bn_mp_set_double.obj bn_mp_set_int.obj bn_mp_set_long.obj bn_mp_set_long_long.obj bn_mp_shrink.obj \
bn_mp_signed_bin_size.obj bn_mp_sqr.obj bn_mp_sqrmod.obj bn_mp_sqrt.obj bn_mp_sqrtmod_prime.obj bn_mp_sub.obj \
bn_mp_sub_d.obj bn_mp_submod.obj bn_mp_tc_and.obj bn_mp_tc_div_2d.obj bn_mp_tc_or.obj bn_mp_tc_xor.obj \
bn_mp_to_signed_bin.obj bn_mp_to_signed_bin_n.obj bn_mp_to_unsigned_bin.obj bn_mp_to_unsigned_bin_n.obj \
bn_mp_toom_mul.obj bn_mp_toom_sqr.obj bn_mp_toradix.obj bn_mp_toradix_n.obj bn_mp_unsigned_bin_size.obj bn_mp_xor.obj \
bn_mp_zero.obj bn_prime_tab.obj bn_reverse.obj bn_s_mp_add.obj bn_s_mp_exptmod.obj bn_s_mp_mul_digs.obj \
bn_s_mp_mul_high_digs.obj bn_s_mp_sqr.obj bn_s_mp_sub.obj bncore.obj


HEADERS_PUB=tommath.h tommath_class.h tommath_superclass.h

HEADERS=tommath_private.h $(HEADERS_PUB)

#The default rule for make builds the tommath.lib library (static)
default: $(LIBMAIN_S)

#Dependencies on *.h
$(OBJECTS): $(HEADERS)

.c.obj:
	$(CC) $(LTM_CFLAGS) /c $< /Fo$@

#Create tomcrypt.lib
$(LIBMAIN_S): $(OBJECTS)
	lib /out:$(LIBMAIN_S) $(OBJECTS)

#Build test_standalone suite
test.exe: $(LIBMAIN_S) demo/demo.c
	cl $(LTM_CFLAGS) $(TOBJECTS) $(LIBMAIN_S) $(LTM_LDFLAGS) demo/demo.c /DLTM_DEMO_TEST_VS_MTEST=0 /Fe$@
	@echo NOTICE: start the tests by launching test.exe

test_standalone: test.exe

all: $(LIBMAIN_S) test_standalone

clean:
	@-cmd /c del /Q /S *.OBJ *.LIB *.EXE *.DLL 2>nul

#Install the library + headers
install: $(LIBMAIN_S)
	cmd /c if not exist "$(PREFIX)\bin" mkdir "$(PREFIX)\bin"
	cmd /c if not exist "$(PREFIX)\lib" mkdir "$(PREFIX)\lib"
	cmd /c if not exist "$(PREFIX)\include" mkdir "$(PREFIX)\include"
	copy /Y $(LIBMAIN_S) "$(PREFIX)\lib"
	copy /Y tommath*.h "$(PREFIX)\include"

# ref:         $Format:%D$
# git commit:  $Format:%H$
# commit time: $Format:%ai$
Changes to libtommath/makefile.shared.
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

37
38
39
40
41
42
43
44
45
46

47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
  endif
endif
LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC)

LCOV_ARGS=--directory .libs --directory .

#START_INS
OBJECTS=bncore.o bn_error.o bn_fast_mp_invmod.o bn_fast_mp_montgomery_reduce.o bn_fast_s_mp_mul_digs.o \
bn_fast_s_mp_mul_high_digs.o bn_fast_s_mp_sqr.o bn_mp_2expt.o bn_mp_abs.o bn_mp_add.o bn_mp_add_d.o \
bn_mp_addmod.o bn_mp_and.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_complement.o bn_mp_copy.o bn_mp_count_bits.o bn_mp_div_2.o \
bn_mp_div_2d.o bn_mp_div_3.o bn_mp_div.o bn_mp_div_d.o bn_mp_dr_is_modulus.o bn_mp_dr_reduce.o \
bn_mp_dr_setup.o bn_mp_exch.o bn_mp_export.o bn_mp_expt_d.o bn_mp_expt_d_ex.o bn_mp_exptmod.o \
bn_mp_exptmod_fast.o bn_mp_exteuclid.o bn_mp_fread.o bn_mp_fwrite.o bn_mp_gcd.o bn_mp_get_int.o \
bn_mp_get_long.o bn_mp_get_long_long.o bn_mp_grow.o bn_mp_import.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_invmod.o \
bn_mp_invmod_slow.o bn_mp_is_square.o bn_mp_jacobi.o bn_mp_karatsuba_mul.o bn_mp_karatsuba_sqr.o \
bn_mp_lcm.o bn_mp_lshd.o bn_mp_mod_2d.o bn_mp_mod.o bn_mp_mod_d.o bn_mp_montgomery_calc_normalization.o \
bn_mp_montgomery_reduce.o bn_mp_montgomery_setup.o bn_mp_mul_2.o bn_mp_mul_2d.o bn_mp_mul.o bn_mp_mul_d.o \

bn_mp_mulmod.o bn_mp_neg.o bn_mp_n_root.o bn_mp_n_root_ex.o bn_mp_or.o bn_mp_prime_fermat.o \
bn_mp_prime_is_divisible.o bn_mp_prime_is_prime.o bn_mp_prime_miller_rabin.o bn_mp_prime_next_prime.o \
bn_mp_prime_rabin_miller_trials.o bn_mp_prime_random_ex.o bn_mp_radix_size.o bn_mp_radix_smap.o \
bn_mp_rand.o bn_mp_read_radix.o bn_mp_read_signed_bin.o bn_mp_read_unsigned_bin.o bn_mp_reduce_2k.o \
bn_mp_reduce_2k_l.o bn_mp_reduce_2k_setup.o bn_mp_reduce_2k_setup_l.o bn_mp_reduce.o \
bn_mp_reduce_is_2k.o bn_mp_reduce_is_2k_l.o bn_mp_reduce_setup.o bn_mp_rshd.o bn_mp_set.o bn_mp_set_int.o \
bn_mp_set_long.o bn_mp_set_long_long.o bn_mp_shrink.o bn_mp_signed_bin_size.o bn_mp_sqr.o bn_mp_sqrmod.o \
bn_mp_sqrt.o bn_mp_sqrtmod_prime.o bn_mp_sub.o bn_mp_sub_d.o bn_mp_submod.o bn_mp_tc_and.o \
bn_mp_tc_div_2d.o bn_mp_tc_or.o bn_mp_tc_xor.o bn_mp_toom_mul.o bn_mp_toom_sqr.o bn_mp_toradix.o \
bn_mp_toradix_n.o bn_mp_to_signed_bin.o bn_mp_to_signed_bin_n.o bn_mp_to_unsigned_bin.o \

bn_mp_to_unsigned_bin_n.o bn_mp_unsigned_bin_size.o bn_mp_xor.o bn_mp_zero.o bn_prime_tab.o bn_reverse.o \
bn_s_mp_add.o bn_s_mp_exptmod.o bn_s_mp_mul_digs.o bn_s_mp_mul_high_digs.o bn_s_mp_sqr.o bn_s_mp_sub.o

#END_INS

objs: $(OBJECTS)

.c.o:
	$(LTCOMPILE) $(CFLAGS) $(LDFLAGS) -o $@ -c $<

LOBJECTS = $(OBJECTS:.o=.lo)

$(LIBNAME):  $(OBJECTS)
	$(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) $(LOBJECTS) -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION_SO)

install: $(LIBNAME)
	install -d $(DESTDIR)$(LIBPATH)
	install -d $(DESTDIR)$(INCPATH)
	$(LIBTOOL) --mode=install install -m 644 $(LIBNAME) $(DESTDIR)$(LIBPATH)/$(LIBNAME)
	install -m 644 $(HEADERS_PUB) $(DESTDIR)$(INCPATH)
	sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION_PC),' libtommath.pc.in > libtommath.pc







|


|
|

|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
>
|
|











|







18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
  endif
endif
LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC)

LCOV_ARGS=--directory .libs --directory .

#START_INS
OBJECTS=bn_error.o bn_fast_mp_invmod.o bn_fast_mp_montgomery_reduce.o bn_fast_s_mp_mul_digs.o \
bn_fast_s_mp_mul_high_digs.o bn_fast_s_mp_sqr.o bn_mp_2expt.o bn_mp_abs.o bn_mp_add.o bn_mp_add_d.o \
bn_mp_addmod.o bn_mp_and.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_complement.o bn_mp_copy.o bn_mp_count_bits.o bn_mp_div.o \
bn_mp_div_2.o bn_mp_div_2d.o bn_mp_div_3.o bn_mp_div_d.o bn_mp_dr_is_modulus.o bn_mp_dr_reduce.o \
bn_mp_dr_setup.o bn_mp_exch.o bn_mp_export.o bn_mp_expt_d.o bn_mp_expt_d_ex.o bn_mp_exptmod.o \
bn_mp_exptmod_fast.o bn_mp_exteuclid.o bn_mp_fread.o bn_mp_fwrite.o bn_mp_gcd.o bn_mp_get_bit.o \
bn_mp_get_double.o bn_mp_get_int.o bn_mp_get_long.o bn_mp_get_long_long.o bn_mp_grow.o bn_mp_import.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_invmod.o bn_mp_invmod_slow.o bn_mp_is_square.o bn_mp_jacobi.o bn_mp_karatsuba_mul.o \
bn_mp_karatsuba_sqr.o bn_mp_kronecker.o bn_mp_lcm.o bn_mp_lshd.o bn_mp_mod.o bn_mp_mod_2d.o bn_mp_mod_d.o \
bn_mp_montgomery_calc_normalization.o bn_mp_montgomery_reduce.o bn_mp_montgomery_setup.o bn_mp_mul.o \
bn_mp_mul_2.o bn_mp_mul_2d.o bn_mp_mul_d.o bn_mp_mulmod.o bn_mp_n_root.o bn_mp_n_root_ex.o bn_mp_neg.o \
bn_mp_or.o bn_mp_prime_fermat.o bn_mp_prime_frobenius_underwood.o bn_mp_prime_is_divisible.o \
bn_mp_prime_is_prime.o bn_mp_prime_miller_rabin.o bn_mp_prime_next_prime.o \
bn_mp_prime_rabin_miller_trials.o bn_mp_prime_random_ex.o bn_mp_prime_strong_lucas_selfridge.o \
bn_mp_radix_size.o bn_mp_radix_smap.o bn_mp_rand.o bn_mp_read_radix.o bn_mp_read_signed_bin.o \
bn_mp_read_unsigned_bin.o bn_mp_reduce.o bn_mp_reduce_2k.o bn_mp_reduce_2k_l.o bn_mp_reduce_2k_setup.o \
bn_mp_reduce_2k_setup_l.o bn_mp_reduce_is_2k.o bn_mp_reduce_is_2k_l.o bn_mp_reduce_setup.o bn_mp_rshd.o \
bn_mp_set.o bn_mp_set_double.o bn_mp_set_int.o bn_mp_set_long.o bn_mp_set_long_long.o bn_mp_shrink.o \
bn_mp_signed_bin_size.o bn_mp_sqr.o bn_mp_sqrmod.o bn_mp_sqrt.o bn_mp_sqrtmod_prime.o bn_mp_sub.o \
bn_mp_sub_d.o bn_mp_submod.o bn_mp_tc_and.o bn_mp_tc_div_2d.o bn_mp_tc_or.o bn_mp_tc_xor.o \
bn_mp_to_signed_bin.o bn_mp_to_signed_bin_n.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.o bn_mp_toradix_n.o bn_mp_unsigned_bin_size.o bn_mp_xor.o \
bn_mp_zero.o bn_prime_tab.o bn_reverse.o bn_s_mp_add.o bn_s_mp_exptmod.o bn_s_mp_mul_digs.o \
bn_s_mp_mul_high_digs.o bn_s_mp_sqr.o bn_s_mp_sub.o bncore.o

#END_INS

objs: $(OBJECTS)

.c.o:
	$(LTCOMPILE) $(CFLAGS) $(LDFLAGS) -o $@ -c $<

LOBJECTS = $(OBJECTS:.o=.lo)

$(LIBNAME):  $(OBJECTS)
	$(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) $(LOBJECTS) -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION_SO) $(LIBTOOLFLAGS)

install: $(LIBNAME)
	install -d $(DESTDIR)$(LIBPATH)
	install -d $(DESTDIR)$(INCPATH)
	$(LIBTOOL) --mode=install install -m 644 $(LIBNAME) $(DESTDIR)$(LIBPATH)/$(LIBNAME)
	install -m 644 $(HEADERS_PUB) $(DESTDIR)$(INCPATH)
	sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION_PC),' libtommath.pc.in > libtommath.pc
77
78
79
80
81
82
83

84
85
86
87
88
	$(CC) $(CFLAGS) -c demo/demo.c -o demo/demo.o
	$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o test demo/demo.o $(LIBNAME)

test_standalone: $(LIBNAME) demo/demo.o
	$(CC) $(CFLAGS) -c demo/demo.c -o demo/demo.o
	$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o test demo/demo.o $(LIBNAME)


mtest:
	cd mtest ; $(CC) $(CFLAGS) $(LDFLAGS) mtest.c -o mtest

timing: $(LIBNAME) demo/timing.c
	$(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -DTIMER demo/timing.c $(LIBNAME) -o timing







>





79
80
81
82
83
84
85
86
87
88
89
90
91
	$(CC) $(CFLAGS) -c demo/demo.c -o demo/demo.o
	$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o test demo/demo.o $(LIBNAME)

test_standalone: $(LIBNAME) demo/demo.o
	$(CC) $(CFLAGS) -c demo/demo.c -o demo/demo.o
	$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o test demo/demo.o $(LIBNAME)

.PHONY: mtest
mtest:
	cd mtest ; $(CC) $(CFLAGS) $(LDFLAGS) mtest.c -o mtest

timing: $(LIBNAME) demo/timing.c
	$(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -DTIMER demo/timing.c $(LIBNAME) -o timing
Added libtommath/makefile.unix.














































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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
97
98
99
100
101
102
103
# MAKEFILE that is intended to be compatible with any kind of make (GNU make, BSD make, ...)
# works on: Linux, *BSD, Cygwin, AIX, HP-UX and hopefully other UNIX systems
#
# Please do not use here neither any special make syntax nor any unusual tools/utilities!

# using ICC compiler:
# make -f makefile.unix CC=icc CFLAGS="-O3 -xP -ip"

# using Borland C++Builder:
# make -f makefile.unix CC=bcc32

#The following can be overridden from command line e.g. "make -f makefile.unix CC=gcc ARFLAGS=rcs"
DESTDIR   =
PREFIX    = /usr/local
LIBPATH   = $(PREFIX)/lib
INCPATH   = $(PREFIX)/include
CC        = cc
AR        = ar
ARFLAGS   = r
RANLIB    = ranlib
CFLAGS    = -O2
LDFLAGS   =

VERSION   = 1.1.0

#Compilation flags
LTM_CFLAGS  = -I. $(CFLAGS)
LTM_LDFLAGS = $(LDFLAGS)

#Library to be created (this makefile builds only static library)
LIBMAIN_S = libtommath.a

OBJECTS=bn_error.o bn_fast_mp_invmod.o bn_fast_mp_montgomery_reduce.o bn_fast_s_mp_mul_digs.o \
bn_fast_s_mp_mul_high_digs.o bn_fast_s_mp_sqr.o bn_mp_2expt.o bn_mp_abs.o bn_mp_add.o bn_mp_add_d.o \
bn_mp_addmod.o bn_mp_and.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_complement.o bn_mp_copy.o bn_mp_count_bits.o bn_mp_div.o \
bn_mp_div_2.o bn_mp_div_2d.o bn_mp_div_3.o bn_mp_div_d.o bn_mp_dr_is_modulus.o bn_mp_dr_reduce.o \
bn_mp_dr_setup.o bn_mp_exch.o bn_mp_export.o bn_mp_expt_d.o bn_mp_expt_d_ex.o bn_mp_exptmod.o \
bn_mp_exptmod_fast.o bn_mp_exteuclid.o bn_mp_fread.o bn_mp_fwrite.o bn_mp_gcd.o bn_mp_get_bit.o \
bn_mp_get_double.o bn_mp_get_int.o bn_mp_get_long.o bn_mp_get_long_long.o bn_mp_grow.o bn_mp_import.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_invmod.o bn_mp_invmod_slow.o bn_mp_is_square.o bn_mp_jacobi.o bn_mp_karatsuba_mul.o \
bn_mp_karatsuba_sqr.o bn_mp_kronecker.o bn_mp_lcm.o bn_mp_lshd.o bn_mp_mod.o bn_mp_mod_2d.o bn_mp_mod_d.o \
bn_mp_montgomery_calc_normalization.o bn_mp_montgomery_reduce.o bn_mp_montgomery_setup.o bn_mp_mul.o \
bn_mp_mul_2.o bn_mp_mul_2d.o bn_mp_mul_d.o bn_mp_mulmod.o bn_mp_n_root.o bn_mp_n_root_ex.o bn_mp_neg.o \
bn_mp_or.o bn_mp_prime_fermat.o bn_mp_prime_frobenius_underwood.o bn_mp_prime_is_divisible.o \
bn_mp_prime_is_prime.o bn_mp_prime_miller_rabin.o bn_mp_prime_next_prime.o \
bn_mp_prime_rabin_miller_trials.o bn_mp_prime_random_ex.o bn_mp_prime_strong_lucas_selfridge.o \
bn_mp_radix_size.o bn_mp_radix_smap.o bn_mp_rand.o bn_mp_read_radix.o bn_mp_read_signed_bin.o \
bn_mp_read_unsigned_bin.o bn_mp_reduce.o bn_mp_reduce_2k.o bn_mp_reduce_2k_l.o bn_mp_reduce_2k_setup.o \
bn_mp_reduce_2k_setup_l.o bn_mp_reduce_is_2k.o bn_mp_reduce_is_2k_l.o bn_mp_reduce_setup.o bn_mp_rshd.o \
bn_mp_set.o bn_mp_set_double.o bn_mp_set_int.o bn_mp_set_long.o bn_mp_set_long_long.o bn_mp_shrink.o \
bn_mp_signed_bin_size.o bn_mp_sqr.o bn_mp_sqrmod.o bn_mp_sqrt.o bn_mp_sqrtmod_prime.o bn_mp_sub.o \
bn_mp_sub_d.o bn_mp_submod.o bn_mp_tc_and.o bn_mp_tc_div_2d.o bn_mp_tc_or.o bn_mp_tc_xor.o \
bn_mp_to_signed_bin.o bn_mp_to_signed_bin_n.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.o bn_mp_toradix_n.o bn_mp_unsigned_bin_size.o bn_mp_xor.o \
bn_mp_zero.o bn_prime_tab.o bn_reverse.o bn_s_mp_add.o bn_s_mp_exptmod.o bn_s_mp_mul_digs.o \
bn_s_mp_mul_high_digs.o bn_s_mp_sqr.o bn_s_mp_sub.o bncore.o

HEADERS_PUB=tommath.h tommath_class.h tommath_superclass.h

HEADERS=tommath_private.h $(HEADERS_PUB)

#The default rule for make builds the libtommath.a library (static)
default: $(LIBMAIN_S)

#Dependencies on *.h
$(OBJECTS): $(HEADERS)

#This is necessary for compatibility with BSD make (namely on OpenBSD)
.SUFFIXES: .o .c
.c.o:
	$(CC) $(LTM_CFLAGS) -c $< -o $@

#Create libtommath.a
$(LIBMAIN_S): $(OBJECTS)
	$(AR) $(ARFLAGS) $@ $(OBJECTS)
	$(RANLIB) $@

#Build test_standalone suite
test: $(LIBMAIN_S) demo/demo.c
	$(CC) $(LTM_CFLAGS) $(LTM_LDFLAGS) demo/demo.c $(LIBMAIN_S) -DLTM_DEMO_TEST_VS_MTEST=0 -o $@
	@echo "NOTICE: start the tests by: ./test"

test_standalone: test

all: $(LIBMAIN_S) test_standalone

#NOTE: this makefile works also on cygwin, thus we need to delete *.exe
clean:
	-@rm -f $(OBJECTS) $(LIBMAIN_S)
	-@rm -f demo/demo.o test test.exe

#Install the library + headers
install: $(LIBMAIN_S)
	@mkdir -p $(DESTDIR)$(INCPATH) $(DESTDIR)$(LIBPATH)/pkgconfig
	@cp $(LIBMAIN_S) $(DESTDIR)$(LIBPATH)/
	@cp $(HEADERS_PUB) $(DESTDIR)$(INCPATH)/
	@sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION),' libtommath.pc.in > $(DESTDIR)$(LIBPATH)/pkgconfig/libtommath.pc

# ref:         $Format:%D$
# git commit:  $Format:%H$
# commit time: $Format:%ai$
Changes to libtommath/makefile_include.mk.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#
# Include makefile for libtommath
#

#version of library
VERSION=1.0.1
VERSION_PC=1.0.1
VERSION_SO=1:1

PLATFORM := $(shell uname | sed -e 's/_.*//')

# default make target
default: ${LIBNAME}

# Compiler and Linker Names





|
|
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#
# Include makefile for libtommath
#

#version of library
VERSION=1.1.0
VERSION_PC=1.1.0
VERSION_SO=2:0:1

PLATFORM := $(shell uname | sed -e 's/_.*//')

# default make target
default: ${LIBNAME}

# Compiler and Linker Names
81
82
83
84
85
86
87



88
89
90
91
92
93
94
endif
ifneq ($(findstring mingw,$(CC)),)
CFLAGS += -Wno-shadow
endif
ifeq ($(PLATFORM), Darwin)
CFLAGS += -Wno-nullability-completeness
endif




ifeq ($(PLATFORM),FreeBSD)
  _ARCH := $(shell sysctl -b hw.machine_arch)
else
  _ARCH := $(shell arch)
endif








>
>
>







81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
endif
ifneq ($(findstring mingw,$(CC)),)
CFLAGS += -Wno-shadow
endif
ifeq ($(PLATFORM), Darwin)
CFLAGS += -Wno-nullability-completeness
endif
ifeq ($(PLATFORM), CYGWIN)
LIBTOOLFLAGS += -no-undefined
endif

ifeq ($(PLATFORM),FreeBSD)
  _ARCH := $(shell sysctl -b hw.machine_arch)
else
  _ARCH := $(shell arch)
endif

Changes to libtommath/tommath.h.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */
#ifndef BN_H_
#define BN_H_

#include <stdio.h>
#include <stdlib.h>
#include <limits.h>

#include <tommath_class.h>

#ifdef __cplusplus
extern "C" {
#endif

/* MS Visual C++ doesn't have a 128bit type for words, so fall back to 32bit MPI's (where words are 64bit) */
#if defined(_MSC_VER) || defined(__LLP64__) || defined(__e2k__) || defined(__LCC__)









|
<








|







1
2
3
4
5
6
7
8
9
10

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */
#ifndef BN_H_
#define BN_H_

#include <stdio.h>
#include <stdlib.h>
#include <limits.h>

#include "tommath_class.h"

#ifdef __cplusplus
extern "C" {
#endif

/* MS Visual C++ doesn't have a 128bit type for words, so fall back to 32bit MPI's (where words are 64bit) */
#if defined(_MSC_VER) || defined(__LLP64__) || defined(__e2k__) || defined(__LCC__)
112
113
114
115
116
117
118

119
120
121
122
123
124
125
#define MP_ZPOS       0   /* positive integer */
#define MP_NEG        1   /* negative */

#define MP_OKAY       0   /* ok result */
#define MP_MEM        -2  /* out of mem */
#define MP_VAL        -3  /* invalid input */
#define MP_RANGE      MP_VAL


#define MP_YES        1   /* yes response */
#define MP_NO         0   /* no response */

/* Primality generation flags */
#define LTM_PRIME_BBS      0x0001 /* BBS style prime */
#define LTM_PRIME_SAFE     0x0002 /* Safe prime (p-1)/2 == prime */







>







111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#define MP_ZPOS       0   /* positive integer */
#define MP_NEG        1   /* negative */

#define MP_OKAY       0   /* ok result */
#define MP_MEM        -2  /* out of mem */
#define MP_VAL        -3  /* invalid input */
#define MP_RANGE      MP_VAL
#define MP_ITER       -4  /* Max. iterations reached */

#define MP_YES        1   /* yes response */
#define MP_NO         0   /* no response */

/* Primality generation flags */
#define LTM_PRIME_BBS      0x0001 /* BBS style prime */
#define LTM_PRIME_SAFE     0x0002 /* Safe prime (p-1)/2 == prime */
198
199
200
201
202
203
204



205
206
207
208
209
210
211
212
213



214
215
216
217
218
219
220

/* set to zero */
void mp_zero(mp_int *a);

/* set to a digit */
void mp_set(mp_int *a, mp_digit b);




/* set a 32-bit const */
int mp_set_int(mp_int *a, unsigned long b);

/* set a platform dependent unsigned long value */
int mp_set_long(mp_int *a, unsigned long b);

/* set a platform dependent unsigned long long value */
int mp_set_long_long(mp_int *a, unsigned long long b);




/* get a 32-bit value */
unsigned long mp_get_int(const mp_int *a);

/* get a platform dependent unsigned long value */
unsigned long mp_get_long(const mp_int *a);

/* get a platform dependent unsigned long long value */







>
>
>









>
>
>







198
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

/* set to zero */
void mp_zero(mp_int *a);

/* set to a digit */
void mp_set(mp_int *a, mp_digit b);

/* set a double */
int mp_set_double(mp_int *a, double b);

/* set a 32-bit const */
int mp_set_int(mp_int *a, unsigned long b);

/* set a platform dependent unsigned long value */
int mp_set_long(mp_int *a, unsigned long b);

/* set a platform dependent unsigned long long value */
int mp_set_long_long(mp_int *a, unsigned long long b);

/* get a double */
double mp_get_double(const mp_int *a);

/* get a 32-bit value */
unsigned long mp_get_int(const mp_int *a);

/* get a platform dependent unsigned long value */
unsigned long mp_get_long(const mp_int *a);

/* get a platform dependent unsigned long long value */
268
269
270
271
272
273
274
275
276


277
278
279

280
281

282
283
284
285
286
287
288
289
290
291
292
293
294





295
296
297
298
299
300
301
int mp_2expt(mp_int *a, int b);

/* Counts the number of lsbs which are zero before the first zero bit */
int mp_cnt_lsb(const mp_int *a);

/* I Love Earth! */

/* makes a pseudo-random int of a given size */
int mp_rand(mp_int *a, int digits);



#ifdef MP_PRNG_ENABLE_LTM_RNG
/* as last resort we will fall back to libtomcrypt's rng_get_bytes()

 * in case you don't use libtomcrypt or use it w/o rng_get_bytes()
 * you have to implement it somewhere else, as it's required */

extern unsigned long (*ltm_rng)(unsigned char *out, unsigned long outlen, void (*callback)(void));
extern void (*ltm_rng_callback)(void);
#endif

/* ---> binary operations <--- */
/* c = a XOR b  */
int mp_xor(const mp_int *a, const mp_int *b, mp_int *c);

/* c = a OR b */
int mp_or(const mp_int *a, const mp_int *b, mp_int *c);

/* c = a AND b */
int mp_and(const mp_int *a, const mp_int *b, mp_int *c);






/* c = a XOR b (two complement) */
int mp_tc_xor(const mp_int *a, const mp_int *b, mp_int *c);

/* c = a OR b (two complement) */
int mp_tc_or(const mp_int *a, const mp_int *b, mp_int *c);








|

>
>


|
>
|
<
>













>
>
>
>
>







274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289

290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
int mp_2expt(mp_int *a, int b);

/* Counts the number of lsbs which are zero before the first zero bit */
int mp_cnt_lsb(const mp_int *a);

/* I Love Earth! */

/* makes a pseudo-random mp_int of a given size */
int mp_rand(mp_int *a, int digits);
/* makes a pseudo-random small int of a given size */
int mp_rand_digit(mp_digit *r);

#ifdef MP_PRNG_ENABLE_LTM_RNG
/* A last resort to provide random data on systems without any of the other
 * implemented ways to gather entropy.
 * It is compatible with `rng_get_bytes()` from libtomcrypt so you could

 * provide that one and then set `ltm_rng = rng_get_bytes;` */
extern unsigned long (*ltm_rng)(unsigned char *out, unsigned long outlen, void (*callback)(void));
extern void (*ltm_rng_callback)(void);
#endif

/* ---> binary operations <--- */
/* c = a XOR b  */
int mp_xor(const mp_int *a, const mp_int *b, mp_int *c);

/* c = a OR b */
int mp_or(const mp_int *a, const mp_int *b, mp_int *c);

/* c = a AND b */
int mp_and(const mp_int *a, const mp_int *b, mp_int *c);

/* Checks the bit at position b and returns MP_YES
   if the bit is 1, MP_NO if it is 0 and MP_VAL
   in case of error */
int mp_get_bit(const mp_int *a, int b);

/* c = a XOR b (two complement) */
int mp_tc_xor(const mp_int *a, const mp_int *b, mp_int *c);

/* c = a OR b (two complement) */
int mp_tc_or(const mp_int *a, const mp_int *b, mp_int *c);

407
408
409
410
411
412
413



414
415
416
417
418
419
420
int mp_sqrtmod_prime(const mp_int *n, const mp_int *prime, mp_int *ret);

/* is number a square? */
int mp_is_square(const mp_int *arg, int *ret);

/* computes the jacobi c = (a | n) (or Legendre if b is prime)  */
int mp_jacobi(const mp_int *a, const mp_int *n, int *c);




/* used to setup the Barrett reduction for a given modulus b */
int mp_reduce_setup(mp_int *a, const mp_int *b);

/* Barrett Reduction, computes a (mod b) with a precomputed value c
 *
 * Assumes that 0 < x <= m*m, note if 0 > x > -(m*m) then you can merely







>
>
>







421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
int mp_sqrtmod_prime(const mp_int *n, const mp_int *prime, mp_int *ret);

/* is number a square? */
int mp_is_square(const mp_int *arg, int *ret);

/* computes the jacobi c = (a | n) (or Legendre if b is prime)  */
int mp_jacobi(const mp_int *a, const mp_int *n, int *c);

/* computes the Kronecker symbol c = (a | p) (like jacobi() but with {a,p} in Z */
int mp_kronecker(const mp_int *a, const mp_int *p, int *c);

/* used to setup the Barrett reduction for a given modulus b */
int mp_reduce_setup(mp_int *a, const mp_int *b);

/* Barrett Reduction, computes a (mod b) with a precomputed value c
 *
 * Assumes that 0 < x <= m*m, note if 0 > x > -(m*m) then you can merely
489
490
491
492
493
494
495










496
497
498
499







500
501
502
503
504
505
506
int mp_prime_miller_rabin(const mp_int *a, const mp_int *b, int *result);

/* This gives [for a given bit size] the number of trials required
 * such that Miller-Rabin gives a prob of failure lower than 2^-96
 */
int mp_prime_rabin_miller_trials(int size);











/* performs t rounds of Miller-Rabin on "a" using the first
 * t prime bases.  Also performs an initial sieve of trial
 * division.  Determines if "a" is prime with probability
 * of error no more than (1/4)**t.







 *
 * Sets result to 1 if probably prime, 0 otherwise
 */
int mp_prime_is_prime(const mp_int *a, int t, int *result);

/* finds the next prime after the number "a" using "t" trials
 * of Miller-Rabin.







>
>
>
>
>
>
>
>
>
>
|
|


>
>
>
>
>
>
>







506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
int mp_prime_miller_rabin(const mp_int *a, const mp_int *b, int *result);

/* This gives [for a given bit size] the number of trials required
 * such that Miller-Rabin gives a prob of failure lower than 2^-96
 */
int mp_prime_rabin_miller_trials(int size);

/* performs one strong Lucas-Selfridge test of "a".
 * Sets result to 0 if composite or 1 if probable prime
 */
int mp_prime_strong_lucas_selfridge(const mp_int *a, int *result);

/* performs one Frobenius test of "a" as described by Paul Underwood.
 * Sets result to 0 if composite or 1 if probable prime
 */
int mp_prime_frobenius_underwood(const mp_int *N, int *result);

/* performs t random rounds of Miller-Rabin on "a" additional to
 * bases 2 and 3.  Also performs an initial sieve of trial
 * division.  Determines if "a" is prime with probability
 * of error no more than (1/4)**t.
 * Both a strong Lucas-Selfridge to complete the BPSW test
 * and a separate Frobenius test are available at compile time.
 * With t<0 a deterministic test is run for primes up to
 * 318665857834031151167461. With t<13 (abs(t)-13) additional
 * tests with sequential small primes are run starting at 43.
 * Is Fips 186.4 compliant if called with t as computed by
 * mp_prime_rabin_miller_trials();
 *
 * Sets result to 1 if probably prime, 0 otherwise
 */
int mp_prime_is_prime(const mp_int *a, int t, int *result);

/* finds the next prime after the number "a" using "t" trials
 * of Miller-Rabin.
Changes to libtommath/tommath_class.h.












1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16












#if !(defined(LTM1) && defined(LTM2) && defined(LTM3))
#if defined(LTM2)
#   define LTM3
#endif
#if defined(LTM1)
#   define LTM2
#endif
#define LTM1

#if defined(LTM_ALL)
#   define BN_ERROR_C
#   define BN_FAST_MP_INVMOD_C
#   define BN_FAST_MP_MONTGOMERY_REDUCE_C
#   define BN_FAST_S_MP_MUL_DIGS_C
#   define BN_FAST_S_MP_MUL_HIGH_DIGS_C
#   define BN_FAST_S_MP_SQR_C
>
>
>
>
>
>
>
>
>
>
>
>








<







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

21
22
23
24
25
26
27
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense
 */

#if !(defined(LTM1) && defined(LTM2) && defined(LTM3))
#if defined(LTM2)
#   define LTM3
#endif
#if defined(LTM1)
#   define LTM2
#endif
#define LTM1

#if defined(LTM_ALL)
#   define BN_ERROR_C
#   define BN_FAST_MP_INVMOD_C
#   define BN_FAST_MP_MONTGOMERY_REDUCE_C
#   define BN_FAST_S_MP_MUL_DIGS_C
#   define BN_FAST_S_MP_MUL_HIGH_DIGS_C
#   define BN_FAST_S_MP_SQR_C
44
45
46
47
48
49
50


51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67

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
97
98
99
100
101
102
103
104
105
106
107

108
109
110
111
112
113
114
#   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_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
#   define BN_MP_INIT_COPY_C
#   define BN_MP_INIT_MULTI_C
#   define BN_MP_INIT_SET_C
#   define BN_MP_INIT_SET_INT_C
#   define BN_MP_INIT_SIZE_C
#   define BN_MP_INVMOD_C
#   define BN_MP_INVMOD_SLOW_C
#   define BN_MP_IS_SQUARE_C
#   define BN_MP_JACOBI_C
#   define BN_MP_KARATSUBA_MUL_C
#   define BN_MP_KARATSUBA_SQR_C

#   define BN_MP_LCM_C
#   define BN_MP_LSHD_C
#   define BN_MP_MOD_C
#   define BN_MP_MOD_2D_C
#   define BN_MP_MOD_D_C
#   define BN_MP_MONTGOMERY_CALC_NORMALIZATION_C
#   define BN_MP_MONTGOMERY_REDUCE_C
#   define BN_MP_MONTGOMERY_SETUP_C
#   define BN_MP_MUL_C
#   define BN_MP_MUL_2_C
#   define BN_MP_MUL_2D_C
#   define BN_MP_MUL_D_C
#   define BN_MP_MULMOD_C
#   define BN_MP_N_ROOT_C
#   define BN_MP_N_ROOT_EX_C
#   define BN_MP_NEG_C
#   define BN_MP_OR_C
#   define BN_MP_PRIME_FERMAT_C

#   define BN_MP_PRIME_IS_DIVISIBLE_C
#   define BN_MP_PRIME_IS_PRIME_C
#   define BN_MP_PRIME_MILLER_RABIN_C
#   define BN_MP_PRIME_NEXT_PRIME_C
#   define BN_MP_PRIME_RABIN_MILLER_TRIALS_C
#   define BN_MP_PRIME_RANDOM_EX_C

#   define BN_MP_RADIX_SIZE_C
#   define BN_MP_RADIX_SMAP_C
#   define BN_MP_RAND_C
#   define BN_MP_READ_RADIX_C
#   define BN_MP_READ_SIGNED_BIN_C
#   define BN_MP_READ_UNSIGNED_BIN_C
#   define BN_MP_REDUCE_C
#   define BN_MP_REDUCE_2K_C
#   define BN_MP_REDUCE_2K_L_C
#   define BN_MP_REDUCE_2K_SETUP_C
#   define BN_MP_REDUCE_2K_SETUP_L_C
#   define BN_MP_REDUCE_IS_2K_C
#   define BN_MP_REDUCE_IS_2K_L_C
#   define BN_MP_REDUCE_SETUP_C
#   define BN_MP_RSHD_C
#   define BN_MP_SET_C

#   define BN_MP_SET_INT_C
#   define BN_MP_SET_LONG_C
#   define BN_MP_SET_LONG_LONG_C
#   define BN_MP_SHRINK_C
#   define BN_MP_SIGNED_BIN_SIZE_C
#   define BN_MP_SQR_C
#   define BN_MP_SQRMOD_C







>
>

















>


















>






>
















>







55
56
57
58
59
60
61
62
63
64
65
66
67
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#   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_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
#   define BN_MP_INIT_COPY_C
#   define BN_MP_INIT_MULTI_C
#   define BN_MP_INIT_SET_C
#   define BN_MP_INIT_SET_INT_C
#   define BN_MP_INIT_SIZE_C
#   define BN_MP_INVMOD_C
#   define BN_MP_INVMOD_SLOW_C
#   define BN_MP_IS_SQUARE_C
#   define BN_MP_JACOBI_C
#   define BN_MP_KARATSUBA_MUL_C
#   define BN_MP_KARATSUBA_SQR_C
#   define BN_MP_KRONECKER_C
#   define BN_MP_LCM_C
#   define BN_MP_LSHD_C
#   define BN_MP_MOD_C
#   define BN_MP_MOD_2D_C
#   define BN_MP_MOD_D_C
#   define BN_MP_MONTGOMERY_CALC_NORMALIZATION_C
#   define BN_MP_MONTGOMERY_REDUCE_C
#   define BN_MP_MONTGOMERY_SETUP_C
#   define BN_MP_MUL_C
#   define BN_MP_MUL_2_C
#   define BN_MP_MUL_2D_C
#   define BN_MP_MUL_D_C
#   define BN_MP_MULMOD_C
#   define BN_MP_N_ROOT_C
#   define BN_MP_N_ROOT_EX_C
#   define BN_MP_NEG_C
#   define BN_MP_OR_C
#   define BN_MP_PRIME_FERMAT_C
#   define BN_MP_PRIME_FROBENIUS_UNDERWOOD_C
#   define BN_MP_PRIME_IS_DIVISIBLE_C
#   define BN_MP_PRIME_IS_PRIME_C
#   define BN_MP_PRIME_MILLER_RABIN_C
#   define BN_MP_PRIME_NEXT_PRIME_C
#   define BN_MP_PRIME_RABIN_MILLER_TRIALS_C
#   define BN_MP_PRIME_RANDOM_EX_C
#   define BN_MP_PRIME_STRONG_LUCAS_SELFRIDGE_C
#   define BN_MP_RADIX_SIZE_C
#   define BN_MP_RADIX_SMAP_C
#   define BN_MP_RAND_C
#   define BN_MP_READ_RADIX_C
#   define BN_MP_READ_SIGNED_BIN_C
#   define BN_MP_READ_UNSIGNED_BIN_C
#   define BN_MP_REDUCE_C
#   define BN_MP_REDUCE_2K_C
#   define BN_MP_REDUCE_2K_L_C
#   define BN_MP_REDUCE_2K_SETUP_C
#   define BN_MP_REDUCE_2K_SETUP_L_C
#   define BN_MP_REDUCE_IS_2K_C
#   define BN_MP_REDUCE_IS_2K_L_C
#   define BN_MP_REDUCE_SETUP_C
#   define BN_MP_RSHD_C
#   define BN_MP_SET_C
#   define BN_MP_SET_DOUBLE_C
#   define BN_MP_SET_INT_C
#   define BN_MP_SET_LONG_C
#   define BN_MP_SET_LONG_LONG_C
#   define BN_MP_SHRINK_C
#   define BN_MP_SIGNED_BIN_SIZE_C
#   define BN_MP_SQR_C
#   define BN_MP_SQRMOD_C
138
139
140
141
142
143
144
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
#   define BN_S_MP_EXPTMOD_C
#   define BN_S_MP_MUL_DIGS_C
#   define BN_S_MP_MUL_HIGH_DIGS_C
#   define BN_S_MP_SQR_C
#   define BN_S_MP_SUB_C
#   define BNCORE_C
#endif

#if defined(BN_ERROR_C)
#   define BN_MP_ERROR_TO_STRING_C
#endif

#if defined(BN_FAST_MP_INVMOD_C)
#   define BN_MP_ISEVEN_C
#   define BN_MP_INIT_MULTI_C
#   define BN_MP_COPY_C
#   define BN_MP_MOD_C
#   define BN_MP_ISZERO_C
#   define BN_MP_SET_C
#   define BN_MP_DIV_2_C
#   define BN_MP_ISODD_C
#   define BN_MP_SUB_C
#   define BN_MP_CMP_C
#   define BN_MP_CMP_D_C
#   define BN_MP_ADD_C

#   define BN_MP_EXCH_C
#   define BN_MP_CLEAR_MULTI_C
#endif

#if defined(BN_FAST_MP_MONTGOMERY_REDUCE_C)
#   define BN_MP_GROW_C
#   define BN_MP_RSHD_C







<

















>







155
156
157
158
159
160
161

162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
#   define BN_S_MP_EXPTMOD_C
#   define BN_S_MP_MUL_DIGS_C
#   define BN_S_MP_MUL_HIGH_DIGS_C
#   define BN_S_MP_SQR_C
#   define BN_S_MP_SUB_C
#   define BNCORE_C
#endif

#if defined(BN_ERROR_C)
#   define BN_MP_ERROR_TO_STRING_C
#endif

#if defined(BN_FAST_MP_INVMOD_C)
#   define BN_MP_ISEVEN_C
#   define BN_MP_INIT_MULTI_C
#   define BN_MP_COPY_C
#   define BN_MP_MOD_C
#   define BN_MP_ISZERO_C
#   define BN_MP_SET_C
#   define BN_MP_DIV_2_C
#   define BN_MP_ISODD_C
#   define BN_MP_SUB_C
#   define BN_MP_CMP_C
#   define BN_MP_CMP_D_C
#   define BN_MP_ADD_C
#   define BN_MP_CMP_MAG_C
#   define BN_MP_EXCH_C
#   define BN_MP_CLEAR_MULTI_C
#endif

#if defined(BN_FAST_MP_MONTGOMERY_REDUCE_C)
#   define BN_MP_GROW_C
#   define BN_MP_RSHD_C
420
421
422
423
424
425
426








427
428
429
430
431
432
433
#   define BN_MP_DIV_2D_C
#   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_MP_GET_INT_C)
#endif

#if defined(BN_MP_GET_LONG_C)
#endif








>
>
>
>
>
>
>
>







437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
#   define BN_MP_DIV_2D_C
#   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_MP_GET_BIT_C)
#   define BN_MP_ISZERO_C
#endif

#if defined(BN_MP_GET_DOUBLE_C)
#   define BN_MP_ISNEG_C
#endif

#if defined(BN_MP_GET_INT_C)
#endif

#if defined(BN_MP_GET_LONG_C)
#endif

505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
#   define BN_MP_SQRT_C
#   define BN_MP_SQR_C
#   define BN_MP_CMP_MAG_C
#   define BN_MP_CLEAR_C
#endif

#if defined(BN_MP_JACOBI_C)
#   define BN_MP_ISNEG_C
#   define BN_MP_CMP_D_C
#   define BN_MP_ISZERO_C
#   define BN_MP_INIT_COPY_C
#   define BN_MP_CNT_LSB_C
#   define BN_MP_DIV_2D_C
#   define BN_MP_MOD_C
#   define BN_MP_CLEAR_C
#endif

#if defined(BN_MP_KARATSUBA_MUL_C)
#   define BN_MP_MUL_C
#   define BN_MP_INIT_SIZE_C
#   define BN_MP_CLAMP_C
#   define BN_S_MP_ADD_C







|
|
|
<
<
<
<
<







530
531
532
533
534
535
536
537
538
539





540
541
542
543
544
545
546
#   define BN_MP_SQRT_C
#   define BN_MP_SQR_C
#   define BN_MP_CMP_MAG_C
#   define BN_MP_CLEAR_C
#endif

#if defined(BN_MP_JACOBI_C)
#   define BN_MP_KRONECKER_C
#   define BN_MP_ISNEG_C
#   define BN_MP_CMP_D_C





#endif

#if defined(BN_MP_KARATSUBA_MUL_C)
#   define BN_MP_MUL_C
#   define BN_MP_INIT_SIZE_C
#   define BN_MP_CLAMP_C
#   define BN_S_MP_ADD_C
536
537
538
539
540
541
542












543
544
545
546
547
548
549
#   define BN_MP_SQR_C
#   define BN_S_MP_ADD_C
#   define BN_S_MP_SUB_C
#   define BN_MP_LSHD_C
#   define BN_MP_ADD_C
#   define BN_MP_CLEAR_C
#endif













#if defined(BN_MP_LCM_C)
#   define BN_MP_INIT_MULTI_C
#   define BN_MP_GCD_C
#   define BN_MP_CMP_MAG_C
#   define BN_MP_DIV_C
#   define BN_MP_MUL_C







>
>
>
>
>
>
>
>
>
>
>
>







556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
#   define BN_MP_SQR_C
#   define BN_S_MP_ADD_C
#   define BN_S_MP_SUB_C
#   define BN_MP_LSHD_C
#   define BN_MP_ADD_C
#   define BN_MP_CLEAR_C
#endif

#if defined(BN_MP_KRONECKER_C)
#   define BN_MP_ISZERO_C
#   define BN_MP_ISEVEN_C
#   define BN_MP_INIT_COPY_C
#   define BN_MP_CNT_LSB_C
#   define BN_MP_DIV_2D_C
#   define BN_MP_CMP_D_C
#   define BN_MP_COPY_C
#   define BN_MP_MOD_C
#   define BN_MP_CLEAR_C
#endif

#if defined(BN_MP_LCM_C)
#   define BN_MP_INIT_MULTI_C
#   define BN_MP_GCD_C
#   define BN_MP_CMP_MAG_C
#   define BN_MP_DIV_C
#   define BN_MP_MUL_C
661
662
663
664
665
666
667
























668
669
670
671
672
673


674
675
676





677

678

679
680
681
682
683
684
685
#if defined(BN_MP_PRIME_FERMAT_C)
#   define BN_MP_CMP_D_C
#   define BN_MP_INIT_C
#   define BN_MP_EXPTMOD_C
#   define BN_MP_CMP_C
#   define BN_MP_CLEAR_C
#endif

























#if defined(BN_MP_PRIME_IS_DIVISIBLE_C)
#   define BN_MP_MOD_D_C
#endif

#if defined(BN_MP_PRIME_IS_PRIME_C)


#   define BN_MP_CMP_D_C
#   define BN_MP_PRIME_IS_DIVISIBLE_C
#   define BN_MP_INIT_C





#   define BN_MP_SET_C

#   define BN_MP_PRIME_MILLER_RABIN_C

#   define BN_MP_CLEAR_C
#endif

#if defined(BN_MP_PRIME_MILLER_RABIN_C)
#   define BN_MP_CMP_D_C
#   define BN_MP_INIT_COPY_C
#   define BN_MP_SUB_D_C







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>






>
>


|
>
>
>
>
>

>
|
>







693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
#if defined(BN_MP_PRIME_FERMAT_C)
#   define BN_MP_CMP_D_C
#   define BN_MP_INIT_C
#   define BN_MP_EXPTMOD_C
#   define BN_MP_CMP_C
#   define BN_MP_CLEAR_C
#endif

#if defined(BN_MP_PRIME_FROBENIUS_UNDERWOOD_C)
#   define BN_MP_PRIME_IS_PRIME_C
#   define BN_MP_INIT_MULTI_C
#   define BN_MP_SET_LONG_C
#   define BN_MP_SQR_C
#   define BN_MP_SUB_D_C
#   define BN_MP_KRONECKER_C
#   define BN_MP_GCD_C
#   define BN_MP_ADD_D_C
#   define BN_MP_SET_C
#   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_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)
#   define BN_MP_MOD_D_C
#endif

#if defined(BN_MP_PRIME_IS_PRIME_C)
#   define BN_MP_ISEVEN_C
#   define BN_MP_IS_SQUARE_C
#   define BN_MP_CMP_D_C
#   define BN_MP_PRIME_IS_DIVISIBLE_C
#   define BN_MP_INIT_SET_C
#   define BN_MP_PRIME_MILLER_RABIN_C
#   define BN_MP_PRIME_FROBENIUS_UNDERWOOD_C
#   define BN_MP_PRIME_STRONG_LUCAS_SELFRIDGE_C
#   define BN_MP_READ_RADIX_C
#   define BN_MP_CMP_C
#   define BN_MP_SET_C
#   define BN_MP_COUNT_BITS_C
#   define BN_MP_RAND_C
#   define BN_MP_DIV_2D_C
#   define BN_MP_CLEAR_C
#endif

#if defined(BN_MP_PRIME_MILLER_RABIN_C)
#   define BN_MP_CMP_D_C
#   define BN_MP_INIT_COPY_C
#   define BN_MP_SUB_D_C
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716































717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732

733
734
735
736
737
738
739
#   define BN_MP_CMP_D_C
#   define BN_MP_SET_C
#   define BN_MP_SUB_D_C
#   define BN_MP_ISEVEN_C
#   define BN_MP_MOD_D_C
#   define BN_MP_INIT_C
#   define BN_MP_ADD_D_C
#   define BN_MP_PRIME_MILLER_RABIN_C
#   define BN_MP_CLEAR_C
#endif

#if defined(BN_MP_PRIME_RABIN_MILLER_TRIALS_C)
#endif

#if defined(BN_MP_PRIME_RANDOM_EX_C)
#   define BN_MP_READ_UNSIGNED_BIN_C
#   define BN_MP_PRIME_IS_PRIME_C
#   define BN_MP_SUB_D_C
#   define BN_MP_DIV_2_C
#   define BN_MP_MUL_2_C
#   define BN_MP_ADD_D_C
#endif
































#if defined(BN_MP_RADIX_SIZE_C)
#   define BN_MP_ISZERO_C
#   define BN_MP_COUNT_BITS_C
#   define BN_MP_INIT_COPY_C
#   define BN_MP_DIV_D_C
#   define BN_MP_CLEAR_C
#endif

#if defined(BN_MP_RADIX_SMAP_C)
#   define BN_MP_S_RMAP_C
#   define BN_MP_S_RMAP_REVERSE_C
#   define BN_MP_S_RMAP_REVERSE_SZ_C
#endif

#if defined(BN_MP_RAND_C)

#   define BN_MP_ZERO_C
#   define BN_MP_ADD_D_C
#   define BN_MP_LSHD_C
#endif

#if defined(BN_MP_READ_RADIX_C)
#   define BN_MP_ZERO_C







|














>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
















>







760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
#   define BN_MP_CMP_D_C
#   define BN_MP_SET_C
#   define BN_MP_SUB_D_C
#   define BN_MP_ISEVEN_C
#   define BN_MP_MOD_D_C
#   define BN_MP_INIT_C
#   define BN_MP_ADD_D_C
#   define BN_MP_PRIME_IS_PRIME_C
#   define BN_MP_CLEAR_C
#endif

#if defined(BN_MP_PRIME_RABIN_MILLER_TRIALS_C)
#endif

#if defined(BN_MP_PRIME_RANDOM_EX_C)
#   define BN_MP_READ_UNSIGNED_BIN_C
#   define BN_MP_PRIME_IS_PRIME_C
#   define BN_MP_SUB_D_C
#   define BN_MP_DIV_2_C
#   define BN_MP_MUL_2_C
#   define BN_MP_ADD_D_C
#endif

#if defined(BN_MP_PRIME_STRONG_LUCAS_SELFRIDGE_C)
#   define BN_MP_PRIME_IS_PRIME_C
#   define BN_MP_MUL_D_C
#   define BN_S_MP_MUL_SI_C
#   define BN_MP_INIT_C
#   define BN_MP_SET_LONG_C
#   define BN_MP_MUL_C
#   define BN_MP_CLEAR_C
#   define BN_MP_INIT_MULTI_C
#   define BN_MP_GCD_C
#   define BN_MP_CMP_D_C
#   define BN_MP_CMP_C
#   define BN_MP_KRONECKER_C
#   define BN_MP_ADD_D_C
#   define BN_MP_CNT_LSB_C
#   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_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

#if defined(BN_MP_RADIX_SIZE_C)
#   define BN_MP_ISZERO_C
#   define BN_MP_COUNT_BITS_C
#   define BN_MP_INIT_COPY_C
#   define BN_MP_DIV_D_C
#   define BN_MP_CLEAR_C
#endif

#if defined(BN_MP_RADIX_SMAP_C)
#   define BN_MP_S_RMAP_C
#   define BN_MP_S_RMAP_REVERSE_C
#   define BN_MP_S_RMAP_REVERSE_SZ_C
#endif

#if defined(BN_MP_RAND_C)
#   define BN_MP_RAND_DIGIT_C
#   define BN_MP_ZERO_C
#   define BN_MP_ADD_D_C
#   define BN_MP_LSHD_C
#endif

#if defined(BN_MP_READ_RADIX_C)
#   define BN_MP_ZERO_C
828
829
830
831
832
833
834







835
836
837
838
839
840
841
#if defined(BN_MP_RSHD_C)
#   define BN_MP_ZERO_C
#endif

#if defined(BN_MP_SET_C)
#   define BN_MP_ZERO_C
#endif








#if defined(BN_MP_SET_INT_C)
#   define BN_MP_ZERO_C
#   define BN_MP_MUL_2D_C
#   define BN_MP_CLAMP_C
#endif








>
>
>
>
>
>
>







925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
#if defined(BN_MP_RSHD_C)
#   define BN_MP_ZERO_C
#endif

#if defined(BN_MP_SET_C)
#   define BN_MP_ZERO_C
#endif

#if defined(BN_MP_SET_DOUBLE_C)
#   define BN_MP_SET_LONG_LONG_C
#   define BN_MP_DIV_2D_C
#   define BN_MP_MUL_2D_C
#   define BN_MP_ISZERO_C
#endif

#if defined(BN_MP_SET_INT_C)
#   define BN_MP_ZERO_C
#   define BN_MP_MUL_2D_C
#   define BN_MP_CLAMP_C
#endif

1109
1110
1111
1112
1113
1114
1115




#endif

#include <tommath_superclass.h>
#include <tommath_class.h>
#else
#   define LTM_LAST
#endif











>
>
>
>
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
#endif

#include <tommath_superclass.h>
#include <tommath_class.h>
#else
#   define LTM_LAST
#endif

/* ref:         $Format:%D$ */
/* git commit:  $Format:%H$ */
/* commit time: $Format:%ai$ */
Changes to libtommath/tommath_private.h.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 */
#ifndef TOMMATH_PRIV_H_
#define TOMMATH_PRIV_H_

#include <tommath.h>
#include <ctype.h>










|
<







1
2
3
4
5
6
7
8
9
10

11
12
13
14
15
16
17
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense

 */
#ifndef TOMMATH_PRIV_H_
#define TOMMATH_PRIV_H_

#include <tommath.h>
#include <ctype.h>

Changes to libtommath/tommath_superclass.h.












1
2
3
4
5
6
7












/* super class file for PK algos */

/* default ... include all MPI */
#define LTM_ALL

/* RSA only (does not support DH/DSA/ECC) */
/* #define SC_RSA_1 */
>
>
>
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * SPDX-License-Identifier: Unlicense
 */

/* super class file for PK algos */

/* default ... include all MPI */
#define LTM_ALL

/* RSA only (does not support DH/DSA/ECC) */
/* #define SC_RSA_1 */
Changes to macosx/GNUmakefile.
137
138
139
140
141
142
143
144
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
171
172
173
174
175
176
177
178
179
180

build-${PROJECT}: ${objdir}/Makefile
	${DO_MAKE}
ifeq (${INSTALL_BUILD},)
# symolic link hackery to trick
# 'make install INSTALL_ROOT=${OBJ_DIR}'
# into building Tcl.framework and tclsh in ${SYMROOT}
	@cd "${OBJ_DIR}" && mkdir -p $(dir $(subst ${space},\ ,./${LIBDIR})) $(dir $(subst ${space},\ ,./${BINDIR})) "${SYMROOT}" && \
	rm -f "./${LIBDIR}" "./${BINDIR}" && ln -fs "${SYMROOT}" "./${LIBDIR}" && \
	ln -fs "${SYMROOT}" "./${BINDIR}" && ln -fs "${OBJ_DIR}/tcltest" "${SYMROOT}"
endif

install-${PROJECT}: build-${PROJECT}
ifeq (${EMBEDDED_BUILD}_${INSTALL_ROOT},1_)
	@echo "Cannot install-embedded with empty INSTALL_ROOT !" && false
endif
ifeq (${EMBEDDED_BUILD},1)
	@rm -rf "${INSTALL_ROOT}/${LIBDIR}/Tcl.framework"
endif
	${DO_MAKE}
ifeq (${INSTALL_BUILD},1)
ifeq (${EMBEDDED_BUILD},1)
# if we are embedding frameworks, don't install tclsh
	@rm -f "${INSTALL_ROOT}${BINDIR}/${TCLSH}" && \
	rmdir -p "${INSTALL_ROOT}${BINDIR}" 2>&- || true
else
# redo prebinding (when not building for Mac OS X 10.4 or later only)
	@if [ "`echo "$${MACOSX_DEPLOYMENT_TARGET}" | \
	awk -F '10\\.' '{print int($$2)}'`" -lt 4 -a "`echo "$${CFLAGS}" | \
	awk -F '-mmacosx-version-min=10\\.' '{print int($$2)}'`" -lt 4 ]; \
	then cd ${INSTALL_ROOT}/; \
	if [ ! -d usr/lib ]; then mkdir -p usr && ln -fs /usr/lib usr/ && RM_USRLIB=1; fi; \
	if [ ! -d System ]; then ln -fs /System . && RM_SYSTEM=1; fi; \
	redo_prebinding -r . "./${LIBDIR}/${PRODUCT_NAME}.framework/Versions/${VERSION}/${PRODUCT_NAME}"; \
	redo_prebinding -r . "./${BINDIR}/${TCLSH}"; \
	if [ -n "$${RM_USRLIB:-}" ]; then rm -f usr/lib; rmdir -p usr 2>&-; fi; \
	if [ -n "$${RM_SYSTEM:-}" ]; then rm -f System; fi; fi
# install tclsh symbolic link
	@ln -fs ${TCLSH} "${INSTALL_ROOT}${BINDIR}/tclsh"
endif
endif
ifeq (${BUILD_STYLE}_${EMBEDDED_BUILD},Development_)
# keep copy of debug library around, so that
# Deployment build can be installed on top







|
|
|







|








<
<
<
<
<
<
<
<
<
<
<







137
138
139
140
141
142
143
144
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

build-${PROJECT}: ${objdir}/Makefile
	${DO_MAKE}
ifeq (${INSTALL_BUILD},)
# symolic link hackery to trick
# 'make install INSTALL_ROOT=${OBJ_DIR}'
# into building Tcl.framework and tclsh in ${SYMROOT}
	@cd "${OBJ_DIR}" && mkdir -p $(dir $(subst ${space},\ ,.${LIBDIR})) $(dir $(subst ${space},\ ,.${BINDIR})) "${SYMROOT}" && \
	rm -f ".${LIBDIR}" ".${BINDIR}" && ln -fs "${SYMROOT}" ".${LIBDIR}" && \
	ln -fs "${SYMROOT}" ".${BINDIR}" && ln -fs "${OBJ_DIR}/tcltest" "${SYMROOT}"
endif

install-${PROJECT}: build-${PROJECT}
ifeq (${EMBEDDED_BUILD}_${INSTALL_ROOT},1_)
	@echo "Cannot install-embedded with empty INSTALL_ROOT !" && false
endif
ifeq (${EMBEDDED_BUILD},1)
	@rm -rf "${INSTALL_ROOT}${LIBDIR}/Tcl.framework"
endif
	${DO_MAKE}
ifeq (${INSTALL_BUILD},1)
ifeq (${EMBEDDED_BUILD},1)
# if we are embedding frameworks, don't install tclsh
	@rm -f "${INSTALL_ROOT}${BINDIR}/${TCLSH}" && \
	rmdir -p "${INSTALL_ROOT}${BINDIR}" 2>&- || true
else











# install tclsh symbolic link
	@ln -fs ${TCLSH} "${INSTALL_ROOT}${BINDIR}/tclsh"
endif
endif
ifeq (${BUILD_STYLE}_${EMBEDDED_BUILD},Development_)
# keep copy of debug library around, so that
# Deployment build can be installed on top
Changes to macosx/README.
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
Tiger you need to add "-isysroot /Developer/SDKs/MacOSX10.4u.sdk").
Note that configure requires CFLAGS to contain a least one architecture that can
be run on the build machine (i.e. ppc on G3/G4, ppc or ppc64 on G5, ppc or i386
on Core and ppc, i386 or x86_64 on Core2/Xeon).
Universal builds of Tcl TEA extensions are also possible with CFLAGS set as
above, they will be [load]able by universal as well as thin binaries of Tcl.

- To enable weak-linking, set the MACOSX_DEPLOYMENT_TARGET environment variable
to the minimal OS version the binaries should be able to run on, e.g:
	export MACOSX_DEPLOYMENT_TARGET=10.4
This requires at least gcc 3.1; with gcc 4 or later, set/add to CFLAGS instead:
	export CFLAGS="-mmacosx-version-min=10.4"
Support for weak-linking was added with 8.4.14/8.5a5.

Detailed Instructions for building with macosx/GNUmakefile
----------------------------------------------------------

- Unpack the Tcl source release archive.

- The following instructions assume the Tcl source tree is named "tcl${ver}",
(where ${ver} is a shell variable containing the Tcl version number e.g. '9.0').







<
<
<
<
<
<
<







124
125
126
127
128
129
130







131
132
133
134
135
136
137
Tiger you need to add "-isysroot /Developer/SDKs/MacOSX10.4u.sdk").
Note that configure requires CFLAGS to contain a least one architecture that can
be run on the build machine (i.e. ppc on G3/G4, ppc or ppc64 on G5, ppc or i386
on Core and ppc, i386 or x86_64 on Core2/Xeon).
Universal builds of Tcl TEA extensions are also possible with CFLAGS set as
above, they will be [load]able by universal as well as thin binaries of Tcl.








Detailed Instructions for building with macosx/GNUmakefile
----------------------------------------------------------

- Unpack the Tcl source release archive.

- The following instructions assume the Tcl source tree is named "tcl${ver}",
(where ${ver} is a shell variable containing the Tcl version number e.g. '9.0').
Changes to macosx/tclMacOSXFCmd.c.
635
636
637
638
639
640
641

642
643
644
645
646
647
648
649
650
651
    Tcl_Interp *interp,		/* Tcl interpreter */
    Tcl_Obj *objPtr)		/* Pointer to the object to convert */
{
    const char *string;
    int result = TCL_OK;
    Tcl_DString ds;
    Tcl_Encoding encoding = Tcl_GetEncoding(NULL, "macRoman");


    string = TclGetString(objPtr);
    Tcl_UtfToExternalDString(encoding, string, objPtr->length, &ds);

    if (Tcl_DStringLength(&ds) > 4) {
	if (interp) {
	    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		    "expected Macintosh OS type but got \"%s\": ", string));
	    Tcl_SetErrorCode(interp, "TCL", "VALUE", "MAC_OSTYPE", NULL);
	}







>

|
|







635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
    Tcl_Interp *interp,		/* Tcl interpreter */
    Tcl_Obj *objPtr)		/* Pointer to the object to convert */
{
    const char *string;
    int result = TCL_OK;
    Tcl_DString ds;
    Tcl_Encoding encoding = Tcl_GetEncoding(NULL, "macRoman");
    size_t length;

    string = TclGetStringFromObj(objPtr, &length);
    Tcl_UtfToExternalDString(encoding, string, length, &ds);

    if (Tcl_DStringLength(&ds) > 4) {
	if (interp) {
	    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		    "expected Macintosh OS type but got \"%s\": ", string));
	    Tcl_SetErrorCode(interp, "TCL", "VALUE", "MAC_OSTYPE", NULL);
	}
Changes to tests/mathop.test.
1202
1203
1204
1205
1206
1207
1208


1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221


1222






















1223
1224
1225
1226
1227
1228
1229
1230
test mathop-25.2  { exp operator } {TestOp **   0    } 0
test mathop-25.3  { exp operator } {TestOp **   0   5} 0
test mathop-25.4  { exp operator } {TestOp ** 7.5    } 7.5
test mathop-25.5  { exp operator } {TestOp **   1   5} 1
test mathop-25.6  { exp operator } {TestOp **   5   1} 5
test mathop-25.7  { exp operator } {TestOp ** 4 3 2 1} 262144
test mathop-25.8  { exp operator } {TestOp ** 5.5   4} 915.0625


test mathop-25.9  { exp operator } {TestOp **  16 3.5} 16384.0
test mathop-25.10 { exp operator } {TestOp ** 3.5   0} 1.0
test mathop-25.11 { exp operator } {TestOp ** 378   0} 1
test mathop-25.12 { exp operator } {TestOp ** 7.8   1} 7.8
test mathop-25.13 { exp operator } {TestOp ** 748   1} 748
test mathop-25.14 { exp operator } {TestOp ** 1.6  -1} 0.625
test mathop-25.15 { exp operator } {TestOp ** 683  -1} 0
test mathop-25.16 { exp operator } {TestOp **   1  -1} 1
test mathop-25.17 { exp operator } {TestOp **  -1  -1} -1
test mathop-25.18 { exp operator } {TestOp **  -1  -2} 1
test mathop-25.19 { exp operator } {TestOp **  -1   3} -1
test mathop-25.20 { exp operator } {TestOp **  -1   4} 1
test mathop-25.21 { exp operator } {TestOp **   2  63} 9223372036854775808


test mathop-25.22 { exp operator } {TestOp ** 83756485763458746358734658473567847567473 2} 7015148907444467657897585474493757781161998914521537835809623408157343003287605729






















test mathop-25.23 { exp operator errors } {
    set res {}
    set exp {}

    set huge     [string repeat 145782 1000]
    set big      12135435435354435435342423948763867876
    set wide                             12345678912345
    set small                                         2







>
>













>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|







1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
test mathop-25.2  { exp operator } {TestOp **   0    } 0
test mathop-25.3  { exp operator } {TestOp **   0   5} 0
test mathop-25.4  { exp operator } {TestOp ** 7.5    } 7.5
test mathop-25.5  { exp operator } {TestOp **   1   5} 1
test mathop-25.6  { exp operator } {TestOp **   5   1} 5
test mathop-25.7  { exp operator } {TestOp ** 4 3 2 1} 262144
test mathop-25.8  { exp operator } {TestOp ** 5.5   4} 915.0625
test mathop-25.8a { exp operator } {TestOp ** 4.0  -1} 0.25
test mathop-25.8b { exp operator } {TestOp ** 2.0  -2} 0.25
test mathop-25.9  { exp operator } {TestOp **  16 3.5} 16384.0
test mathop-25.10 { exp operator } {TestOp ** 3.5   0} 1.0
test mathop-25.11 { exp operator } {TestOp ** 378   0} 1
test mathop-25.12 { exp operator } {TestOp ** 7.8   1} 7.8
test mathop-25.13 { exp operator } {TestOp ** 748   1} 748
test mathop-25.14 { exp operator } {TestOp ** 1.6  -1} 0.625
test mathop-25.15 { exp operator } {TestOp ** 683  -1} 0
test mathop-25.16 { exp operator } {TestOp **   1  -1} 1
test mathop-25.17 { exp operator } {TestOp **  -1  -1} -1
test mathop-25.18 { exp operator } {TestOp **  -1  -2} 1
test mathop-25.19 { exp operator } {TestOp **  -1   3} -1
test mathop-25.20 { exp operator } {TestOp **  -1   4} 1
test mathop-25.21 { exp operator } {TestOp **   2  63} 9223372036854775808
test mathop-25.22 { exp operator } {TestOp **   2 256} 115792089237316195423570985008687907853269984665640564039457584007913129639936
set big 83756485763458746358734658473567847567473
test mathop-25.23 { exp operator } {TestOp ** $big  2} 7015148907444467657897585474493757781161998914521537835809623408157343003287605729
test mathop-25.24 { exp operator } {TestOp ** $big  0} 1
test mathop-25.25 { exp operator } {TestOp ** $big  1} $big
test mathop-25.26 { exp operator } {TestOp ** $big -1} 0
test mathop-25.27 { exp operator } {TestOp ** $big -2} 0
test mathop-25.28 { exp operator } {TestOp ** $big -$big} 0
test mathop-25.29 { exp operator } {expr {[set res [TestOp **  $big -1.0]]   >  0 && $res < 1.2e-41}} 1
test mathop-25.30 { exp operator } {expr {[set res [TestOp **  $big -1e-18]] >  0 && $res < 1}} 1
test mathop-25.31 { exp operator } {expr {[set res [TestOp ** -$big -1.0]]   > -1 && $res < 0}} 1
test mathop-25.32 { exp operator } {expr {[set res [TestOp ** -$big -2.0]]   >  0 && $res < 1}} 1
test mathop-25.33 { exp operator } {expr {[set res [TestOp ** -$big -3.0]]   > -1 && $res < 0}} 1
test mathop-25.34 { exp operator } {TestOp ** $big -1e-30} 1.0
test mathop-25.35 { exp operator } {TestOp ** $big -1e+30} 0.0
test mathop-25.36 { exp operator } {TestOp **    0  $big}             0
test mathop-25.37 { exp operator } {TestOp **    1  $big}             1
test mathop-25.38 { exp operator } {TestOp **   -1  $big}            -1
test mathop-25.39 { exp operator } {TestOp **   -1  [expr {$big+1}]}  1
test mathop-25.40 { exp operator (small exponent power helper and its boundaries) } {
    set pwr 0
    set res 1
    while {[incr pwr] <= 17 && [set i [TestOp ** 15 $pwr]] == [set res [expr {$res * 15}]]} {}
    list [incr pwr -1] $res
} {17 98526125335693359375}
test mathop-25.41 { exp operator errors } {
    set res {}
    set exp {}

    set huge     [string repeat 145782 1000]
    set big      12135435435354435435342423948763867876
    set wide                             12345678912345
    set small                                         2
Changes to tests/process.test.
10
11
12
13
14
15
16



17
18











19
20






























21
22
23
24
25
26
27
28
29

if {[lsearch [namespace children] ::tcltest] == -1} {
    package require tcltest 2
    namespace import -force ::tcltest::*
}

# Utilities



set path(sleep) [makeFile {
    after [expr $argv*1000]











    exit
} sleep]






























set path(exit) [makeFile {
    exit $argv
} exit]

# Basic syntax checking
test process-1.1 {tcl::process command basic syntax} -returnCodes error -body {
    tcl::process
} -result {wrong # args: should be "tcl::process subcommand ?arg ...?"}
test process-1.2 {tcl::process subcommands} -returnCodes error -body {







>
>
>

|
>
>
>
>
>
>
>
>
>
>
>


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

|







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73

if {[lsearch [namespace children] ::tcltest] == -1} {
    package require tcltest 2
    namespace import -force ::tcltest::*
}

# Utilities
file delete [set path(test-signalfile)  [makeFile {} test-signalfile]]
set path(test-signalfile2) [makeFile {} test-signalfile2]
# $path(sleep) time ?filename? -- sleep for time (in ms) and stop if it gets signaled (file gets deleted)
set path(sleep) [makeFile {
    after [expr {[lindex $argv 0]*1000}] {set stop 1}
    if {[set fn [lindex $::argv 1]] ne ""} {
	close [open $fn w]
	proc check {} {
	    if {![file exists $::fn]} { # exit signaled
		after 10 {set ::stop 2}
	    }
	    after 10 check
	}
	after 10 check
    }
    vwait stop
    exit
} sleep]

proc wait_for_file {fn {timeout 10000}} {
    if {![file exists $fn]} {
	set toev [after $timeout {set found 0}]
	proc check {fn} {
	    if {[file exists $fn]} {
		set ::found 1
		return
	    }
	    after 10 [list check $fn]
	}
	after 10 [list check $fn]
	vwait ::found
	after cancel $toev
	unset ::found
    }
    file exists $fn
}
proc signal_exit {fn {wait 1}} {
    # wait for until file created if expected:
    if {!$wait || [wait_for_file $fn]} {
	# delete file to signal exit for child-process:
	while {1} {
	    if {![catch { file delete $fn } msg opt]
		|| [lrange [dict get $opt -errorcode] 0 1] ne {POSIX EACCES}
	    } break
	}
    }
}

set path(exit) [makeFile {
    exit [lindex $argv 0]
} exit]

# Basic syntax checking
test process-1.1 {tcl::process command basic syntax} -returnCodes error -body {
    tcl::process
} -result {wrong # args: should be "tcl::process subcommand ?arg ...?"}
test process-1.2 {tcl::process subcommands} -returnCodes error -body {
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
} -result {1} -cleanup {
    close $f
    tcl::process purge
    tcl::process autopurge 1
}

# Async child status
test process-6.1 {async status} -body {


    tcl::process autopurge 0
    set pid [exec [interpreter] $path(sleep) 1 &]
    set status1 [lindex [tcl::process status $pid] 1]

    set status2 [lindex [tcl::process status -wait $pid] 1]
    expr {
           $status1 eq {}
        && $status2 eq 0
    }
} -result {1} -cleanup {
    tcl::process purge
    tcl::process autopurge 1
}
test process-6.2 {selective wait} -body {



    tcl::process autopurge 0
    # Child 1 sleeps 1s
    set pid1 [exec [interpreter] $path(sleep) 1 &]
    # Child 2 sleeps 1s
    set pid2 [exec [interpreter] $path(sleep) 2 &]
    # Initial status
    set status1_1 [lindex [tcl::process status $pid1] 1]
    set status1_2 [lindex [tcl::process status $pid2] 1]
    # Wait until child 1 termination

    set status2_1 [lindex [tcl::process status -wait $pid1] 1]
    set status2_2 [lindex [tcl::process status $pid2] 1]
    # Wait until child 2 termination

    set status3_2 [lindex [tcl::process status -wait $pid2] 1]
    set status3_1 [lindex [tcl::process status $pid1] 1]
    expr {
           $status1_1 eq {}
        && $status1_2 eq {}
        && $status2_1 eq 0
        && $status2_2 eq {}







|
>
>

|

>









|
>
>
>


|

|




>



>







253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
} -result {1} -cleanup {
    close $f
    tcl::process purge
    tcl::process autopurge 1
}

# Async child status
test process-6.1 {async status} -setup {
    signal_exit $path(test-signalfile) 0; # clean signal-file
} -body {
    tcl::process autopurge 0
    set pid [exec [interpreter] $path(sleep) 1 $path(test-signalfile) &]
    set status1 [lindex [tcl::process status $pid] 1]
    signal_exit $path(test-signalfile); # signal exit (stop sleep)
    set status2 [lindex [tcl::process status -wait $pid] 1]
    expr {
           $status1 eq {}
        && $status2 eq 0
    }
} -result {1} -cleanup {
    tcl::process purge
    tcl::process autopurge 1
}
test process-6.2 {selective wait} -setup {
    signal_exit $path(test-signalfile)  0; # clean signal-files
    signal_exit $path(test-signalfile2) 0;
} -body {
    tcl::process autopurge 0
    # Child 1 sleeps 1s
    set pid1 [exec [interpreter] $path(sleep) 1 $path(test-signalfile) &]
    # Child 2 sleeps 1s
    set pid2 [exec [interpreter] $path(sleep) 2 $path(test-signalfile2) &]
    # Initial status
    set status1_1 [lindex [tcl::process status $pid1] 1]
    set status1_2 [lindex [tcl::process status $pid2] 1]
    # Wait until child 1 termination
    signal_exit $path(test-signalfile); # signal exit for pid1 (stop sleep)
    set status2_1 [lindex [tcl::process status -wait $pid1] 1]
    set status2_2 [lindex [tcl::process status $pid2] 1]
    # Wait until child 2 termination
    signal_exit $path(test-signalfile2); # signal exit for pid2 (stop sleep)
    set status3_2 [lindex [tcl::process status -wait $pid2] 1]
    set status3_1 [lindex [tcl::process status $pid1] 1]
    expr {
           $status1_1 eq {}
        && $status1_2 eq {}
        && $status2_1 eq 0
        && $status2_2 eq {}
276
277
278
279
280
281
282


283
284
    set pid [exec [interpreter] $path(exit) -1 &]
    lindex [tcl::process status -wait $pid] 1
} -match glob -result {1 {child killed: unknown signal} {CHILDKILLED * {unknown signal} {unknown signal}}} -cleanup {
    tcl::process purge
    tcl::process autopurge 1
}



::tcltest::cleanupTests
return







>
>


328
329
330
331
332
333
334
335
336
337
338
    set pid [exec [interpreter] $path(exit) -1 &]
    lindex [tcl::process status -wait $pid] 1
} -match glob -result {1 {child killed: unknown signal} {CHILDKILLED * {unknown signal} {unknown signal}}} -cleanup {
    tcl::process purge
    tcl::process autopurge 1
}

rename wait_for_file {}
rename signal_exit {}
::tcltest::cleanupTests
return
Changes to tests/var.test.
198
199
200
201
202
203
204






















205
206
207
208
209
210
211
        namespace delete [namespace current]
	set result
    }
} -result {0 2 1 {can't set "foo": upvar refers to element in deleted array}}
test var-1.19 {TclLookupVar, right error message when parsing variable name} -body {
    [format set] thisvar(doesntexist)
} -returnCodes error -result {can't read "thisvar(doesntexist)": no such variable}























test var-2.1 {Tcl_LappendObjCmd, create var if new} {
    catch {unset x}
    lappend x 1 2
} {1 2}

test var-3.1 {MakeUpvar, TCL_NAMESPACE_ONLY not specified for other var} -setup {







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







198
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
        namespace delete [namespace current]
	set result
    }
} -result {0 2 1 {can't set "foo": upvar refers to element in deleted array}}
test var-1.19 {TclLookupVar, right error message when parsing variable name} -body {
    [format set] thisvar(doesntexist)
} -returnCodes error -result {can't read "thisvar(doesntexist)": no such variable}
test var-1.20 {TclLookupVar, regression on utf-8 variable names} -setup {
    proc p [list \u20ac \xe4] {info vars}
} -body {
    # test variable with non-ascii name is available (euro and a-uml chars here):
    list \
	[p 1 2] \
	[apply [list [list \u20ac \xe4] {info vars}] 1 2] \
	[apply [list [list [list \u20ac \u20ac] [list \xe4 \xe4]] {info vars}]] \
} -cleanup {
    rename p {}
} -result [lrepeat 3 [list \u20ac \xe4]]
test var-1.21 {TclLookupVar, regression on utf-8 variable names} -setup {
    proc p [list [list \u20ac v\u20ac] [list \xe4 v\xe4]] {list [set \u20ac] [set \xe4]}
} -body {
    # test variable with non-ascii name (and default) is resolvable (euro and a-uml chars here):
    list \
	[p] \
	[apply [list [list \u20ac \xe4] {list [set \u20ac] [set \xe4]}] v\u20ac v\xe4] \
	[apply [list [list [list \u20ac v\u20ac] [list \xe4 v\xe4]] {list [set \u20ac] [set \xe4]}]] \
} -cleanup {
    rename p {}
} -result [lrepeat 3 [list v\u20ac v\xe4]]

test var-2.1 {Tcl_LappendObjCmd, create var if new} {
    catch {unset x}
    lappend x 1 2
} {1 2}

test var-3.1 {MakeUpvar, TCL_NAMESPACE_ONLY not specified for other var} -setup {
Changes to unix/Makefile.in.
333
334
335
336
337
338
339

340
341
342
343
344
345
346
	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_set_long_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_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 \







>







333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
	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_set_long_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_tc_and.o bn_mp_tc_div_2d.o bn_mp_tc_or.o bn_mp_tc_xor.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 \
543
544
545
546
547
548
549




550
551
552
553
554
555
556
	$(TOMMATH_DIR)/bn_mp_set_long.c \
	$(TOMMATH_DIR)/bn_mp_set_long_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_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 \







>
>
>
>







544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
	$(TOMMATH_DIR)/bn_mp_set_long.c \
	$(TOMMATH_DIR)/bn_mp_set_long_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_tc_and.c \
	$(TOMMATH_DIR)/bn_mp_tc_div_2d.c \
	$(TOMMATH_DIR)/bn_mp_tc_or.c \
	$(TOMMATH_DIR)/bn_mp_tc_xor.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 \
676
677
678
679
680
681
682





683
684

685
686
687
688
689

690
691
692
693
694
695
696
doc:

tclzipfile: ${TCL_ZIP_FILE}

${TCL_ZIP_FILE}: ${ZIP_INSTALL_OBJS}
	@rm -rf ${TCL_VFS_ROOT}
	@mkdir -p ${TCL_VFS_PATH}





	cp -a $(TOP_DIR)/library/* ${TCL_VFS_PATH}
	cp -a ${TCL_VFS_PATH}/manifest.txt ${TCL_VFS_PATH}/pkgIndex.tcl

	find ${TCL_VFS_ROOT} -type d -empty -delete
	(zip=`(realpath '${NATIVE_ZIP}' || readlink -m '${NATIVE_ZIP}') 2>/dev/null || \
	  (echo '${NATIVE_ZIP}' | sed "s?^\./?$$(pwd)/?")`; \
	  cd ${TCL_VFS_ROOT} && \
	  $$zip ${ZIP_PROG_OPTIONS} ../${TCL_ZIP_FILE} ${ZIP_PROG_VFSSEARCH} && \

	  cd ..)

# The following target is configured by autoconf to generate either a shared
# library or non-shared library for Tcl.
${LIB_FILE}: ${STUB_LIB_FILE} ${OBJS} ${TCL_ZIP_FILE}
	rm -f $@
	@MAKE_LIB@







>
>
>
>
>
|
|
>
|



|
>







681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
doc:

tclzipfile: ${TCL_ZIP_FILE}

${TCL_ZIP_FILE}: ${ZIP_INSTALL_OBJS}
	@rm -rf ${TCL_VFS_ROOT}
	@mkdir -p ${TCL_VFS_PATH}
	@echo "creating ${TCL_VFS_PATH} (prepare compression)"
	@( \
	  ln -s $(TOP_DIR)/library/* ${TCL_VFS_PATH}/ && \
	  ln ${TCL_VFS_PATH}/manifest.txt ${TCL_VFS_PATH}/pkgIndex.tcl \
	) || ( \
	  cp -a $(TOP_DIR)/library/* ${TCL_VFS_PATH}; \
	  cp -a ${TCL_VFS_PATH}/manifest.txt ${TCL_VFS_PATH}/pkgIndex.tcl; \
	)
	@find ${TCL_VFS_ROOT} -type d -empty -delete
	(zip=`(realpath '${NATIVE_ZIP}' || readlink -m '${NATIVE_ZIP}') 2>/dev/null || \
	  (echo '${NATIVE_ZIP}' | sed "s?^\./?$$(pwd)/?")`; \
	  cd ${TCL_VFS_ROOT} && \
	  $$zip ${ZIP_PROG_OPTIONS} ../${TCL_ZIP_FILE} ${ZIP_PROG_VFSSEARCH} >/dev/null && \
	  echo "${TCL_ZIP_FILE} successful created with $$zip" && \
	  cd ..)

# The following target is configured by autoconf to generate either a shared
# library or non-shared library for Tcl.
${LIB_FILE}: ${STUB_LIB_FILE} ${OBJS} ${TCL_ZIP_FILE}
	rm -f $@
	@MAKE_LIB@
1617
1618
1619
1620
1621
1622
1623












1624
1625
1626
1627
1628
1629
1630
	$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_sqrt.c

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_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








>
>
>
>
>
>
>
>
>
>
>
>







1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
	$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_sqrt.c

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_tc_and.o: $(TOMMATH_DIR)/bn_mp_tc_and.c $(MATHHDRS)
	$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_tc_and.c

bn_mp_tc_div_2d.o: $(TOMMATH_DIR)/bn_mp_tc_div_2d.c $(MATHHDRS)
	$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_tc_div_2d.c

bn_mp_tc_or.o: $(TOMMATH_DIR)/bn_mp_tc_or.c $(MATHHDRS)
	$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_tc_or.c

bn_mp_tc_xor.o: $(TOMMATH_DIR)/bn_mp_tc_xor.c $(MATHHDRS)
	$(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_tc_xor.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 unix/configure.
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917

		SHLIB_LD="${SHLIB_LD} -Wl,-single_module"

fi
	    SHLIB_SUFFIX=".dylib"
	    DL_OBJS="tclLoadDyld.o"
	    DL_LIBS=""
	    # Don't use -prebind when building for Mac OS X 10.4 or later only:
	    if test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int($2)}'`" -lt 4 -a \
		"`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int($2)}'`" -lt 4; then :

		LDFLAGS="$LDFLAGS -prebind"
fi
	    LDFLAGS="$LDFLAGS -headerpad_max_install_names"
	    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ld accepts -search_paths_first flag" >&5
$as_echo_n "checking if ld accepts -search_paths_first flag... " >&6; }
if ${tcl_cv_ld_search_paths_first+:} false; then :
  $as_echo_n "(cached) " >&6
else








<
<
<
<
<
<







5898
5899
5900
5901
5902
5903
5904






5905
5906
5907
5908
5909
5910
5911

		SHLIB_LD="${SHLIB_LD} -Wl,-single_module"

fi
	    SHLIB_SUFFIX=".dylib"
	    DL_OBJS="tclLoadDyld.o"
	    DL_LIBS=""






	    LDFLAGS="$LDFLAGS -headerpad_max_install_names"
	    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ld accepts -search_paths_first flag" >&5
$as_echo_n "checking if ld accepts -search_paths_first flag... " >&6; }
if ${tcl_cv_ld_search_paths_first+:} false; then :
  $as_echo_n "(cached) " >&6
else

10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
fi

    if test -f "$ac_cv_path_zip" ; then
        ZIP_PROG="$ac_cv_path_zip"
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIP_PROG" >&5
$as_echo "$ZIP_PROG" >&6; }
        ZIP_PROG_OPTIONS="-rq"
        ZIP_PROG_VFSSEARCH="."
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: Found INFO Zip in environment" >&5
$as_echo "Found INFO Zip in environment" >&6; }
        # Use standard arguments for zip
    else
        # It is not an error if an installed version of Zip can't be located.
        # We can use the locally distributed minizip instead
        ZIP_PROG="./minizip${EXEEXT_FOR_BUILD}"
        ZIP_PROG_OPTIONS="-o -r"
        ZIP_PROG_VFSSEARCH="."
        ZIP_INSTALL_OBJS="minizip${EXEEXT_FOR_BUILD}"
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: No zip found on PATH. Building minizip" >&5
$as_echo "No zip found on PATH. Building minizip" >&6; }
    fi










|








|







10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
fi

    if test -f "$ac_cv_path_zip" ; then
        ZIP_PROG="$ac_cv_path_zip"
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIP_PROG" >&5
$as_echo "$ZIP_PROG" >&6; }
        ZIP_PROG_OPTIONS="-rq"
        ZIP_PROG_VFSSEARCH="*"
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: Found INFO Zip in environment" >&5
$as_echo "Found INFO Zip in environment" >&6; }
        # Use standard arguments for zip
    else
        # It is not an error if an installed version of Zip can't be located.
        # We can use the locally distributed minizip instead
        ZIP_PROG="./minizip${EXEEXT_FOR_BUILD}"
        ZIP_PROG_OPTIONS="-o -r"
        ZIP_PROG_VFSSEARCH="*"
        ZIP_INSTALL_OBJS="minizip${EXEEXT_FOR_BUILD}"
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: No zip found on PATH. Building minizip" >&5
$as_echo "No zip found on PATH. Building minizip" >&6; }
    fi



Changes to unix/tcl.m4.
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
		LDFLAGS=$hold_ldflags])
	    AS_IF([test $tcl_cv_ld_single_module = yes], [
		SHLIB_LD="${SHLIB_LD} -Wl,-single_module"
	    ])
	    SHLIB_SUFFIX=".dylib"
	    DL_OBJS="tclLoadDyld.o"
	    DL_LIBS=""
	    # Don't use -prebind when building for Mac OS X 10.4 or later only:
	    AS_IF([test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int([$]2)}'`" -lt 4 -a \
		"`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int([$]2)}'`" -lt 4], [
		LDFLAGS="$LDFLAGS -prebind"])
	    LDFLAGS="$LDFLAGS -headerpad_max_install_names"
	    AC_CACHE_CHECK([if ld accepts -search_paths_first flag],
		    tcl_cv_ld_search_paths_first, [
		hold_ldflags=$LDFLAGS
		LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
		AC_TRY_LINK(, [int i;], tcl_cv_ld_search_paths_first=yes,
			tcl_cv_ld_search_paths_first=no)







<
<
<
<







1455
1456
1457
1458
1459
1460
1461




1462
1463
1464
1465
1466
1467
1468
		LDFLAGS=$hold_ldflags])
	    AS_IF([test $tcl_cv_ld_single_module = yes], [
		SHLIB_LD="${SHLIB_LD} -Wl,-single_module"
	    ])
	    SHLIB_SUFFIX=".dylib"
	    DL_OBJS="tclLoadDyld.o"
	    DL_LIBS=""




	    LDFLAGS="$LDFLAGS -headerpad_max_install_names"
	    AC_CACHE_CHECK([if ld accepts -search_paths_first flag],
		    tcl_cv_ld_search_paths_first, [
		hold_ldflags=$LDFLAGS
		LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
		AC_TRY_LINK(, [int i;], tcl_cv_ld_search_paths_first=yes,
			tcl_cv_ld_search_paths_first=no)
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
        done
    done
    ])
    if test -f "$ac_cv_path_zip" ; then
        ZIP_PROG="$ac_cv_path_zip"
        AC_MSG_RESULT([$ZIP_PROG])
        ZIP_PROG_OPTIONS="-rq"
        ZIP_PROG_VFSSEARCH="."
        AC_MSG_RESULT([Found INFO Zip in environment])
        # Use standard arguments for zip
    else
        # It is not an error if an installed version of Zip can't be located.
        # We can use the locally distributed minizip instead
        ZIP_PROG="./minizip${EXEEXT_FOR_BUILD}"
        ZIP_PROG_OPTIONS="-o -r"
        ZIP_PROG_VFSSEARCH="."
        ZIP_INSTALL_OBJS="minizip${EXEEXT_FOR_BUILD}"
        AC_MSG_RESULT([No zip found on PATH. Building minizip])
    fi
    AC_SUBST(ZIP_PROG)
    AC_SUBST(ZIP_PROG_OPTIONS)
    AC_SUBST(ZIP_PROG_VFSSEARCH)
    AC_SUBST(ZIP_INSTALL_OBJS)
])

# Local Variables:
# mode: autoconf
# End:







|







|












3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
        done
    done
    ])
    if test -f "$ac_cv_path_zip" ; then
        ZIP_PROG="$ac_cv_path_zip"
        AC_MSG_RESULT([$ZIP_PROG])
        ZIP_PROG_OPTIONS="-rq"
        ZIP_PROG_VFSSEARCH="*"
        AC_MSG_RESULT([Found INFO Zip in environment])
        # Use standard arguments for zip
    else
        # It is not an error if an installed version of Zip can't be located.
        # We can use the locally distributed minizip instead
        ZIP_PROG="./minizip${EXEEXT_FOR_BUILD}"
        ZIP_PROG_OPTIONS="-o -r"
        ZIP_PROG_VFSSEARCH="*"
        ZIP_INSTALL_OBJS="minizip${EXEEXT_FOR_BUILD}"
        AC_MSG_RESULT([No zip found on PATH. Building minizip])
    fi
    AC_SUBST(ZIP_PROG)
    AC_SUBST(ZIP_PROG_OPTIONS)
    AC_SUBST(ZIP_PROG_VFSSEARCH)
    AC_SUBST(ZIP_INSTALL_OBJS)
])

# Local Variables:
# mode: autoconf
# End:
Changes to unix/tclEpollNotfy.c.
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <fcntl.h>
#include <signal.h>
#include <sys/epoll.h>
#ifdef HAVE_EVENTFD
#include <sys/eventfd.h>
#endif /* HAVE_EVENTFD */
#include <sys/queue.h>
#include <unistd.h>

/*
 * This structure is used to keep track of the notifier info for a registered
 * file.
 */

struct PlatformEventData;







<







20
21
22
23
24
25
26

27
28
29
30
31
32
33
#include <fcntl.h>
#include <signal.h>
#include <sys/epoll.h>
#ifdef HAVE_EVENTFD
#include <sys/eventfd.h>
#endif /* HAVE_EVENTFD */
#include <sys/queue.h>


/*
 * This structure is used to keep track of the notifier info for a registered
 * file.
 */

struct PlatformEventData;
Changes to unix/tclLoadDl.c.
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
	/*
	 * Let the OS loader examine the binary search path for whatever
	 * string the user gave us which hopefully refers to a file on the
	 * binary path.
	 */

	Tcl_DString ds;
	const char *fileName = Tcl_GetString(pathPtr);

	native = Tcl_UtfToExternalDString(NULL, fileName, -1, &ds);
	/*
	 * Use (RTLD_NOW|RTLD_LOCAL) as default, see [Bug #3216070]
	 */
	handle = dlopen(native, dlopenflags);
	Tcl_DStringFree(&ds);
    }

    if (handle == NULL) {
	/*
	 * Write the string to a variable first to work around a compiler bug
	 * in the Sun Forte 6 compiler. [Bug 1503729]
	 */

	const char *errorStr = dlerror();

	if (interp) {
	    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		    "couldn't load file \"%s\": %s",
		    Tcl_GetString(pathPtr), errorStr));
	}
	return TCL_ERROR;
    }
    newHandle = Tcl_Alloc(sizeof(*newHandle));
    newHandle->clientData = handle;
    newHandle->findSymbolProcPtr = &FindSymbol;
    newHandle->unloadFileProcPtr = &UnloadFile;







|




















|







102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
	/*
	 * Let the OS loader examine the binary search path for whatever
	 * string the user gave us which hopefully refers to a file on the
	 * binary path.
	 */

	Tcl_DString ds;
	const char *fileName = TclGetString(pathPtr);

	native = Tcl_UtfToExternalDString(NULL, fileName, -1, &ds);
	/*
	 * Use (RTLD_NOW|RTLD_LOCAL) as default, see [Bug #3216070]
	 */
	handle = dlopen(native, dlopenflags);
	Tcl_DStringFree(&ds);
    }

    if (handle == NULL) {
	/*
	 * Write the string to a variable first to work around a compiler bug
	 * in the Sun Forte 6 compiler. [Bug 1503729]
	 */

	const char *errorStr = dlerror();

	if (interp) {
	    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		    "couldn't load file \"%s\": %s",
		    TclGetString(pathPtr), errorStr));
	}
	return TCL_ERROR;
    }
    newHandle = Tcl_Alloc(sizeof(*newHandle));
    newHandle->clientData = handle;
    newHandle->findSymbolProcPtr = &FindSymbol;
    newHandle->unloadFileProcPtr = &UnloadFile;
Changes to unix/tclLoadDyld.c.
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
    /*
     * First try the full path the user gave us. This is particularly
     * important if the cwd is inside a vfs, and we are trying to load using a
     * relative path.
     */

    nativePath = Tcl_FSGetNativePath(pathPtr);
    nativeFileName = Tcl_UtfToExternalDString(NULL, Tcl_GetString(pathPtr),
	    -1, &ds);

#if TCL_DYLD_USE_DLFCN
    /*
     * Use (RTLD_NOW|RTLD_LOCAL) as default, see [Bug #3216070]
     */








|







180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
    /*
     * First try the full path the user gave us. This is particularly
     * important if the cwd is inside a vfs, and we are trying to load using a
     * relative path.
     */

    nativePath = Tcl_FSGetNativePath(pathPtr);
    nativeFileName = Tcl_UtfToExternalDString(NULL, TclGetString(pathPtr),
	    -1, &ds);

#if TCL_DYLD_USE_DLFCN
    /*
     * Use (RTLD_NOW|RTLD_LOCAL) as default, see [Bug #3216070]
     */

Changes to unix/tclLoadNext.c.
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
    char *fileName;
    char *files[2];
    const char *native;
    int result = 1;

    NXStream *errorStream = NXOpenMemory(0,0,NX_READWRITE);

    fileName = Tcl_GetString(pathPtr);

    /*
     * First try the full path the user gave us. This is particularly
     * important if the cwd is inside a vfs, and we are trying to load using a
     * relative path.
     */








|







57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
    char *fileName;
    char *files[2];
    const char *native;
    int result = 1;

    NXStream *errorStream = NXOpenMemory(0,0,NX_READWRITE);

    fileName = TclGetString(pathPtr);

    /*
     * First try the full path the user gave us. This is particularly
     * important if the cwd is inside a vfs, and we are trying to load using a
     * relative path.
     */

Changes to unix/tclLoadOSF.c.
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
				 * function which should be used for this
				 * file. */
    int flags)
{
    Tcl_LoadHandle newHandle;
    ldr_module_t lm;
    char *pkg;
    char *fileName = Tcl_GetString(pathPtr);
    const char *native;

    /*
     * First try the full path the user gave us.  This is particularly
     * important if the cwd is inside a vfs, and we are trying to load using a
     * relative path.
     */







|







75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
				 * function which should be used for this
				 * file. */
    int flags)
{
    Tcl_LoadHandle newHandle;
    ldr_module_t lm;
    char *pkg;
    char *fileName = TclGetString(pathPtr);
    const char *native;

    /*
     * First try the full path the user gave us.  This is particularly
     * important if the cwd is inside a vfs, and we are trying to load using a
     * relative path.
     */
Changes to unix/tclLoadShl.c.
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
				 * function which should be used for this
				 * file. */
    int flags)
{
    shl_t handle;
    Tcl_LoadHandle newHandle;
    const char *native;
    char *fileName = Tcl_GetString(pathPtr);

    /*
     * The flags below used to be BIND_IMMEDIATE; they were changed at the
     * suggestion of Wolfgang Kechel ([email protected]): "This enables
     * verbosity for missing symbols when loading a shared lib and allows to
     * load libtk8.0.sl into tclsh8.0 without problems.  In general, this
     * delays resolving symbols until they are actually needed.  Shared libs







|







53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
				 * function which should be used for this
				 * file. */
    int flags)
{
    shl_t handle;
    Tcl_LoadHandle newHandle;
    const char *native;
    char *fileName = TclGetString(pathPtr);

    /*
     * The flags below used to be BIND_IMMEDIATE; they were changed at the
     * suggestion of Wolfgang Kechel ([email protected]): "This enables
     * verbosity for missing symbols when loading a shared lib and allows to
     * load libtk8.0.sl into tclsh8.0 without problems.  In general, this
     * delays resolving symbols until they are actually needed.  Shared libs
Changes to unix/tclUnixChan.c.
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
TtySetOptionProc(
    ClientData instanceData,	/* File state. */
    Tcl_Interp *interp,		/* For error reporting - can be NULL. */
    const char *optionName,	/* Which option to set? */
    const char *value)		/* New value for option. */
{
    FileState *fsPtr = instanceData;
    unsigned int len, vlen;
    TtyAttrs tty;
    int argc;
    const char **argv;
    struct termios iostate;

    len = strlen(optionName);
    vlen = strlen(value);







|







575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
TtySetOptionProc(
    ClientData instanceData,	/* File state. */
    Tcl_Interp *interp,		/* For error reporting - can be NULL. */
    const char *optionName,	/* Which option to set? */
    const char *value)		/* New value for option. */
{
    FileState *fsPtr = instanceData;
    size_t len, vlen;
    TtyAttrs tty;
    int argc;
    const char **argv;
    struct termios iostate;

    len = strlen(optionName);
    vlen = strlen(value);
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
TtyGetOptionProc(
    ClientData instanceData,	/* File state. */
    Tcl_Interp *interp,		/* For error reporting - can be NULL. */
    const char *optionName,	/* Option to get. */
    Tcl_DString *dsPtr)		/* Where to store value(s). */
{
    FileState *fsPtr = instanceData;
    unsigned int len;
    char buf[3*TCL_INTEGER_SPACE + 16];
    int valid = 0;		/* Flag if valid option parsed. */

    if (optionName == NULL) {
	len = 0;
    } else {
	len = strlen(optionName);







|







802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
TtyGetOptionProc(
    ClientData instanceData,	/* File state. */
    Tcl_Interp *interp,		/* For error reporting - can be NULL. */
    const char *optionName,	/* Option to get. */
    Tcl_DString *dsPtr)		/* Where to store value(s). */
{
    FileState *fsPtr = instanceData;
    size_t len;
    char buf[3*TCL_INTEGER_SPACE + 16];
    int valid = 0;		/* Flag if valid option parsed. */

    if (optionName == NULL) {
	len = 0;
    } else {
	len = strlen(optionName);
Changes to unix/tclUnixFCmd.c.
1503
1504
1505
1506
1507
1508
1509

1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
    int result;
    const char *native;

    if (Tcl_GetLongFromObj(NULL, attributePtr, &gid) != TCL_OK) {
	Tcl_DString ds;
	struct group *groupPtr = NULL;
	const char *string;


	string = TclGetString(attributePtr);

	native = Tcl_UtfToExternalDString(NULL, string, attributePtr->length, &ds);
	groupPtr = TclpGetGrNam(native); /* INTL: Native. */
	Tcl_DStringFree(&ds);

	if (groupPtr == NULL) {
	    if (interp != NULL) {
		Tcl_SetObjResult(interp, Tcl_ObjPrintf(
			"could not set group for file \"%s\":"







>

|

|







1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
    int result;
    const char *native;

    if (Tcl_GetLongFromObj(NULL, attributePtr, &gid) != TCL_OK) {
	Tcl_DString ds;
	struct group *groupPtr = NULL;
	const char *string;
	size_t length;

	string = TclGetStringFromObj(attributePtr, &length);

	native = Tcl_UtfToExternalDString(NULL, string, length, &ds);
	groupPtr = TclpGetGrNam(native); /* INTL: Native. */
	Tcl_DStringFree(&ds);

	if (groupPtr == NULL) {
	    if (interp != NULL) {
		Tcl_SetObjResult(interp, Tcl_ObjPrintf(
			"could not set group for file \"%s\":"
1569
1570
1571
1572
1573
1574
1575

1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
    int result;
    const char *native;

    if (Tcl_GetLongFromObj(NULL, attributePtr, &uid) != TCL_OK) {
	Tcl_DString ds;
	struct passwd *pwPtr = NULL;
	const char *string;


	string = TclGetString(attributePtr);

	native = Tcl_UtfToExternalDString(NULL, string, attributePtr->length, &ds);
	pwPtr = TclpGetPwNam(native);			/* INTL: Native. */
	Tcl_DStringFree(&ds);

	if (pwPtr == NULL) {
	    if (interp != NULL) {
		Tcl_SetObjResult(interp, Tcl_ObjPrintf(
			"could not set owner for file \"%s\":"







>

|

|







1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
    int result;
    const char *native;

    if (Tcl_GetLongFromObj(NULL, attributePtr, &uid) != TCL_OK) {
	Tcl_DString ds;
	struct passwd *pwPtr = NULL;
	const char *string;
	size_t length;

	string = TclGetStringFromObj(attributePtr, &length);

	native = Tcl_UtfToExternalDString(NULL, string, length, &ds);
	pwPtr = TclpGetPwNam(native);			/* INTL: Native. */
	Tcl_DStringFree(&ds);

	if (pwPtr == NULL) {
	    if (interp != NULL) {
		Tcl_SetObjResult(interp, Tcl_ObjPrintf(
			"could not set owner for file \"%s\":"
1941
1942
1943
1944
1945
1946
1947

1948
1949
1950
1951
1952
1953
1954
1955
1956
TclpObjNormalizePath(
    Tcl_Interp *interp,
    Tcl_Obj *pathPtr,
    int nextCheckpoint)
{
    const char *currentPathEndPosition;
    char cur;

    const char *path = TclGetString(pathPtr);
    size_t pathLen = pathPtr->length;
    Tcl_DString ds;
    const char *nativePath;
#ifndef NO_REALPATH
    char normPath[MAXPATHLEN];
#endif

    /*







>
|
<







1943
1944
1945
1946
1947
1948
1949
1950
1951

1952
1953
1954
1955
1956
1957
1958
TclpObjNormalizePath(
    Tcl_Interp *interp,
    Tcl_Obj *pathPtr,
    int nextCheckpoint)
{
    const char *currentPathEndPosition;
    char cur;
    size_t pathLen;
    const char *path = TclGetStringFromObj(pathPtr, &pathLen);

    Tcl_DString ds;
    const char *nativePath;
#ifndef NO_REALPATH
    char normPath[MAXPATHLEN];
#endif

    /*
2172
2173
2174
2175
2176
2177
2178

2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
    Tcl_Obj *basenameObj,
    Tcl_Obj *extensionObj,
    Tcl_Obj *resultingNameObj)
{
    Tcl_DString template, tmp;
    const char *string;
    int fd;


    /*
     * We should also check against making more then TMP_MAX of these.
     */

    if (dirObj) {
	string = TclGetString(dirObj);
	Tcl_UtfToExternalDString(NULL, string, dirObj->length, &template);
    } else {
	Tcl_DStringInit(&template);
	Tcl_DStringAppend(&template, DefaultTempDir(), -1); /* INTL: native */
    }

    TclDStringAppendLiteral(&template, "/");

    if (basenameObj) {
	string = TclGetString(basenameObj);
	Tcl_UtfToExternalDString(NULL, string, basenameObj->length, &tmp);
	TclDStringAppendDString(&template, &tmp);
	Tcl_DStringFree(&tmp);
    } else {
	TclDStringAppendLiteral(&template, "tcl");
    }

    TclDStringAppendLiteral(&template, "_XXXXXX");

#ifdef HAVE_MKSTEMPS
    if (extensionObj) {
	string = TclGetString(extensionObj);
	Tcl_UtfToExternalDString(NULL, string, extensionObj->length, &tmp);
	TclDStringAppendDString(&template, &tmp);
	fd = mkstemps(Tcl_DStringValue(&template), Tcl_DStringLength(&tmp));
	Tcl_DStringFree(&tmp);
    } else
#endif
    {
	fd = mkstemp(Tcl_DStringValue(&template));







>






|
|








|
|










|
|







2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
    Tcl_Obj *basenameObj,
    Tcl_Obj *extensionObj,
    Tcl_Obj *resultingNameObj)
{
    Tcl_DString template, tmp;
    const char *string;
    int fd;
    size_t length;

    /*
     * We should also check against making more then TMP_MAX of these.
     */

    if (dirObj) {
	string = TclGetStringFromObj(dirObj, &length);
	Tcl_UtfToExternalDString(NULL, string, length, &template);
    } else {
	Tcl_DStringInit(&template);
	Tcl_DStringAppend(&template, DefaultTempDir(), -1); /* INTL: native */
    }

    TclDStringAppendLiteral(&template, "/");

    if (basenameObj) {
	string = TclGetStringFromObj(basenameObj, &length);
	Tcl_UtfToExternalDString(NULL, string, length, &tmp);
	TclDStringAppendDString(&template, &tmp);
	Tcl_DStringFree(&tmp);
    } else {
	TclDStringAppendLiteral(&template, "tcl");
    }

    TclDStringAppendLiteral(&template, "_XXXXXX");

#ifdef HAVE_MKSTEMPS
    if (extensionObj) {
	string = TclGetStringFromObj(extensionObj, &length);
	Tcl_UtfToExternalDString(NULL, string, length, &tmp);
	TclDStringAppendDString(&template, &tmp);
	fd = mkstemps(Tcl_DStringValue(&template), Tcl_DStringLength(&tmp));
	Tcl_DStringFree(&tmp);
    } else
#endif
    {
	fd = mkstemp(Tcl_DStringValue(&template));
Changes to unix/tclUnixFile.c.
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
	size_t dirLength, nativeDirLen;
	int matchHidden, matchHiddenPat;
	Tcl_StatBuf statBuf;
	Tcl_DString ds;		/* native encoding of dir */
	Tcl_DString dsOrig;	/* utf-8 encoding of dir */

	Tcl_DStringInit(&dsOrig);
	dirName = TclGetString(fileNamePtr);
	dirLength = fileNamePtr->length;
	Tcl_DStringAppend(&dsOrig, dirName, dirLength);

	/*
	 * Make sure that the directory part of the name really is a
	 * directory. If the directory name is "", use the name "." instead,
	 * because some UNIX systems don't treat "" like "." automatically.
	 * Keep the "" for use in generating file names, otherwise "glob







|
<







265
266
267
268
269
270
271
272

273
274
275
276
277
278
279
	size_t dirLength, nativeDirLen;
	int matchHidden, matchHiddenPat;
	Tcl_StatBuf statBuf;
	Tcl_DString ds;		/* native encoding of dir */
	Tcl_DString dsOrig;	/* utf-8 encoding of dir */

	Tcl_DStringInit(&dsOrig);
	dirName = TclGetStringFromObj(fileNamePtr, &dirLength);

	Tcl_DStringAppend(&dsOrig, dirName, dirLength);

	/*
	 * Make sure that the directory part of the name really is a
	 * directory. If the directory name is "", use the name "." instead,
	 * because some UNIX systems don't treat "" like "." automatically.
	 * Keep the "" for use in generating file names, otherwise "glob
936
937
938
939
940
941
942

943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
	/*
	 * Check symbolic link flag first, since we prefer to create these.
	 */

	if (linkAction & TCL_CREATE_SYMBOLIC_LINK) {
	    Tcl_DString ds;
	    Tcl_Obj *transPtr;


	    /*
	     * Now we don't want to link to the absolute, normalized path.
	     * Relative links are quite acceptable (but links to ~user are not
	     * -- these must be expanded first).
	     */

	    transPtr = Tcl_FSGetTranslatedPath(NULL, toPtr);
	    if (transPtr == NULL) {
		return NULL;
	    }
	    target = TclGetString(transPtr);
	    target = Tcl_UtfToExternalDString(NULL, target, transPtr->length, &ds);
	    Tcl_DecrRefCount(transPtr);

	    if (symlink(target, src) != 0) {
		toPtr = NULL;
	    }
	    Tcl_DStringFree(&ds);
	} else if (linkAction & TCL_CREATE_HARD_LINK) {







>











|
|







935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
	/*
	 * Check symbolic link flag first, since we prefer to create these.
	 */

	if (linkAction & TCL_CREATE_SYMBOLIC_LINK) {
	    Tcl_DString ds;
	    Tcl_Obj *transPtr;
	    size_t length;

	    /*
	     * Now we don't want to link to the absolute, normalized path.
	     * Relative links are quite acceptable (but links to ~user are not
	     * -- these must be expanded first).
	     */

	    transPtr = Tcl_FSGetTranslatedPath(NULL, toPtr);
	    if (transPtr == NULL) {
		return NULL;
	    }
	    target = TclGetStringFromObj(transPtr, &length);
	    target = Tcl_UtfToExternalDString(NULL, target, length, &ds);
	    Tcl_DecrRefCount(transPtr);

	    if (symlink(target, src) != 0) {
		toPtr = NULL;
	    }
	    Tcl_DStringFree(&ds);
	} else if (linkAction & TCL_CREATE_HARD_LINK) {
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
	validPathPtr = Tcl_FSGetNormalizedPath(NULL, pathPtr);
	if (validPathPtr == NULL) {
	    return NULL;
	}
	Tcl_IncrRefCount(validPathPtr);
    }

    str = TclGetString(validPathPtr);
    len = validPathPtr->length;
    Tcl_UtfToExternalDString(NULL, str, len, &ds);
    len = Tcl_DStringLength(&ds) + sizeof(char);
    if (strlen(Tcl_DStringValue(&ds)) < len - sizeof(char)) {
	/* See bug [3118489]: NUL in filenames */
	Tcl_DecrRefCount(validPathPtr);
	Tcl_DStringFree(&ds);
	return NULL;







|
<







1101
1102
1103
1104
1105
1106
1107
1108

1109
1110
1111
1112
1113
1114
1115
	validPathPtr = Tcl_FSGetNormalizedPath(NULL, pathPtr);
	if (validPathPtr == NULL) {
	    return NULL;
	}
	Tcl_IncrRefCount(validPathPtr);
    }

    str = TclGetStringFromObj(validPathPtr, &len);

    Tcl_UtfToExternalDString(NULL, str, len, &ds);
    len = Tcl_DStringLength(&ds) + sizeof(char);
    if (strlen(Tcl_DStringValue(&ds)) < len - sizeof(char)) {
	/* See bug [3118489]: NUL in filenames */
	Tcl_DecrRefCount(validPathPtr);
	Tcl_DStringFree(&ds);
	return NULL;
Changes to unix/tclUnixInit.c.
451
452
453
454
455
456
457

458
459
460
461
462
463
464
    size_t *lengthPtr,
    Tcl_Encoding *encodingPtr)
{
#define LIBRARY_SIZE	    32
    Tcl_Obj *pathPtr, *objPtr;
    const char *str;
    Tcl_DString buffer;


    pathPtr = Tcl_NewObj();

    /*
     * Look for the library relative to the TCL_LIBRARY env variable. If the
     * last dirname in the TCL_LIBRARY path does not match the last dirname in
     * the installLib variable, use the last dir name of installLib in







>







451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
    size_t *lengthPtr,
    Tcl_Encoding *encodingPtr)
{
#define LIBRARY_SIZE	    32
    Tcl_Obj *pathPtr, *objPtr;
    const char *str;
    Tcl_DString buffer;
    size_t length;

    pathPtr = Tcl_NewObj();

    /*
     * Look for the library relative to the TCL_LIBRARY env variable. If the
     * last dirname in the TCL_LIBRARY path does not match the last dirname in
     * the installLib variable, use the last dir name of installLib in
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
	    objPtr = Tcl_NewStringObj(str, -1);
	    Tcl_ListObjAppendElement(NULL, pathPtr, objPtr);
	}
    }
    Tcl_DStringFree(&buffer);

    *encodingPtr = Tcl_GetEncoding(NULL, NULL);
    str = TclGetString(pathPtr);
    *lengthPtr = pathPtr->length;
    *valuePtr = Tcl_Alloc(*lengthPtr + 1);
    memcpy(*valuePtr, str, *lengthPtr + 1);
    Tcl_DecrRefCount(pathPtr);
}

/*
 *---------------------------------------------------------------------------







|
<







534
535
536
537
538
539
540
541

542
543
544
545
546
547
548
	    objPtr = Tcl_NewStringObj(str, -1);
	    Tcl_ListObjAppendElement(NULL, pathPtr, objPtr);
	}
    }
    Tcl_DStringFree(&buffer);

    *encodingPtr = Tcl_GetEncoding(NULL, NULL);
    str = TclGetStringFromObj(pathPtr, lengthPtr);

    *valuePtr = Tcl_Alloc(*lengthPtr + 1);
    memcpy(*valuePtr, str, *lengthPtr + 1);
    Tcl_DecrRefCount(pathPtr);
}

/*
 *---------------------------------------------------------------------------
Changes to unix/tclUnixPipe.c.
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
     * an error message.
     */

    TclpCloseFile(errPipeOut);
    errPipeOut = NULL;

    fd = GetFd(errPipeIn);
    count = read(fd, errSpace, (size_t) (sizeof(errSpace) - 1));
    if (count > 0) {
	char *end;

	errSpace[count] = 0;
	errno = strtol(errSpace, &end, 10);
	Tcl_SetObjResult(interp, Tcl_ObjPrintf("%s: %s",
		end, Tcl_PosixError(interp)));







|







520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
     * an error message.
     */

    TclpCloseFile(errPipeOut);
    errPipeOut = NULL;

    fd = GetFd(errPipeIn);
    count = read(fd, errSpace, sizeof(errSpace) - 1);
    if (count > 0) {
	char *end;

	errSpace[count] = 0;
	errno = strtol(errSpace, &end, 10);
	Tcl_SetObjResult(interp, Tcl_ObjPrintf("%s: %s",
		end, Tcl_PosixError(interp)));
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
    if (objc == 1) {
	Tcl_SetObjResult(interp, Tcl_NewWideIntObj(getpid()));
    } else {
	/*
	 * Get the channel and make sure that it refers to a pipe.
	 */

	chan = Tcl_GetChannel(interp, Tcl_GetString(objv[1]), NULL);
	if (chan == NULL) {
	    return TCL_ERROR;
	}
	if (Tcl_GetChannelType(chan) != &pipeChannelType) {
	    return TCL_OK;
	}








|







1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
    if (objc == 1) {
	Tcl_SetObjResult(interp, Tcl_NewWideIntObj(getpid()));
    } else {
	/*
	 * Get the channel and make sure that it refers to a pipe.
	 */

	chan = Tcl_GetChannel(interp, TclGetString(objv[1]), NULL);
	if (chan == NULL) {
	    return TCL_ERROR;
	}
	if (Tcl_GetChannelType(chan) != &pipeChannelType) {
	    return TCL_OK;
	}

Changes to unix/tclUnixPort.h.
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#ifdef HAVE_INTTYPES_H
#   include <inttypes.h>
#endif
#include <limits.h>
#ifdef HAVE_STDINT_H
#   include <stdint.h>
#endif
#ifdef HAVE_UNISTD_H
#   include <unistd.h>
#else
#   include "../compat/unistd.h"
#endif

MODULE_SCOPE int TclUnixSetBlockingMode(int fd, int mode);

#include <utime.h>

/*
 *---------------------------------------------------------------------------







<
|
<
<
<







152
153
154
155
156
157
158

159



160
161
162
163
164
165
166
#ifdef HAVE_INTTYPES_H
#   include <inttypes.h>
#endif
#include <limits.h>
#ifdef HAVE_STDINT_H
#   include <stdint.h>
#endif

#include <unistd.h>




MODULE_SCOPE int TclUnixSetBlockingMode(int fd, int mode);

#include <utime.h>

/*
 *---------------------------------------------------------------------------
Changes to unix/tclUnixSock.c.
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
	     */

	    char *dot = strchr(u.nodename, '.');

	    if (dot != NULL) {
		char *node = Tcl_Alloc(dot - u.nodename + 1);

		memcpy(node, u.nodename, (size_t) (dot - u.nodename));
		node[dot - u.nodename] = '\0';
		hp = TclpGetHostByName(node);
		Tcl_Free(node);
	    }
	}
        if (hp != NULL) {
	    native = hp->h_name;







|







237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
	     */

	    char *dot = strchr(u.nodename, '.');

	    if (dot != NULL) {
		char *node = Tcl_Alloc(dot - u.nodename + 1);

		memcpy(node, u.nodename, dot - u.nodename);
		node[dot - u.nodename] = '\0';
		hp = TclpGetHostByName(node);
		Tcl_Free(node);
	    }
	}
        if (hp != NULL) {
	    native = hp->h_name;
309
310
311
312
313
314
315
316

317
318
319
320
321
322
323
 *
 * ----------------------------------------------------------------------
 */

const char *
Tcl_GetHostName(void)
{
    return Tcl_GetString(TclGetProcessGlobalValue(&hostName));

}

/*
 * ----------------------------------------------------------------------
 *
 * TclpHasSockets --
 *







|
>







309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
 *
 * ----------------------------------------------------------------------
 */

const char *
Tcl_GetHostName(void)
{
    Tcl_Obj *tclObj = TclGetProcessGlobalValue(&hostName);
    return TclGetString(tclObj);
}

/*
 * ----------------------------------------------------------------------
 *
 * TclpHasSockets --
 *
Changes to win/Makefile.in.
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
TEST_DLL_FILE		= tcltest$(VER)${DLLSUFFIX}
TEST_EXE_FILE		= tcltest${EXESUFFIX}
TEST_LIB_FILE		= @LIBPREFIX@tcltest$(VER)${LIBSUFFIX}
TEST_LOAD_PRMS		= lappend ::auto_path {$(ROOT_DIR_WIN_NATIVE)/tests};\
			  package ifneeded dde 1.4.1 [list load [file normalize ${DDE_DLL_FILE}] dde];\
			  package ifneeded registry 1.3.3 [list load [file normalize ${REG_DLL_FILE}] registry]
TEST_LOAD_FACILITIES	= package ifneeded Tcltest ${VERSION}@TCL_PATCH_LEVEL@ [list load [file normalize ${TEST_DLL_FILE}] Tcltest];\
			  $(TEST_LOAD_PRMS)			  
ZLIB_DLL_FILE		= zlib1.dll

SHARED_LIBRARIES 	= $(TCL_DLL_FILE) @ZLIB_DLL_FILE@
STATIC_LIBRARIES	= $(TCL_LIB_FILE)

TCLSH			= tclsh$(VER)${EXESUFFIX}
WINE			= @WINE@







|







153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
TEST_DLL_FILE		= tcltest$(VER)${DLLSUFFIX}
TEST_EXE_FILE		= tcltest${EXESUFFIX}
TEST_LIB_FILE		= @LIBPREFIX@tcltest$(VER)${LIBSUFFIX}
TEST_LOAD_PRMS		= lappend ::auto_path {$(ROOT_DIR_WIN_NATIVE)/tests};\
			  package ifneeded dde 1.4.1 [list load [file normalize ${DDE_DLL_FILE}] dde];\
			  package ifneeded registry 1.3.3 [list load [file normalize ${REG_DLL_FILE}] registry]
TEST_LOAD_FACILITIES	= package ifneeded Tcltest ${VERSION}@TCL_PATCH_LEVEL@ [list load [file normalize ${TEST_DLL_FILE}] Tcltest];\
			  $(TEST_LOAD_PRMS)
ZLIB_DLL_FILE		= zlib1.dll

SHARED_LIBRARIES 	= $(TCL_DLL_FILE) @ZLIB_DLL_FILE@
STATIC_LIBRARIES	= $(TCL_LIB_FILE)

TCLSH			= tclsh$(VER)${EXESUFFIX}
WINE			= @WINE@
204
205
206
207
208
209
210

211
212
213
214
215
216
217
LIBS		= @LIBS@ $(shell $(CYGPATH) '@ZLIB_LIBS@')

RMDIR		= rm -rf
MKDIR		= mkdir -p
SHELL		= @SHELL@
RM		= rm -f
COPY		= cp


###
# Tip 430 - ZipFS Modifications
###

TCL_ZIP_FILE		= @TCL_ZIP_FILE@
TCL_VFS_PATH		= libtcl.vfs/tcl_library







>







204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
LIBS		= @LIBS@ $(shell $(CYGPATH) '@ZLIB_LIBS@')

RMDIR		= rm -rf
MKDIR		= mkdir -p
SHELL		= @SHELL@
RM		= rm -f
COPY		= cp
LN		= ln

###
# Tip 430 - ZipFS Modifications
###

TCL_ZIP_FILE		= @TCL_ZIP_FILE@
TCL_VFS_PATH		= libtcl.vfs/tcl_library
413
414
415
416
417
418
419




420
421
422
423
424
425
426
	bn_mp_set_long.${OBJEXT} \
	bn_mp_set_long_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_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} \







>
>
>
>







414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
	bn_mp_set_long.${OBJEXT} \
	bn_mp_set_long_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_tc_and.${OBJEXT} \
	bn_mp_tc_div_2d.${OBJEXT} \
	bn_mp_tc_or.${OBJEXT} \
	bn_mp_tc_xor.${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} \
514
515
516
517
518
519
520
521
522











523
524
525
526

527
528
529
530

531
532
533
534
535
536
537
libraries:

doc:

tclzipfile: ${TCL_ZIP_FILE}

${TCL_ZIP_FILE}:  ${ZIP_INSTALL_OBJS} ${DDE_DLL_FILE} ${REG_DLL_FILE}
	rm -rf ${TCL_VFS_ROOT}
	mkdir -p ${TCL_VFS_PATH}











	$(COPY) -a $(TOP_DIR)/library/* ${TCL_VFS_PATH}
	$(COPY) -a ${TCL_VFS_PATH}/manifest.txt ${TCL_VFS_PATH}/pkgIndex.tcl
	$(COPY) ${DDE_DLL_FILE} ${TCL_VFS_PATH}/dde
	$(COPY) ${REG_DLL_FILE} ${TCL_VFS_PATH}/reg

	(zip=`(realpath '${NATIVE_ZIP}' || readlink -m '${NATIVE_ZIP}') 2>/dev/null || \
	  (echo '${NATIVE_ZIP}' | sed "s?^\./?$$(pwd)/?")`; \
	  cd ${TCL_VFS_ROOT} && \
	  $$zip ${ZIP_PROG_OPTIONS} ../${TCL_ZIP_FILE} ${ZIP_PROG_VFSSEARCH} && \

	  cd ..)

$(TCLSH): $(TCLSH_OBJS) @LIBRARIES@ $(TCL_STUB_LIB_FILE) tclsh.$(RES)
	$(CC) $(CFLAGS) $(TCLSH_OBJS) $(TCL_LIB_FILE) $(TCL_STUB_LIB_FILE) $(LIBS) \
	tclsh.$(RES) $(CC_EXENAME) $(LDFLAGS_CONSOLE)
	@VC_MANIFEST_EMBED_EXE@








|
|
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
>



|
>







519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
libraries:

doc:

tclzipfile: ${TCL_ZIP_FILE}

${TCL_ZIP_FILE}:  ${ZIP_INSTALL_OBJS} ${DDE_DLL_FILE} ${REG_DLL_FILE}
	@rm -rf ${TCL_VFS_ROOT}
	@mkdir -p ${TCL_VFS_PATH}
	@echo "creating ${TCL_VFS_PATH} (prepare compression)"
	@( \
	  $(LN) $$(find $(TOP_DIR)/library/* -maxdepth 0 -type f) ${TCL_VFS_PATH}/ && \
	  (for D in $$(find $(TOP_DIR)/library/* -maxdepth 0 -type d); do \
	    mkdir -p "${TCL_VFS_PATH}/$$(basename $$D)"; \
	    $(LN) -s $$D/* ${TCL_VFS_PATH}/$$(basename $$D)/; \
	  done) && \
	  $(LN) ${TCL_VFS_PATH}/manifest.txt ${TCL_VFS_PATH}/pkgIndex.tcl && \
	  $(LN) ${DDE_DLL_FILE} ${TCL_VFS_PATH}/dde/ && \
	  $(LN) ${REG_DLL_FILE} ${TCL_VFS_PATH}/reg/ \
	) || ( \
	  $(COPY) -a $(TOP_DIR)/library/* ${TCL_VFS_PATH}; \
	  $(COPY) -a ${TCL_VFS_PATH}/manifest.txt ${TCL_VFS_PATH}/pkgIndex.tcl; \
	  $(COPY) ${DDE_DLL_FILE} ${TCL_VFS_PATH}/dde; \
	  $(COPY) ${REG_DLL_FILE} ${TCL_VFS_PATH}/reg; \
	)
	(zip=`(realpath '${NATIVE_ZIP}' || readlink -m '${NATIVE_ZIP}') 2>/dev/null || \
	  (echo '${NATIVE_ZIP}' | sed "s?^\./?$$(pwd)/?")`; \
	  cd ${TCL_VFS_ROOT} && \
	  $$zip ${ZIP_PROG_OPTIONS} ../${TCL_ZIP_FILE} ${ZIP_PROG_VFSSEARCH} >/dev/null && \
	  echo "${TCL_ZIP_FILE} successful created with $$zip" && \
	  cd ..)

$(TCLSH): $(TCLSH_OBJS) @LIBRARIES@ $(TCL_STUB_LIB_FILE) tclsh.$(RES)
	$(CC) $(CFLAGS) $(TCLSH_OBJS) $(TCL_LIB_FILE) $(TCL_STUB_LIB_FILE) $(LIBS) \
	tclsh.$(RES) $(CC_EXENAME) $(LDFLAGS_CONSOLE)
	@VC_MANIFEST_EMBED_EXE@

Changes to win/configure.
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
fi

    if test -f "$ac_cv_path_zip" ; then
        ZIP_PROG="$ac_cv_path_zip"
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIP_PROG" >&5
$as_echo "$ZIP_PROG" >&6; }
        ZIP_PROG_OPTIONS="-rq"
        ZIP_PROG_VFSSEARCH="."
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: Found INFO Zip in environment" >&5
$as_echo "Found INFO Zip in environment" >&6; }
        # Use standard arguments for zip
    else
        # It is not an error if an installed version of Zip can't be located.
        # We can use the locally distributed minizip instead
        ZIP_PROG="./minizip${EXEEXT_FOR_BUILD}"
        ZIP_PROG_OPTIONS="-o -r"
        ZIP_PROG_VFSSEARCH="."
        ZIP_INSTALL_OBJS="minizip${EXEEXT_FOR_BUILD}"
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: No zip found on PATH building minizip" >&5
$as_echo "No zip found on PATH building minizip" >&6; }
    fi










|








|







4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
fi

    if test -f "$ac_cv_path_zip" ; then
        ZIP_PROG="$ac_cv_path_zip"
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIP_PROG" >&5
$as_echo "$ZIP_PROG" >&6; }
        ZIP_PROG_OPTIONS="-rq"
        ZIP_PROG_VFSSEARCH="*"
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: Found INFO Zip in environment" >&5
$as_echo "Found INFO Zip in environment" >&6; }
        # Use standard arguments for zip
    else
        # It is not an error if an installed version of Zip can't be located.
        # We can use the locally distributed minizip instead
        ZIP_PROG="./minizip${EXEEXT_FOR_BUILD}"
        ZIP_PROG_OPTIONS="-o -r"
        ZIP_PROG_VFSSEARCH="*"
        ZIP_INSTALL_OBJS="minizip${EXEEXT_FOR_BUILD}"
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: No zip found on PATH building minizip" >&5
$as_echo "No zip found on PATH building minizip" >&6; }
    fi



Changes to win/makefile.vc.
306
307
308
309
310
311
312




313
314
315
316
317
318
319
	$(TMP_DIR)\bn_mp_set_long.obj \
	$(TMP_DIR)\bn_mp_set_long_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_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 \







>
>
>
>







306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
	$(TMP_DIR)\bn_mp_set_long.obj \
	$(TMP_DIR)\bn_mp_set_long_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_tc_and.obj \
	$(TMP_DIR)\bn_mp_tc_div_2d.obj \
	$(TMP_DIR)\bn_mp_tc_or.obj \
	$(TMP_DIR)\bn_mp_tc_xor.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 \
Changes to win/tcl.dsp.
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215

SOURCE=..\compat\strtoul.c
# End Source File
# Begin Source File

SOURCE=..\compat\tclErrno.h
# End Source File
# Begin Source File

SOURCE=..\compat\unistd.h
# End Source File
# Begin Source File

SOURCE=..\compat\waitpid.c
# End Source File
# End Group
# Begin Group "doc"








<
<
<
<







198
199
200
201
202
203
204




205
206
207
208
209
210
211

SOURCE=..\compat\strtoul.c
# End Source File
# Begin Source File

SOURCE=..\compat\tclErrno.h
# End Source File




# Begin Source File

SOURCE=..\compat\waitpid.c
# End Source File
# End Group
# Begin Group "doc"

Changes to win/tcl.m4.
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
        done
    done
    ])
    if test -f "$ac_cv_path_zip" ; then
        ZIP_PROG="$ac_cv_path_zip"
        AC_MSG_RESULT([$ZIP_PROG])
        ZIP_PROG_OPTIONS="-rq"
        ZIP_PROG_VFSSEARCH="."
        AC_MSG_RESULT([Found INFO Zip in environment])
        # Use standard arguments for zip
    else
        # It is not an error if an installed version of Zip can't be located.
        # We can use the locally distributed minizip instead
        ZIP_PROG="./minizip${EXEEXT_FOR_BUILD}"
        ZIP_PROG_OPTIONS="-o -r"
        ZIP_PROG_VFSSEARCH="."
        ZIP_INSTALL_OBJS="minizip${EXEEXT_FOR_BUILD}"
        AC_MSG_RESULT([No zip found on PATH building minizip])
    fi
    AC_SUBST(ZIP_PROG)
    AC_SUBST(ZIP_PROG_OPTIONS)
    AC_SUBST(ZIP_PROG_VFSSEARCH)
    AC_SUBST(ZIP_INSTALL_OBJS)







|







|







1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
        done
    done
    ])
    if test -f "$ac_cv_path_zip" ; then
        ZIP_PROG="$ac_cv_path_zip"
        AC_MSG_RESULT([$ZIP_PROG])
        ZIP_PROG_OPTIONS="-rq"
        ZIP_PROG_VFSSEARCH="*"
        AC_MSG_RESULT([Found INFO Zip in environment])
        # Use standard arguments for zip
    else
        # It is not an error if an installed version of Zip can't be located.
        # We can use the locally distributed minizip instead
        ZIP_PROG="./minizip${EXEEXT_FOR_BUILD}"
        ZIP_PROG_OPTIONS="-o -r"
        ZIP_PROG_VFSSEARCH="*"
        ZIP_INSTALL_OBJS="minizip${EXEEXT_FOR_BUILD}"
        AC_MSG_RESULT([No zip found on PATH building minizip])
    fi
    AC_SUBST(ZIP_PROG)
    AC_SUBST(ZIP_PROG_OPTIONS)
    AC_SUBST(ZIP_PROG_VFSSEARCH)
    AC_SUBST(ZIP_INSTALL_OBJS)
Changes to win/tclWinFCmd.c.
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922

    normSrcPtr = Tcl_FSGetNormalizedPath(NULL,srcPathPtr);
    normDestPtr = Tcl_FSGetNormalizedPath(NULL,destPathPtr);
    if ((normSrcPtr == NULL) || (normDestPtr == NULL)) {
	return TCL_ERROR;
    }

    Tcl_WinUtfToTChar(Tcl_GetString(normSrcPtr), -1, &srcString);
    Tcl_WinUtfToTChar(Tcl_GetString(normDestPtr), -1, &dstString);

    ret = TraverseWinTree(TraversalCopy, &srcString, &dstString, &ds);

    Tcl_DStringFree(&srcString);
    Tcl_DStringFree(&dstString);

    if (ret != TCL_OK) {







|
|







907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922

    normSrcPtr = Tcl_FSGetNormalizedPath(NULL,srcPathPtr);
    normDestPtr = Tcl_FSGetNormalizedPath(NULL,destPathPtr);
    if ((normSrcPtr == NULL) || (normDestPtr == NULL)) {
	return TCL_ERROR;
    }

    Tcl_WinUtfToTChar(TclGetString(normSrcPtr), -1, &srcString);
    Tcl_WinUtfToTChar(TclGetString(normDestPtr), -1, &dstString);

    ret = TraverseWinTree(TraversalCopy, &srcString, &dstString, &ds);

    Tcl_DStringFree(&srcString);
    Tcl_DStringFree(&dstString);

    if (ret != TCL_OK) {
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
	 */

	Tcl_DString native;
	normPtr = Tcl_FSGetNormalizedPath(NULL, pathPtr);
	if (normPtr == NULL) {
	    return TCL_ERROR;
	}
	Tcl_WinUtfToTChar(Tcl_GetString(normPtr), -1, &native);
	ret = DoRemoveDirectory(&native, recursive, &ds);
	Tcl_DStringFree(&native);
    } else {
	ret = DoRemoveJustDirectory(Tcl_FSGetNativePath(pathPtr), 0, &ds);
    }

    if (ret != TCL_OK) {







|







980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
	 */

	Tcl_DString native;
	normPtr = Tcl_FSGetNormalizedPath(NULL, pathPtr);
	if (normPtr == NULL) {
	    return TCL_ERROR;
	}
	Tcl_WinUtfToTChar(TclGetString(normPtr), -1, &native);
	ret = DoRemoveDirectory(&native, recursive, &ds);
	Tcl_DStringFree(&native);
    } else {
	ret = DoRemoveJustDirectory(Tcl_FSGetNativePath(pathPtr), 0, &ds);
    }

    if (ret != TCL_OK) {
1520
1521
1522
1523
1524
1525
1526

1527
1528
1529
1530
1531
1532
1533
1534
1535
	 * It is hidden. However there is a bug on some Windows OSes in which
	 * root volumes (drives) formatted as NTFS are declared hidden when
	 * they are not (and cannot be).
	 *
	 * We test for, and fix that case, here.
	 */


	const char *str = TclGetString(fileName);
	size_t len = fileName->length;

	if (len < 4) {
	    if (len == 0) {
		/*
		 * Not sure if this is possible, but we pass it on anyway.
		 */
	    } else if (len == 1 && (str[0] == '/' || str[0] == '\\')) {







>
|
<







1520
1521
1522
1523
1524
1525
1526
1527
1528

1529
1530
1531
1532
1533
1534
1535
	 * It is hidden. However there is a bug on some Windows OSes in which
	 * root volumes (drives) formatted as NTFS are declared hidden when
	 * they are not (and cannot be).
	 *
	 * We test for, and fix that case, here.
	 */

	size_t len;
	const char *str = TclGetStringFromObj(fileName, &len);


	if (len < 4) {
	    if (len == 0) {
		/*
		 * Not sure if this is possible, but we pass it on anyway.
		 */
	    } else if (len == 1 && (str[0] == '/' || str[0] == '\\')) {
1582
1583
1584
1585
1586
1587
1588

1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
    int objIndex,		/* The index of the attribute. */
    Tcl_Obj *fileName,		/* The name of the file. */
    int longShort,		/* 0 to short name, 1 to long name. */
    Tcl_Obj **attributePtrPtr)	/* A pointer to return the object with. */
{
    int pathc, i;
    Tcl_Obj *splitPath;


    splitPath = Tcl_FSSplitPath(fileName, &pathc);

    if (splitPath == NULL || pathc == 0) {
	if (interp != NULL) {
	    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		    "could not read \"%s\": no such file or directory",
		    Tcl_GetString(fileName)));
	    errno = ENOENT;
	    Tcl_PosixError(interp);
	}
	goto cleanup;
    }

    /*
     * We will decrement this again at the end.	 It is safer to do this in
     * case any of the calls below retain a reference to splitPath.
     */

    Tcl_IncrRefCount(splitPath);

    for (i = 0; i < pathc; i++) {
	Tcl_Obj *elt;
	char *pathv;

	Tcl_ListObjIndex(NULL, splitPath, i, &elt);

	pathv = TclGetString(elt);
	if ((pathv[0] == '/') || ((elt->length == 3) && (pathv[1] == ':'))
		|| (strcmp(pathv, ".") == 0) || (strcmp(pathv, "..") == 0)) {
	    /*
	     * Handle "/", "//machine/export", "c:/", "." or ".." by just
	     * copying the string literally.  Uppercase the drive letter, just
	     * because it looks better under Windows to do so.
	     */








>







|



















|
|







1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
    int objIndex,		/* The index of the attribute. */
    Tcl_Obj *fileName,		/* The name of the file. */
    int longShort,		/* 0 to short name, 1 to long name. */
    Tcl_Obj **attributePtrPtr)	/* A pointer to return the object with. */
{
    int pathc, i;
    Tcl_Obj *splitPath;
	size_t length;

    splitPath = Tcl_FSSplitPath(fileName, &pathc);

    if (splitPath == NULL || pathc == 0) {
	if (interp != NULL) {
	    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		    "could not read \"%s\": no such file or directory",
		    TclGetString(fileName)));
	    errno = ENOENT;
	    Tcl_PosixError(interp);
	}
	goto cleanup;
    }

    /*
     * We will decrement this again at the end.	 It is safer to do this in
     * case any of the calls below retain a reference to splitPath.
     */

    Tcl_IncrRefCount(splitPath);

    for (i = 0; i < pathc; i++) {
	Tcl_Obj *elt;
	char *pathv;

	Tcl_ListObjIndex(NULL, splitPath, i, &elt);

	pathv = TclGetStringFromObj(elt, &length);
	if ((pathv[0] == '/') || ((length == 3) && (pathv[1] == ':'))
		|| (strcmp(pathv, ".") == 0) || (strcmp(pathv, "..") == 0)) {
	    /*
	     * Handle "/", "//machine/export", "c:/", "." or ".." by just
	     * copying the string literally.  Uppercase the drive letter, just
	     * because it looks better under Windows to do so.
	     */

1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
	    Tcl_IncrRefCount(tempPath);

	    /*
	     * We'd like to call Tcl_FSGetNativePath(tempPath) but that is
	     * likely to lead to infinite loops.
	     */

	    tempString = TclGetString(tempPath);
	    nativeName = Tcl_WinUtfToTChar(tempString, tempPath->length, &ds);
	    Tcl_DecrRefCount(tempPath);
	    handle = FindFirstFile(nativeName, &data);
	    if (handle == INVALID_HANDLE_VALUE) {
		/*
		 * FindFirstFile() doesn't like root directories. We would
		 * only get a root directory here if the caller specified "c:"
		 * or "c:." and the current directory on the drive was the







|
|







1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
	    Tcl_IncrRefCount(tempPath);

	    /*
	     * We'd like to call Tcl_FSGetNativePath(tempPath) but that is
	     * likely to lead to infinite loops.
	     */

	    tempString = TclGetStringFromObj(tempPath, &length);
	    nativeName = Tcl_WinUtfToTChar(tempString, length, &ds);
	    Tcl_DecrRefCount(tempPath);
	    handle = FindFirstFile(nativeName, &data);
	    if (handle == INVALID_HANDLE_VALUE) {
		/*
		 * FindFirstFile() doesn't like root directories. We would
		 * only get a root directory here if the caller specified "c:"
		 * or "c:." and the current directory on the drive was the
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
    Tcl_Interp *interp,		/* The interp we are using for errors. */
    int objIndex,		/* The index of the attribute. */
    Tcl_Obj *fileName,		/* The name of the file. */
    Tcl_Obj *attributePtr)	/* The new value of the attribute. */
{
    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
	    "cannot set attribute \"%s\" for file \"%s\": attribute is readonly",
	    tclpFileAttrStrings[objIndex], Tcl_GetString(fileName)));
    errno = EINVAL;
    Tcl_PosixError(interp);
    return TCL_ERROR;
}

/*
 *---------------------------------------------------------------------------







|







1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
    Tcl_Interp *interp,		/* The interp we are using for errors. */
    int objIndex,		/* The index of the attribute. */
    Tcl_Obj *fileName,		/* The name of the file. */
    Tcl_Obj *attributePtr)	/* The new value of the attribute. */
{
    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
	    "cannot set attribute \"%s\" for file \"%s\": attribute is readonly",
	    tclpFileAttrStrings[objIndex], TclGetString(fileName)));
    errno = EINVAL;
    Tcl_PosixError(interp);
    return TCL_ERROR;
}

/*
 *---------------------------------------------------------------------------
Changes to win/tclWinFile.c.
909
910
911
912
913
914
915

916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
	if (norm != NULL) {
	    /*
	     * Match a single file directly.
	     */

	    DWORD attr;
	    WIN32_FILE_ATTRIBUTE_DATA data;

	    const char *str = TclGetString(norm);

	    native = Tcl_FSGetNativePath(pathPtr);

	    if (GetFileAttributesEx(native,
		    GetFileExInfoStandard, &data) != TRUE) {
		return TCL_OK;
	    }
	    attr = data.dwFileAttributes;

	    if (NativeMatchType(WinIsDrive(str,norm->length), attr, native, types)) {
		Tcl_ListObjAppendElement(interp, resultPtr, pathPtr);
	    }
	}
	return TCL_OK;
    } else {
	DWORD attr;
	HANDLE handle;







>
|









|







909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
	if (norm != NULL) {
	    /*
	     * Match a single file directly.
	     */

	    DWORD attr;
	    WIN32_FILE_ATTRIBUTE_DATA data;
	    size_t length;
	    const char *str = TclGetStringFromObj(norm, &length);

	    native = Tcl_FSGetNativePath(pathPtr);

	    if (GetFileAttributesEx(native,
		    GetFileExInfoStandard, &data) != TRUE) {
		return TCL_OK;
	    }
	    attr = data.dwFileAttributes;

	    if (NativeMatchType(WinIsDrive(str, length), attr, native, types)) {
		Tcl_ListObjAppendElement(interp, resultPtr, pathPtr);
	    }
	}
	return TCL_OK;
    } else {
	DWORD attr;
	HANDLE handle;
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984

	/*
	 * Build up the directory name for searching, including a trailing
	 * directory separator.
	 */

	Tcl_DStringInit(&dsOrig);
	dirName = TclGetString(fileNamePtr);
	dirLength = fileNamePtr->length;
	Tcl_DStringAppend(&dsOrig, dirName, dirLength);

	lastChar = dirName[dirLength -1];
	if ((lastChar != '\\') && (lastChar != '/') && (lastChar != ':')) {
	    TclDStringAppendLiteral(&dsOrig, "/");
	    dirLength++;
	}







|
<







970
971
972
973
974
975
976
977

978
979
980
981
982
983
984

	/*
	 * Build up the directory name for searching, including a trailing
	 * directory separator.
	 */

	Tcl_DStringInit(&dsOrig);
	dirName = TclGetStringFromObj(fileNamePtr, &dirLength);

	Tcl_DStringAppend(&dsOrig, dirName, dirLength);

	lastChar = dirName[dirLength -1];
	if ((lastChar != '\\') && (lastChar != '/') && (lastChar != ':')) {
	    TclDStringAppendLiteral(&dsOrig, "/");
	    dirLength++;
	}
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
    char *firstSeparator;
    const char *path;
    Tcl_Obj *normPath = Tcl_FSGetNormalizedPath(NULL, pathPtr);

    if (normPath == NULL) {
	return NULL;
    }
    path = Tcl_GetString(normPath);
    if (path == NULL) {
	return NULL;
    }

    firstSeparator = strchr(path, '/');
    if (firstSeparator == NULL) {
	found = GetVolumeInformation(Tcl_FSGetNativePath(pathPtr),







|







2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
    char *firstSeparator;
    const char *path;
    Tcl_Obj *normPath = Tcl_FSGetNormalizedPath(NULL, pathPtr);

    if (normPath == NULL) {
	return NULL;
    }
    path = TclGetString(normPath);
    if (path == NULL) {
	return NULL;
    }

    firstSeparator = strchr(path, '/');
    if (firstSeparator == NULL) {
	found = GetVolumeInformation(Tcl_FSGetNativePath(pathPtr),
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
    Tcl_DString dsNorm;		/* This will hold the normalized string. */
    char *path, *currentPathEndPosition;
    Tcl_Obj *temp = NULL;
    int isDrive = 1;
    Tcl_DString ds;		/* Some workspace. */

    Tcl_DStringInit(&dsNorm);
    path = Tcl_GetString(pathPtr);

    currentPathEndPosition = path + nextCheckpoint;
    if (*currentPathEndPosition == '/') {
	currentPathEndPosition++;
    }
    while (1) {
	char cur = *currentPathEndPosition;







|







2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
    Tcl_DString dsNorm;		/* This will hold the normalized string. */
    char *path, *currentPathEndPosition;
    Tcl_Obj *temp = NULL;
    int isDrive = 1;
    Tcl_DString ds;		/* Some workspace. */

    Tcl_DStringInit(&dsNorm);
    path = TclGetString(pathPtr);

    currentPathEndPosition = path + nextCheckpoint;
    if (*currentPathEndPosition == '/') {
	currentPathEndPosition++;
    }
    while (1) {
	char cur = *currentPathEndPosition;
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
		    nextCheckpoint = 0;
		    Tcl_AppendToObj(to, currentPathEndPosition, -1);

		    /*
		     * Convert link to forward slashes.
		     */

		    for (path = Tcl_GetString(to); *path != 0; path++) {
			if (*path == '\\') {
			    *path = '/';
			}
		    }
		    path = Tcl_GetString(to);
		    currentPathEndPosition = path + nextCheckpoint;
		    if (temp != NULL) {
			Tcl_DecrRefCount(temp);
		    }
		    temp = to;

		    /*







|




|







2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
		    nextCheckpoint = 0;
		    Tcl_AppendToObj(to, currentPathEndPosition, -1);

		    /*
		     * Convert link to forward slashes.
		     */

		    for (path = TclGetString(to); *path != 0; path++) {
			if (*path == '\\') {
			    *path = '/';
			}
		    }
		    path = TclGetString(to);
		    currentPathEndPosition = path + nextCheckpoint;
		    if (temp != NULL) {
			Tcl_DecrRefCount(temp);
		    }
		    temp = to;

		    /*
2730
2731
2732
2733
2734
2735
2736

2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
	if (*lastValidPathEnd != 0) {
	    /*
	     * Not the end of the string.
	     */

	    char *path;
	    Tcl_Obj *tmpPathPtr;


	    tmpPathPtr = Tcl_NewStringObj(Tcl_DStringValue(&ds),
		    nextCheckpoint);
	    Tcl_AppendToObj(tmpPathPtr, lastValidPathEnd, -1);
	    path = TclGetString(tmpPathPtr);
	    Tcl_SetStringObj(pathPtr, path, tmpPathPtr->length);
	    Tcl_DecrRefCount(tmpPathPtr);
	} else {
	    /*
	     * End of string was reached above.
	     */

	    Tcl_SetStringObj(pathPtr, Tcl_DStringValue(&ds), nextCheckpoint);







>




|
|







2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
	if (*lastValidPathEnd != 0) {
	    /*
	     * Not the end of the string.
	     */

	    char *path;
	    Tcl_Obj *tmpPathPtr;
	    size_t length;

	    tmpPathPtr = Tcl_NewStringObj(Tcl_DStringValue(&ds),
		    nextCheckpoint);
	    Tcl_AppendToObj(tmpPathPtr, lastValidPathEnd, -1);
	    path = TclGetStringFromObj(tmpPathPtr, &length);
	    Tcl_SetStringObj(pathPtr, path, length);
	    Tcl_DecrRefCount(tmpPathPtr);
	} else {
	    /*
	     * End of string was reached above.
	     */

	    Tcl_SetStringObj(pathPtr, Tcl_DStringValue(&ds), nextCheckpoint);
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824

2825
2826
2827
2828
2829
2830
2831
2832
2833

    if (path[0] == '/') {
	/*
	 * Path of form /foo/bar which is a path in the root directory of the
	 * current volume.
	 */

	const char *drive = Tcl_GetString(useThisCwd);

	absolutePath = Tcl_NewStringObj(drive,2);
	Tcl_AppendToObj(absolutePath, path, -1);
	Tcl_IncrRefCount(absolutePath);

	/*
	 * We have a refCount on the cwd.
	 */
    } else {
	/*
	 * Path of form C:foo/bar, but this only makes sense if the cwd is
	 * also on drive C.
	 */


	const char *drive = TclGetString(useThisCwd);
	size_t cwdLen = useThisCwd->length;
	char drive_cur = path[0];

	if (drive_cur >= 'a') {
	    drive_cur -= ('a' - 'A');
	}
	if (drive[0] == drive_cur) {
	    absolutePath = Tcl_DuplicateObj(useThisCwd);







|














>
|
<







2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827

2828
2829
2830
2831
2832
2833
2834

    if (path[0] == '/') {
	/*
	 * Path of form /foo/bar which is a path in the root directory of the
	 * current volume.
	 */

	const char *drive = TclGetString(useThisCwd);

	absolutePath = Tcl_NewStringObj(drive,2);
	Tcl_AppendToObj(absolutePath, path, -1);
	Tcl_IncrRefCount(absolutePath);

	/*
	 * We have a refCount on the cwd.
	 */
    } else {
	/*
	 * Path of form C:foo/bar, but this only makes sense if the cwd is
	 * also on drive C.
	 */

	size_t cwdLen;
	const char *drive = TclGetStringFromObj(useThisCwd, &cwdLen);

	char drive_cur = path[0];

	if (drive_cur >= 'a') {
	    drive_cur -= ('a' - 'A');
	}
	if (drive[0] == drive_cur) {
	    absolutePath = Tcl_DuplicateObj(useThisCwd);
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
	if (validPathPtr == NULL) {
	    return NULL;
	}
	/* validPathPtr returned from Tcl_FSGetNormalizedPath is owned by Tcl, so incr refCount here */
	Tcl_IncrRefCount(validPathPtr);
    }

    str = Tcl_GetString(validPathPtr);
    len = validPathPtr->length;

    if (strlen(str)!=(unsigned int)len) {
	/* String contains NUL-bytes. This is invalid. */
	goto done;
    }
    /* For a reserved device, strip a possible postfix ':' */
    len = WinIsReserved(str);
    if (len == 0) {
	/* Let MultiByteToWideChar check for other invalid sequences, like







<
|

|







2983
2984
2985
2986
2987
2988
2989

2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
	if (validPathPtr == NULL) {
	    return NULL;
	}
	/* validPathPtr returned from Tcl_FSGetNormalizedPath is owned by Tcl, so incr refCount here */
	Tcl_IncrRefCount(validPathPtr);
    }


    str = TclGetStringFromObj(validPathPtr, &len);

    if (strlen(str) != len) {
	/* String contains NUL-bytes. This is invalid. */
	goto done;
    }
    /* For a reserved device, strip a possible postfix ':' */
    len = WinIsReserved(str);
    if (len == 0) {
	/* Let MultiByteToWideChar check for other invalid sequences, like
Changes to win/tclWinInit.c.
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
     * Look for the library in its source checkout location.
     */

    Tcl_ListObjAppendElement(NULL, pathPtr,
	    TclGetProcessGlobalValue(&sourceLibraryDir));

    *encodingPtr = NULL;
    bytes = TclGetString(pathPtr);
    *lengthPtr = pathPtr->length;
    *valuePtr = Tcl_Alloc(*lengthPtr + 1);
    memcpy(*valuePtr, bytes, *lengthPtr + 1);
    Tcl_DecrRefCount(pathPtr);
}

/*
 *---------------------------------------------------------------------------







|
<







219
220
221
222
223
224
225
226

227
228
229
230
231
232
233
     * Look for the library in its source checkout location.
     */

    Tcl_ListObjAppendElement(NULL, pathPtr,
	    TclGetProcessGlobalValue(&sourceLibraryDir));

    *encodingPtr = NULL;
    bytes = TclGetStringFromObj(pathPtr, lengthPtr);

    *valuePtr = Tcl_Alloc(*lengthPtr + 1);
    memcpy(*valuePtr, bytes, *lengthPtr + 1);
    Tcl_DecrRefCount(pathPtr);
}

/*
 *---------------------------------------------------------------------------
Changes to win/tclWinLoad.c.
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
        /*
         * Remember the first error on load attempt to be used if the
         * second load attempt below also fails.
        */
        firstError = (nativeName == NULL) ?
		ERROR_MOD_NOT_FOUND : GetLastError();

	nativeName = Tcl_WinUtfToTChar(Tcl_GetString(pathPtr), -1, &ds);
	hInstance = LoadLibraryEx(nativeName, NULL,
		LOAD_WITH_ALTERED_SEARCH_PATH);
	Tcl_DStringFree(&ds);
    }

    if (hInstance == NULL) {
	DWORD lastError;







|







91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
        /*
         * Remember the first error on load attempt to be used if the
         * second load attempt below also fails.
        */
        firstError = (nativeName == NULL) ?
		ERROR_MOD_NOT_FOUND : GetLastError();

	nativeName = Tcl_WinUtfToTChar(TclGetString(pathPtr), -1, &ds);
	hInstance = LoadLibraryEx(nativeName, NULL,
		LOAD_WITH_ALTERED_SEARCH_PATH);
	Tcl_DStringFree(&ds);
    }

    if (hInstance == NULL) {
	DWORD lastError;
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
        if (firstError == ERROR_MOD_NOT_FOUND ||
            firstError == ERROR_DLL_NOT_FOUND)
            lastError = GetLastError();
        else
            lastError = firstError;

	errMsg = Tcl_ObjPrintf("couldn't load library \"%s\": ",
		Tcl_GetString(pathPtr));

	/*
	 * Check for possible DLL errors. This doesn't work quite right,
	 * because Windows seems to only return ERROR_MOD_NOT_FOUND for just
	 * about any problem, but it's better than nothing. It'd be even
	 * better if there was a way to get what DLLs
	 */







|







113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
        if (firstError == ERROR_MOD_NOT_FOUND ||
            firstError == ERROR_DLL_NOT_FOUND)
            lastError = GetLastError();
        else
            lastError = firstError;

	errMsg = Tcl_ObjPrintf("couldn't load library \"%s\": ",
		TclGetString(pathPtr));

	/*
	 * Check for possible DLL errors. This doesn't work quite right,
	 * because Windows seems to only return ERROR_MOD_NOT_FOUND for just
	 * about any problem, but it's better than nothing. It'd be even
	 * better if there was a way to get what DLLs
	 */
Changes to win/tclWinPipe.c.
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227

	    if (infoPtr->writeBuf) {
		Tcl_Free(infoPtr->writeBuf);
	    }
	    infoPtr->writeBufLen = toWrite;
	    infoPtr->writeBuf = Tcl_Alloc(toWrite);
	}
	memcpy(infoPtr->writeBuf, buf, (size_t) toWrite);
	infoPtr->toWrite = toWrite;
	ResetEvent(infoPtr->writable);
	TclPipeThreadSignal(&infoPtr->writeTI);
	bytesWritten = toWrite;
    } else {
	/*
	 * In the blocking case, just try to write the buffer directly. This







|







2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227

	    if (infoPtr->writeBuf) {
		Tcl_Free(infoPtr->writeBuf);
	    }
	    infoPtr->writeBufLen = toWrite;
	    infoPtr->writeBuf = Tcl_Alloc(toWrite);
	}
	memcpy(infoPtr->writeBuf, buf, toWrite);
	infoPtr->toWrite = toWrite;
	ResetEvent(infoPtr->writable);
	TclPipeThreadSignal(&infoPtr->writeTI);
	bytesWritten = toWrite;
    } else {
	/*
	 * In the blocking case, just try to write the buffer directly. This
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
    if (objc > 2) {
	Tcl_WrongNumArgs(interp, 1, objv, "?channelId?");
	return TCL_ERROR;
    }
    if (objc == 1) {
	Tcl_SetObjResult(interp, Tcl_NewWideIntObj((unsigned) getpid()));
    } else {
	chan = Tcl_GetChannel(interp, Tcl_GetString(objv[1]),
		NULL);
	if (chan == (Tcl_Channel) NULL) {
	    return TCL_ERROR;
	}
	chanTypePtr = Tcl_GetChannelType(chan);
	if (chanTypePtr != &pipeChannelType) {
	    return TCL_OK;







|







2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
    if (objc > 2) {
	Tcl_WrongNumArgs(interp, 1, objv, "?channelId?");
	return TCL_ERROR;
    }
    if (objc == 1) {
	Tcl_SetObjResult(interp, Tcl_NewWideIntObj((unsigned) getpid()));
    } else {
	chan = Tcl_GetChannel(interp, TclGetString(objv[1]),
		NULL);
	if (chan == (Tcl_Channel) NULL) {
	    return TCL_ERROR;
	}
	chanTypePtr = Tcl_GetChannelType(chan);
	if (chanTypePtr != &pipeChannelType) {
	    return TCL_OK;
3119
3120
3121
3122
3123
3124
3125

3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
    namePtr = (char *) name;
    length = GetTempPath(MAX_PATH, name);
    if (length == 0) {
	goto gotError;
    }
    namePtr += length * sizeof(TCHAR);
    if (basenameObj) {

	const char *string = Tcl_GetString(basenameObj);

	Tcl_WinUtfToTChar(string, basenameObj->length, &buf);
	memcpy(namePtr, Tcl_DStringValue(&buf), Tcl_DStringLength(&buf));
	namePtr += Tcl_DStringLength(&buf);
	Tcl_DStringFree(&buf);
    } else {
	const TCHAR *baseStr = TEXT("TCL");
	length = 3 * sizeof(TCHAR);








>
|

|







3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
    namePtr = (char *) name;
    length = GetTempPath(MAX_PATH, name);
    if (length == 0) {
	goto gotError;
    }
    namePtr += length * sizeof(TCHAR);
    if (basenameObj) {
	size_t length;
	const char *string = TclGetStringFromObj(basenameObj, &length);

	Tcl_WinUtfToTChar(string, length, &buf);
	memcpy(namePtr, Tcl_DStringValue(&buf), Tcl_DStringLength(&buf));
	namePtr += Tcl_DStringLength(&buf);
	Tcl_DStringFree(&buf);
    } else {
	const TCHAR *baseStr = TEXT("TCL");
	length = 3 * sizeof(TCHAR);