7 Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
9 Copyright (C) 1997 - 2000 Pekka Riikonen
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2 of the License, or
14 (at your option) any later version.
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
23 /****h* silcmath/silcmath.h
27 * SILC Math interface includes various utility functions such as
28 * prime generation, and conversion routines. See the silcmp.h for the
36 /****f* silcmath/SilcMathAPI/silc_math_gen_prime
40 * int silc_math_gen_prime(SilcMPInt *prime, uint32 bits, bool verbose);
44 * Find appropriate prime. It generates a number by taking random bytes.
45 * It then tests the number that it's not divisible by any of the small
46 * primes and then it performs Fermat's prime test. I thank Rieks Joosten
47 * (r.joosten@pijnenburg.nl) for such a good help with prime tests.
49 * If argument verbose is TRUE this will display some status information
50 * about the progress of generation.
53 bool silc_math_gen_prime(SilcMPInt *prime, uint32 bits, bool verbose);
55 /****f* silcmath/SilcMathAPI/silc_math_prime_test
59 * int silc_math_prime_test(SilcMPInt *p);
63 * Performs primality testings for given number. Returns TRUE if the
64 * number is probably a prime.
67 bool silc_math_prime_test(SilcMPInt *p);