Logo ROOT   6.12/07
Reference Guide
rsafun.cxx
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 *******************************************************************************/
31 
32 #include "rsafun.h"
33 
34 rsa_NUMBER rsa_genprim(int, int);
36 int rsa_encode(char *, int, rsa_NUMBER, rsa_NUMBER);
37 int rsa_decode(char *, int, rsa_NUMBER, rsa_NUMBER);
38 int rsa_num_sput( rsa_NUMBER*, char*, int );
39 int rsa_num_fput( rsa_NUMBER*, FILE* );
40 int rsa_num_sget( rsa_NUMBER*, char* );
41 int rsa_num_fget( rsa_NUMBER*, FILE* );
43 int rsa_cmp( rsa_NUMBER*, rsa_NUMBER* );
44 
55 
66 
67 // Static instantiation to load hooks during dynamic load
71 
74  RSA_num_sget_t num_sget, RSA_num_fget_t num_fget,
75  RSA_assign_t assign, RSA_cmp_t cmp)
76 {
77  // constructor
78 
79  fg_rsa_genprim = genprim;
80  fg_rsa_genrsa = genrsa;
83  fg_rsa_num_sput = num_sput;
84  fg_rsa_num_fput = num_fput;
85  fg_rsa_num_sget = num_sget;
86  fg_rsa_num_fget = num_fget;
87  fg_rsa_assign = assign;
88  fg_rsa_cmp = cmp;
89 }
void(* RSA_assign_t)(rsa_NUMBER *, rsa_NUMBER *)
Definition: rsafun.h:50
int rsa_genrsa(rsa_NUMBER, rsa_NUMBER, rsa_NUMBER *, rsa_NUMBER *, rsa_NUMBER *)
Definition: rsalib.cxx:82
int rsa_num_sget(rsa_NUMBER *, char *)
Definition: rsalib.cxx:374
static RSA_num_sput_t RSA_num_sput()
Definition: rsafun.cxx:60
int(* RSA_encode_t)(char *, int, rsa_NUMBER, rsa_NUMBER)
Definition: rsafun.h:44
static RSA_encode_t fg_rsa_encode
Definition: rsafun.h:59
static RSA_decode_t RSA_decode()
Definition: rsafun.cxx:59
int rsa_num_sput(rsa_NUMBER *, char *, int)
Definition: rsalib.cxx:276
static RSA_genrsa_t fg_rsa_genrsa
Definition: rsafun.h:58
static RSA_num_fget_t RSA_num_fget()
Definition: rsafun.cxx:63
static RSA_num_sget_t RSA_num_sget()
Definition: rsafun.cxx:62
int rsa_num_fput(rsa_NUMBER *, FILE *)
Definition: rsalib.cxx:350
static RSA_assign_t RSA_assign()
Definition: rsafun.cxx:64
static RSA_assign_t fg_rsa_assign
Definition: rsafun.h:65
int rsa_num_fget(rsa_NUMBER *, FILE *)
Definition: rsalib.cxx:450
void rsa_assign(rsa_NUMBER *, rsa_NUMBER *)
Definition: rsalib.cxx:487
int rsa_decode(char *, int, rsa_NUMBER, rsa_NUMBER)
Definition: rsalib.cxx:177
static RSA_num_fput_t fg_rsa_num_fput
Definition: rsafun.h:62
int(* RSA_decode_t)(char *, int, rsa_NUMBER, rsa_NUMBER)
Definition: rsafun.h:45
static RSA_genprim_t RSA_genprim()
Definition: rsafun.cxx:56
static RSA_genprim_t fg_rsa_genprim
Definition: rsafun.h:57
static RSA_num_sget_t fg_rsa_num_sget
Definition: rsafun.h:63
static RSA_cmp_t RSA_cmp()
Definition: rsafun.cxx:65
static RSA_cmp_t fg_rsa_cmp
Definition: rsafun.h:66
rsa_NUMBER(* RSA_genprim_t)(int, int)
Definition: rsafun.h:42
#define decode(ptr, otri)
Definition: triangle.c:912
#define encode(otri)
Definition: triangle.c:921
int(* RSA_genrsa_t)(rsa_NUMBER, rsa_NUMBER, rsa_NUMBER *, rsa_NUMBER *, rsa_NUMBER *)
Definition: rsafun.h:43
static TRSA_fun g_rsa_init & rsa_genprim
Definition: rsafun.cxx:68
int(* RSA_num_fget_t)(rsa_NUMBER *, FILE *)
Definition: rsafun.h:49
static RSA_num_fget_t fg_rsa_num_fget
Definition: rsafun.h:64
int(* RSA_num_sput_t)(rsa_NUMBER *, char *, int)
Definition: rsafun.h:46
int rsa_cmp(rsa_NUMBER *, rsa_NUMBER *)
Definition: rsalib.cxx:476
int(* RSA_num_sget_t)(rsa_NUMBER *, char *)
Definition: rsafun.h:48
static RSA_decode_t fg_rsa_decode
Definition: rsafun.h:60
TRSA_fun(RSA_genprim_t, RSA_genrsa_t, RSA_encode_t, RSA_decode_t, RSA_num_sput_t, RSA_num_fput_t, RSA_num_sget_t, RSA_num_fget_t, RSA_assign_t, RSA_cmp_t)
Definition: rsafun.cxx:72
static RSA_num_fput_t RSA_num_fput()
Definition: rsafun.cxx:61
static RSA_encode_t RSA_encode()
Definition: rsafun.cxx:58
static RSA_genrsa_t RSA_genrsa()
Definition: rsafun.cxx:57
int(* RSA_cmp_t)(rsa_NUMBER *, rsa_NUMBER *)
Definition: rsafun.h:51
static RSA_num_sput_t fg_rsa_num_sput
Definition: rsafun.h:61
int rsa_encode(char *, int, rsa_NUMBER, rsa_NUMBER)
Definition: rsalib.cxx:139
int(* RSA_num_fput_t)(rsa_NUMBER *, FILE *)
Definition: rsafun.h:47