5 Author: Pekka Riikonen <priikone@silcnet.org>
7 Copyright (C) 1997 - 2007 Pekka Riikonen
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; version 2 of the License.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
25 int bits; /* bits in key */
26 SilcMPInt n; /* modulus */
27 SilcMPInt e; /* public exponent */
32 int bits; /* bits in key */
33 SilcMPInt n; /* modulus */
34 SilcMPInt e; /* public exponent */
35 SilcMPInt d; /* private exponent */
36 SilcMPInt p; /* CRT, p */
37 SilcMPInt q; /* CRT, q */
38 SilcMPInt dP; /* CRT, d mod p - 1 */
39 SilcMPInt dQ; /* CRT, d mod q - 1 */
40 SilcMPInt qP; /* CRT, q ^ -1 mod p (aka u, aka qInv) */
43 SilcBool silc_rsa_generate_keys(SilcUInt32 bits, SilcMPInt *p, SilcMPInt *q,
44 void **ret_public_key, void **ret_private_key);
45 SilcBool silc_rsa_public_operation(RsaPublicKey *key, SilcMPInt *src,
47 SilcBool silc_rsa_private_operation(RsaPrivateKey *key, SilcMPInt *src,