4
* Arbitrary precision integer arithmetic library
6
* This Source Code Form is subject to the terms of the Mozilla Public
7
* License, v. 2.0. If a copy of the MPL was not distributed with this
8
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
9
/* $Id: test-info.c,v 1.4 2012/04/25 14:49:50 gerv%gerv.net Exp $ */
11
/* Table mapping test suite names to index numbers */
12
const int g_count = 42;
13
const char *g_names[] = {
14
"list", /* print out a list of the available test suites */
15
"copy", /* test assignment of mp-int structures */
16
"exchange", /* test exchange of mp-int structures */
17
"zero", /* test zeroing of an mp-int */
18
"set", /* test setting an mp-int to a small constant */
19
"absolute-value", /* test the absolute value function */
20
"negate", /* test the arithmetic negation function */
21
"add-digit", /* test digit addition */
22
"add", /* test full addition */
23
"subtract-digit", /* test digit subtraction */
24
"subtract", /* test full subtraction */
25
"multiply-digit", /* test digit multiplication */
26
"multiply", /* test full multiplication */
27
"square", /* test full squaring function */
28
"divide-digit", /* test digit division */
29
"divide-2", /* test division by two */
30
"divide-2d", /* test division & remainder by 2^d */
31
"divide", /* test full division */
32
"expt-digit", /* test digit exponentiation */
33
"expt", /* test full exponentiation */
34
"expt-2", /* test power-of-two exponentiation */
35
"square-root", /* test integer square root function */
36
"modulo-digit", /* test digit modular reduction */
37
"modulo", /* test full modular reduction */
38
"mod-add", /* test modular addition */
39
"mod-subtract", /* test modular subtraction */
40
"mod-multiply", /* test modular multiplication */
41
"mod-square", /* test modular squaring function */
42
"mod-expt", /* test full modular exponentiation */
43
"mod-expt-digit", /* test digit modular exponentiation */
44
"mod-inverse", /* test modular inverse function */
45
"compare-digit", /* test digit comparison function */
46
"compare-zero", /* test zero comparison function */
47
"compare", /* test general signed comparison */
48
"compare-magnitude", /* test general magnitude comparison */
49
"parity", /* test parity comparison functions */
50
"gcd", /* test greatest common divisor functions */
51
"lcm", /* test least common multiple function */
52
"conversion", /* test general radix conversion facilities */
53
"binary", /* test raw output format */
54
"pprime", /* test probabilistic primality tester */
55
"fermat" /* test Fermat pseudoprimality tester */
58
/* Test function prototypes */
75
int test_div_2d(void);
77
int test_expt_d(void);
83
int test_addmod(void);
84
int test_submod(void);
85
int test_mulmod(void);
86
int test_sqrmod(void);
87
int test_exptmod(void);
88
int test_exptmod_d(void);
89
int test_invmod(void);
93
int test_cmp_mag(void);
94
int test_parity(void);
97
int test_convert(void);
99
int test_pprime(void);
100
int test_fermat(void);
102
/* Table mapping index numbers to functions */
103
int (*g_tests[])(void) = {
104
test_list, test_copy, test_exch, test_zero,
105
test_set, test_abs, test_neg, test_add_d,
106
test_add, test_sub_d, test_sub, test_mul_d,
107
test_mul, test_sqr, test_div_d, test_div_2,
108
test_div_2d, test_div, test_expt_d, test_expt,
109
test_2expt, test_sqrt, test_mod_d, test_mod,
110
test_addmod, test_submod, test_mulmod, test_sqrmod,
111
test_exptmod, test_exptmod_d, test_invmod, test_cmp_d,
112
test_cmp_z, test_cmp, test_cmp_mag, test_parity,
113
test_gcd, test_lcm, test_convert, test_raw,
114
test_pprime, test_fermat
117
/* Table mapping index numbers to descriptions */
118
const char *g_descs[] = {
119
"print out a list of the available test suites",
120
"test assignment of mp-int structures",
121
"test exchange of mp-int structures",
122
"test zeroing of an mp-int",
123
"test setting an mp-int to a small constant",
124
"test the absolute value function",
125
"test the arithmetic negation function",
126
"test digit addition",
127
"test full addition",
128
"test digit subtraction",
129
"test full subtraction",
130
"test digit multiplication",
131
"test full multiplication",
132
"test full squaring function",
133
"test digit division",
134
"test division by two",
135
"test division & remainder by 2^d",
136
"test full division",
137
"test digit exponentiation",
138
"test full exponentiation",
139
"test power-of-two exponentiation",
140
"test integer square root function",
141
"test digit modular reduction",
142
"test full modular reduction",
143
"test modular addition",
144
"test modular subtraction",
145
"test modular multiplication",
146
"test modular squaring function",
147
"test full modular exponentiation",
148
"test digit modular exponentiation",
149
"test modular inverse function",
150
"test digit comparison function",
151
"test zero comparison function",
152
"test general signed comparison",
153
"test general magnitude comparison",
154
"test parity comparison functions",
155
"test greatest common divisor functions",
156
"test least common multiple function",
157
"test general radix conversion facilities",
158
"test raw output format",
159
"test probabilistic primality tester",
160
"test Fermat pseudoprimality tester"