rsafun.cxx

Go to the documentation of this file.
00001 /* @(#)root/auth:$Id: rsafun.cxx 20882 2007-11-19 11:31:26Z rdm $ */
00002 /* Author: Martin Nicolay  22/11/1988 */
00003 
00004 /******************************************************************************
00005 Copyright (C) 2006 Martin Nicolay <m.nicolay@osm-gmbh.de>
00006 
00007 This library is free software; you can redistribute it and/or
00008 modify it under the terms of the GNU Lesser General Public
00009 License as published by the Free Software Foundation; either
00010 version 2.1 of the License, or (at your option) any later
00011 version.
00012 
00013 This library is distributed in the hope that it will be useful,
00014 but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 GNU Lesser General Public License for more details.
00017 
00018 You should have received a copy of the GNU Lesser General Public
00019 License along with this library; if not, write to the Free
00020 Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
00021 MA  02110-1301  USA
00022 ******************************************************************************/
00023 
00024 /*******************************************************************************
00025 *                                                                                                                      *
00026 *       Simple RSA public key code.                                            *
00027 *       Adaptation in library for ROOT by G. Ganis, July 2003                  *
00028 *       (gerardo.ganis@cern.ch)                                                *
00029 *                                                                                                                           *
00030 *******************************************************************************/
00031 
00032 #include "rsafun.h"
00033 
00034 rsa_NUMBER rsa_genprim(int, int);
00035 int rsa_genrsa(rsa_NUMBER, rsa_NUMBER, rsa_NUMBER *, rsa_NUMBER *, rsa_NUMBER *);
00036 int rsa_encode(char *, int, rsa_NUMBER, rsa_NUMBER);
00037 int rsa_decode(char *, int, rsa_NUMBER, rsa_NUMBER);
00038 int rsa_num_sput( rsa_NUMBER*, char*, int );
00039 int rsa_num_fput( rsa_NUMBER*, FILE* );
00040 int rsa_num_sget( rsa_NUMBER*, char* );
00041 int rsa_num_fget( rsa_NUMBER*, FILE* );
00042 void rsa_assign( rsa_NUMBER*, rsa_NUMBER* );
00043 int rsa_cmp( rsa_NUMBER*, rsa_NUMBER* );
00044 
00045 RSA_genprim_t  TRSA_fun::fg_rsa_genprim;
00046 RSA_genrsa_t   TRSA_fun::fg_rsa_genrsa;
00047 RSA_encode_t   TRSA_fun::fg_rsa_encode;
00048 RSA_decode_t   TRSA_fun::fg_rsa_decode;
00049 RSA_num_sput_t TRSA_fun::fg_rsa_num_sput;
00050 RSA_num_fput_t TRSA_fun::fg_rsa_num_fput;
00051 RSA_num_sget_t TRSA_fun::fg_rsa_num_sget;
00052 RSA_num_fget_t TRSA_fun::fg_rsa_num_fget;
00053 RSA_assign_t   TRSA_fun::fg_rsa_assign;
00054 RSA_cmp_t      TRSA_fun::fg_rsa_cmp;
00055 
00056 RSA_genprim_t  TRSA_fun::RSA_genprim() { return fg_rsa_genprim; }
00057 RSA_genrsa_t   TRSA_fun::RSA_genrsa() { return fg_rsa_genrsa; }
00058 RSA_encode_t   TRSA_fun::RSA_encode() { return fg_rsa_encode; }
00059 RSA_decode_t   TRSA_fun::RSA_decode() { return fg_rsa_decode; }
00060 RSA_num_sput_t TRSA_fun::RSA_num_sput() { return fg_rsa_num_sput; }
00061 RSA_num_fput_t TRSA_fun::RSA_num_fput() { return fg_rsa_num_fput; }
00062 RSA_num_sget_t TRSA_fun::RSA_num_sget() { return fg_rsa_num_sget; }
00063 RSA_num_fget_t TRSA_fun::RSA_num_fget() { return fg_rsa_num_fget; }
00064 RSA_assign_t   TRSA_fun::RSA_assign() { return fg_rsa_assign; }
00065 RSA_cmp_t      TRSA_fun::RSA_cmp() { return fg_rsa_cmp; }
00066 
00067 // Static instantiation to load hooks during dynamic load
00068 static TRSA_fun  g_rsa_init(&rsa_genprim,&rsa_genrsa,&rsa_encode,&rsa_decode,
00069                             &rsa_num_sput,&rsa_num_fput,&rsa_num_sget,
00070                             &rsa_num_fget,&rsa_assign,&rsa_cmp);
00071 
00072 TRSA_fun::TRSA_fun(RSA_genprim_t genprim, RSA_genrsa_t genrsa, RSA_encode_t encode,
00073                    RSA_decode_t decode, RSA_num_sput_t num_sput, RSA_num_fput_t num_fput,
00074                    RSA_num_sget_t num_sget, RSA_num_fget_t num_fget,
00075                    RSA_assign_t assign, RSA_cmp_t cmp)
00076 {
00077    // constructor
00078 
00079    fg_rsa_genprim = genprim;
00080    fg_rsa_genrsa  = genrsa;
00081    fg_rsa_encode  = encode;
00082    fg_rsa_decode  = decode;
00083    fg_rsa_num_sput = num_sput;
00084    fg_rsa_num_fput = num_fput;
00085    fg_rsa_num_sget = num_sget;
00086    fg_rsa_num_fget = num_fget;
00087    fg_rsa_assign   = assign;
00088    fg_rsa_cmp      = cmp;
00089 }

Generated on Tue Jul 5 14:45:37 2011 for ROOT_528-00b_version by  doxygen 1.5.1