michael@0: /* michael@0: * test-info.c michael@0: * michael@0: * Arbitrary precision integer arithmetic library michael@0: * michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* Table mapping test suite names to index numbers */ michael@0: const int g_count = 42; michael@0: const char *g_names[] = { michael@0: "list", /* print out a list of the available test suites */ michael@0: "copy", /* test assignment of mp-int structures */ michael@0: "exchange", /* test exchange of mp-int structures */ michael@0: "zero", /* test zeroing of an mp-int */ michael@0: "set", /* test setting an mp-int to a small constant */ michael@0: "absolute-value", /* test the absolute value function */ michael@0: "negate", /* test the arithmetic negation function */ michael@0: "add-digit", /* test digit addition */ michael@0: "add", /* test full addition */ michael@0: "subtract-digit", /* test digit subtraction */ michael@0: "subtract", /* test full subtraction */ michael@0: "multiply-digit", /* test digit multiplication */ michael@0: "multiply", /* test full multiplication */ michael@0: "square", /* test full squaring function */ michael@0: "divide-digit", /* test digit division */ michael@0: "divide-2", /* test division by two */ michael@0: "divide-2d", /* test division & remainder by 2^d */ michael@0: "divide", /* test full division */ michael@0: "expt-digit", /* test digit exponentiation */ michael@0: "expt", /* test full exponentiation */ michael@0: "expt-2", /* test power-of-two exponentiation */ michael@0: "square-root", /* test integer square root function */ michael@0: "modulo-digit", /* test digit modular reduction */ michael@0: "modulo", /* test full modular reduction */ michael@0: "mod-add", /* test modular addition */ michael@0: "mod-subtract", /* test modular subtraction */ michael@0: "mod-multiply", /* test modular multiplication */ michael@0: "mod-square", /* test modular squaring function */ michael@0: "mod-expt", /* test full modular exponentiation */ michael@0: "mod-expt-digit", /* test digit modular exponentiation */ michael@0: "mod-inverse", /* test modular inverse function */ michael@0: "compare-digit", /* test digit comparison function */ michael@0: "compare-zero", /* test zero comparison function */ michael@0: "compare", /* test general signed comparison */ michael@0: "compare-magnitude", /* test general magnitude comparison */ michael@0: "parity", /* test parity comparison functions */ michael@0: "gcd", /* test greatest common divisor functions */ michael@0: "lcm", /* test least common multiple function */ michael@0: "conversion", /* test general radix conversion facilities */ michael@0: "binary", /* test raw output format */ michael@0: "pprime", /* test probabilistic primality tester */ michael@0: "fermat" /* test Fermat pseudoprimality tester */ michael@0: }; michael@0: michael@0: /* Test function prototypes */ michael@0: int test_list(void); michael@0: int test_copy(void); michael@0: int test_exch(void); michael@0: int test_zero(void); michael@0: int test_set(void); michael@0: int test_abs(void); michael@0: int test_neg(void); michael@0: int test_add_d(void); michael@0: int test_add(void); michael@0: int test_sub_d(void); michael@0: int test_sub(void); michael@0: int test_mul_d(void); michael@0: int test_mul(void); michael@0: int test_sqr(void); michael@0: int test_div_d(void); michael@0: int test_div_2(void); michael@0: int test_div_2d(void); michael@0: int test_div(void); michael@0: int test_expt_d(void); michael@0: int test_expt(void); michael@0: int test_2expt(void); michael@0: int test_sqrt(void); michael@0: int test_mod_d(void); michael@0: int test_mod(void); michael@0: int test_addmod(void); michael@0: int test_submod(void); michael@0: int test_mulmod(void); michael@0: int test_sqrmod(void); michael@0: int test_exptmod(void); michael@0: int test_exptmod_d(void); michael@0: int test_invmod(void); michael@0: int test_cmp_d(void); michael@0: int test_cmp_z(void); michael@0: int test_cmp(void); michael@0: int test_cmp_mag(void); michael@0: int test_parity(void); michael@0: int test_gcd(void); michael@0: int test_lcm(void); michael@0: int test_convert(void); michael@0: int test_raw(void); michael@0: int test_pprime(void); michael@0: int test_fermat(void); michael@0: michael@0: /* Table mapping index numbers to functions */ michael@0: int (*g_tests[])(void) = { michael@0: test_list, test_copy, test_exch, test_zero, michael@0: test_set, test_abs, test_neg, test_add_d, michael@0: test_add, test_sub_d, test_sub, test_mul_d, michael@0: test_mul, test_sqr, test_div_d, test_div_2, michael@0: test_div_2d, test_div, test_expt_d, test_expt, michael@0: test_2expt, test_sqrt, test_mod_d, test_mod, michael@0: test_addmod, test_submod, test_mulmod, test_sqrmod, michael@0: test_exptmod, test_exptmod_d, test_invmod, test_cmp_d, michael@0: test_cmp_z, test_cmp, test_cmp_mag, test_parity, michael@0: test_gcd, test_lcm, test_convert, test_raw, michael@0: test_pprime, test_fermat michael@0: }; michael@0: michael@0: /* Table mapping index numbers to descriptions */ michael@0: const char *g_descs[] = { michael@0: "print out a list of the available test suites", michael@0: "test assignment of mp-int structures", michael@0: "test exchange of mp-int structures", michael@0: "test zeroing of an mp-int", michael@0: "test setting an mp-int to a small constant", michael@0: "test the absolute value function", michael@0: "test the arithmetic negation function", michael@0: "test digit addition", michael@0: "test full addition", michael@0: "test digit subtraction", michael@0: "test full subtraction", michael@0: "test digit multiplication", michael@0: "test full multiplication", michael@0: "test full squaring function", michael@0: "test digit division", michael@0: "test division by two", michael@0: "test division & remainder by 2^d", michael@0: "test full division", michael@0: "test digit exponentiation", michael@0: "test full exponentiation", michael@0: "test power-of-two exponentiation", michael@0: "test integer square root function", michael@0: "test digit modular reduction", michael@0: "test full modular reduction", michael@0: "test modular addition", michael@0: "test modular subtraction", michael@0: "test modular multiplication", michael@0: "test modular squaring function", michael@0: "test full modular exponentiation", michael@0: "test digit modular exponentiation", michael@0: "test modular inverse function", michael@0: "test digit comparison function", michael@0: "test zero comparison function", michael@0: "test general signed comparison", michael@0: "test general magnitude comparison", michael@0: "test parity comparison functions", michael@0: "test greatest common divisor functions", michael@0: "test least common multiple function", michael@0: "test general radix conversion facilities", michael@0: "test raw output format", michael@0: "test probabilistic primality tester", michael@0: "test Fermat pseudoprimality tester" michael@0: }; michael@0: