1 /*
2  * Copyright (c) 2000, 2001, 2002 X-Way Rights BV
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  *
18  */
19 
20 /*!\file rsapk.c
21  * \brief RSA public key.
22  * \author Bob Deblier <bob.deblier@telenet.be>
23  * \ingroup IF_m IF_rsa_m
24  */
25 
26 #define BEECRYPT_DLL_EXPORT
27 
28 #if HAVE_CONFIG_H
29 # include "config.h"
30 #endif
31 
32 #include "beecrypt/rsapk.h"
33 
34 /*!\addtogroup IF_rsa_m
35  * \{
36  */
37 
rsapkInit(rsapk * pk)38 int rsapkInit(rsapk* pk)
39 {
40 	memset(pk, 0, sizeof(rsapk));
41 	/* or
42 	mpbzero(&pk->n);
43 	mpnzero(&pk->e);
44 	*/
45 
46 	return 0;
47 }
48 
rsapkFree(rsapk * pk)49 int rsapkFree(rsapk* pk)
50 {
51 	mpbfree(&pk->n);
52 	mpnfree(&pk->e);
53 
54 	return 0;
55 }
56 
rsapkCopy(rsapk * dst,const rsapk * src)57 int rsapkCopy(rsapk* dst, const rsapk* src)
58 {
59 	mpbcopy(&dst->n, &src->n);
60 	mpncopy(&dst->e, &src->e);
61 
62 	return 0;
63 }
64 
65 /*!\}
66  */
67