rsafun.h

Go to the documentation of this file.
00001 /* @(#)root/auth:$Id: rsafun.h 30749 2009-10-15 16:33:04Z brun $ */
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 *       Header used by internal rsa functions                                   *
00031 *                                                                                                                           *
00032 *******************************************************************************/
00033 
00034 #include <stdio.h>
00035 
00036 #ifndef ROOT_rsafun
00037 #define ROOT_rsafun
00038 
00039 #ifndef _RSADEF_H
00040 #include "rsadef.h"
00041 #endif
00042 
00043 
00044 typedef  rsa_NUMBER (*RSA_genprim_t)(int, int);
00045 typedef  int    (*RSA_genrsa_t)(rsa_NUMBER, rsa_NUMBER, rsa_NUMBER *, rsa_NUMBER *, rsa_NUMBER *);
00046 typedef  int    (*RSA_encode_t)(char *, int, rsa_NUMBER, rsa_NUMBER);
00047 typedef  int    (*RSA_decode_t)(char *, int, rsa_NUMBER, rsa_NUMBER);
00048 typedef  int    (*RSA_num_sput_t)(rsa_NUMBER*, char*, int );
00049 typedef  int    (*RSA_num_fput_t)(rsa_NUMBER*, FILE* );
00050 typedef  int    (*RSA_num_sget_t)(rsa_NUMBER*, char* );
00051 typedef  int    (*RSA_num_fget_t)(rsa_NUMBER*, FILE* );
00052 typedef  void   (*RSA_assign_t)(rsa_NUMBER *, rsa_NUMBER *);
00053 typedef  int    (*RSA_cmp_t)(rsa_NUMBER *, rsa_NUMBER *);
00054 
00055 
00056 class TRSA_fun {
00057 
00058 private:
00059    static RSA_genprim_t   fg_rsa_genprim;
00060    static RSA_genrsa_t    fg_rsa_genrsa;
00061    static RSA_encode_t    fg_rsa_encode;
00062    static RSA_decode_t    fg_rsa_decode;
00063    static RSA_num_sput_t  fg_rsa_num_sput;
00064    static RSA_num_fput_t  fg_rsa_num_fput;
00065    static RSA_num_sget_t  fg_rsa_num_sget;
00066    static RSA_num_fget_t  fg_rsa_num_fget;
00067    static RSA_assign_t    fg_rsa_assign;
00068    static RSA_cmp_t       fg_rsa_cmp;
00069 
00070 public:
00071    static RSA_genprim_t   RSA_genprim();
00072    static RSA_genrsa_t    RSA_genrsa();
00073    static RSA_encode_t    RSA_encode();
00074    static RSA_decode_t    RSA_decode();
00075    static RSA_num_sput_t  RSA_num_sput();
00076    static RSA_num_fput_t  RSA_num_fput();
00077    static RSA_num_sget_t  RSA_num_sget();
00078    static RSA_num_fget_t  RSA_num_fget();
00079    static RSA_assign_t    RSA_assign();
00080    static RSA_cmp_t       RSA_cmp();
00081 
00082    TRSA_fun(RSA_genprim_t, RSA_genrsa_t, RSA_encode_t, RSA_decode_t,
00083            RSA_num_sput_t, RSA_num_fput_t, RSA_num_sget_t, RSA_num_fget_t, RSA_assign_t, RSA_cmp_t);
00084 };
00085 
00086 #endif

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