padd.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  $RCSfile$
00003  -------------------
00004  cvs         : $Id$
00005  begin       : Mon Jan 05 2004
00006  copyright   : (C) 2004 by Martin Preuss
00007  email       : martin@libchipcard.de
00008 
00009  ***************************************************************************
00010  *                                                                         *
00011  *   This library is free software; you can redistribute it and/or         *
00012  *   modify it under the terms of the GNU Lesser General Public            *
00013  *   License as published by the Free Software Foundation; either          *
00014  *   version 2.1 of the License, or (at your option) any later version.    *
00015  *                                                                         *
00016  *   This library is distributed in the hope that it will be useful,       *
00017  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00018  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00019  *   Lesser General Public License for more details.                       *
00020  *                                                                         *
00021  *   You should have received a copy of the GNU Lesser General Public      *
00022  *   License along with this library; if not, write to the Free Software   *
00023  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,                 *
00024  *   MA  02111-1307  USA                                                   *
00025  *                                                                         *
00026  ***************************************************************************/
00027 
00028 #ifndef GWEN_PADD_H
00029 #define GWEN_PADD_H
00030 
00031 #include <gwenhywfar/buffer.h>
00032 #include <gwenhywfar/paddalgo.h>
00033 #include <gwenhywfar/mdigest.h>
00034 
00035 #ifdef __cplusplus
00036 extern "C" {
00037 #endif
00038 
00039 
00050 
00057 GWENHYWFAR_API
00058 int GWEN_Padd_PaddWithISO9796(GWEN_BUFFER *src);
00059 
00063 GWENHYWFAR_API
00064 int GWEN_Padd_PaddWithIso9796_2(GWEN_BUFFER *buf, int dstSize);
00065 
00066 
00067 GWENHYWFAR_API
00068 int GWEN_Padd_UnpaddWithIso9796_2(GWEN_BUFFER *buf);
00069 
00074 GWENHYWFAR_API
00075 int GWEN_Padd_PaddWithAnsiX9_23(GWEN_BUFFER *src);
00076 
00081 GWENHYWFAR_API
00082 int GWEN_Padd_UnpaddWithAnsiX9_23(GWEN_BUFFER *src);
00083 
00084 
00097 GWENHYWFAR_API
00098 int GWEN_Padd_PaddWithAnsiX9_23ToMultipleOf(GWEN_BUFFER *src, int y);
00099 
00104 GWENHYWFAR_API
00105 int GWEN_Padd_UnpaddWithAnsiX9_23FromMultipleOf(GWEN_BUFFER *src, int y);
00106 
00107 
00108 GWENHYWFAR_API
00109 int GWEN_Padd_PaddWithPkcs1Bt1(GWEN_BUFFER *src, int dstSize);
00110 
00111 GWENHYWFAR_API
00112 int GWEN_Padd_UnpaddWithPkcs1Bt1(GWEN_BUFFER *src);
00113 
00114 GWENHYWFAR_API
00115 int GWEN_Padd_PaddWithPkcs1Bt2(GWEN_BUFFER *src, int dstSize);
00116 
00117 GWENHYWFAR_API
00118 int GWEN_Padd_UnpaddWithPkcs1Bt2(GWEN_BUFFER *src);
00119 
00120 
00121 GWENHYWFAR_API
00122 int GWEN_Padd_MGF1(uint8_t *pDestBuffer,
00123                    uint32_t lDestBuffer,
00124                    const uint8_t *pSeed,
00125                    uint32_t lSeed,
00126                    GWEN_MDIGEST *md);
00127 
00131 GWENHYWFAR_API
00132 int GWEN_Padd_AddPkcs1Pss(uint8_t *pDestBuffer,
00133                           uint32_t lDestBuffer,
00134                           uint32_t nbits,
00135                           const uint8_t *pHash,
00136                           uint32_t lHash,
00137                           uint32_t lSalt,
00138                           GWEN_MDIGEST *md);
00139 
00140 GWENHYWFAR_API
00141 int GWEN_Padd_VerifyPkcs1Pss(const uint8_t *pSrcBuffer,
00142                              uint32_t lSrcBuffer,
00143                              uint32_t nbits,
00144                              const uint8_t *pHash,
00145                              uint32_t lHash,
00146                              uint32_t lSalt,
00147                              GWEN_MDIGEST *md);
00148 
00149 
00150 GWENHYWFAR_API
00151 int GWEN_Padd_ApplyPaddAlgo(const GWEN_CRYPT_PADDALGO *a, GWEN_BUFFER *src);
00152 
00153 GWENHYWFAR_API
00154 int GWEN_Padd_UnapplyPaddAlgo(const GWEN_CRYPT_PADDALGO *a, GWEN_BUFFER *buf);
00155 
00158 #ifdef __cplusplus
00159 }
00160 #endif
00161 
00162 
00163 
00164 #endif /* GWEN_PADD_H */
00165