Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
rsaaux.h
Go to the documentation of this file.
1 /* @(#)root/auth:$Id$ */
2 /* Author: Martin Nicolay 22/11/1988 */
3 
4 /******************************************************************************
5 Copyright (C) 2006 Martin Nicolay <m.nicolay@osm-gmbh.de>
6 
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later
11 version.
12 
13 This library 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 Lesser General Public License for more details.
17 
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library; if not, write to the Free
20 Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
21 MA 02110-1301 USA
22 ******************************************************************************/
23 
24 /*******************************************************************************
25 * *
26 * Simple RSA public key code. *
27 * Adaptation in library for ROOT by G. Ganis, July 2003 *
28 * (gerardo.ganis@cern.ch) *
29 * *
30 * Header used by internal rsa functions *
31 * *
32 *******************************************************************************/
33 
34 #ifndef _RSAAUX_H
35 #define _RSAAUX_H
36 
37 #include "rsadef.h"
38 
39 extern rsa_NUMBER a_one,a_two;
40 
41 /*
42  * Prototypes
43  */
44 
45 void a_add(rsa_NUMBER*, rsa_NUMBER*, rsa_NUMBER*);
46 void a_assign(rsa_NUMBER*, rsa_NUMBER*);
47 int a_cmp(rsa_NUMBER*, rsa_NUMBER*);
48 void a_div(rsa_NUMBER*, rsa_NUMBER*, rsa_NUMBER*, rsa_NUMBER*);
49 void a_div2(rsa_NUMBER*);
50 void a_ggt(rsa_NUMBER*, rsa_NUMBER*, rsa_NUMBER*);
51 void a_imult(rsa_NUMBER*, rsa_INT, rsa_NUMBER*);
52 void a_mult(rsa_NUMBER*, rsa_NUMBER*, rsa_NUMBER*);
53 void a_sub(rsa_NUMBER*, rsa_NUMBER*, rsa_NUMBER*);
54 void m_init(rsa_NUMBER*, rsa_NUMBER*);
55 void m_add(rsa_NUMBER*, rsa_NUMBER*, rsa_NUMBER*);
56 void m_mult(rsa_NUMBER*, rsa_NUMBER*, rsa_NUMBER*);
57 void m_exp(rsa_NUMBER*, rsa_NUMBER*, rsa_NUMBER*);
58 int n_bits(rsa_NUMBER*, int);
59 void n_div(rsa_NUMBER*, rsa_NUMBER*, rsa_NUMBER*, rsa_NUMBER*);
60 int n_cmp(rsa_INT*, rsa_INT*, int);
61 int n_mult(rsa_INT*, rsa_INT, rsa_INT*, int);
62 int n_sub(rsa_INT*, rsa_INT*, rsa_INT*, int, int);
63 int n_bitlen(rsa_NUMBER*);
64 
65 
66 
67 /******************
68  * prim.h *
69  ******************/
70 
71 int p_prim(rsa_NUMBER*, int);
72 void inv(rsa_NUMBER*, rsa_NUMBER*, rsa_NUMBER*);
73 
74 
75 /******************
76  * rnd.h *
77  ******************/
78 
79 void gen_number(int, rsa_NUMBER*);
80 void init_rnd(void);
81 
82 
83 /******************
84  * aux.h *
85  ******************/
86 
87 void do_crypt(char *, char *, int, rsa_NUMBER *);
88 
89 /*
90 int get_clear(char *, FILE *);
91 int get_enc(char *, FILE *);
92 int put_clear(char *, FILE *);
93 int put_enc(char *, FILE *);
94 */
95 
96 #endif