updates.
[silc.git] / lib / silcmath / silcmath.h
1 /*
2
3   silcmath.h
4  
5   COPYRIGHT
6  
7   Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
8  
9   Copyright (C) 1997 - 2000 Pekka Riikonen
10  
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.
15  
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.
20
21 */
22
23 /****h* silcmath/silcmath.h
24  *
25  * DESCRIPTION
26  *
27  * SILC Math interface includes various utility functions such as
28  * prime generation, and conversion routines. See the silcmp.h for the
29  * SILC MP interface.
30  *
31  ***/
32
33 #ifndef SILCMATH_H
34 #define SILCMATH_H
35
36 /****f* silcmath/SilcMathAPI/silc_math_gen_prime
37  *
38  * SYNOPSIS
39  *
40  *    int silc_math_gen_prime(SilcMPInt *prime, uint32 bits, bool verbose);
41  *
42  * DESCRIPTION
43  *
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. 
48  *
49  *    If argument verbose is TRUE this will display some status information
50  *    about the progress of generation.
51  *
52  ***/
53 bool silc_math_gen_prime(SilcMPInt *prime, uint32 bits, bool verbose);
54
55 /****f* silcmath/SilcMathAPI/silc_math_prime_test
56  *
57  * SYNOPSIS
58  *
59  *    int silc_math_prime_test(SilcMPInt *p);
60  *
61  * DESCRIPTION
62  *
63  *    Performs primality testings for given number. Returns TRUE if the 
64  *    number is probably a prime.
65  *
66  ***/
67 bool silc_math_prime_test(SilcMPInt *p);
68
69 #endif