gwenhywfar 4.0.3

hashalgo.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  $RCSfile$
00003                              -------------------
00004     cvs         : $Id: crypttoken.h 1113 2007-01-10 09:14:16Z martin $
00005     begin       : Wed Mar 16 2005
00006     copyright   : (C) 2005 by Martin Preuss
00007     email       : martin@libchipcard.de
00008 
00009  ***************************************************************************
00010  *          Please see toplevel file COPYING for license details           *
00011  ***************************************************************************/
00012 
00013 
00014 #ifndef GWEN_CRYPT_HASHALGO_H
00015 #define GWEN_CRYPT_HASHALGO_H
00016 
00017 
00018 #include <gwenhywfar/list2.h>
00019 
00020 
00021 typedef struct GWEN_CRYPT_HASHALGO GWEN_CRYPT_HASHALGO;
00022 
00023 
00024 #ifdef __cplusplus
00025 extern "C" {
00026 #endif
00027 
00028 GWEN_LIST2_FUNCTION_LIB_DEFS(GWEN_CRYPT_HASHALGO,
00029                              GWEN_Crypt_HashAlgo,
00030                              GWENHYWFAR_API)
00031 
00032 #ifdef __cplusplus
00033 }
00034 #endif
00035 
00036 
00037 typedef enum {
00038   GWEN_Crypt_HashAlgoId_Unknown=-1,
00039   GWEN_Crypt_HashAlgoId_None=0,
00040   GWEN_Crypt_HashAlgoId_Any,
00042   GWEN_Crypt_HashAlgoId_Sha1,
00044   GWEN_Crypt_HashAlgoId_Rmd160,
00046   GWEN_Crypt_HashAlgoId_Md5,
00047   GWEN_Crypt_HashAlgoId_Sha256,
00048 } GWEN_CRYPT_HASHALGOID;
00049 
00050 
00051 #include <gwenhywfar/db.h>
00052 
00053 
00054 #ifdef __cplusplus
00055 extern "C" {
00056 #endif
00057 
00058 GWENHYWFAR_API GWEN_CRYPT_HASHALGOID GWEN_Crypt_HashAlgoId_fromString(const char *s);
00059 GWENHYWFAR_API const char *GWEN_Crypt_HashAlgoId_toString(GWEN_CRYPT_HASHALGOID a);
00060 
00061 
00062 GWENHYWFAR_API GWEN_CRYPT_HASHALGO *GWEN_Crypt_HashAlgo_new(GWEN_CRYPT_HASHALGOID id);
00063 GWENHYWFAR_API GWEN_CRYPT_HASHALGO *GWEN_Crypt_HashAlgo_dup(const GWEN_CRYPT_HASHALGO *a);
00064 GWENHYWFAR_API GWEN_CRYPT_HASHALGO *GWEN_Crypt_HashAlgo_fromDb(GWEN_DB_NODE *db);
00065 GWENHYWFAR_API int GWEN_Crypt_HashAlgo_toDb(const GWEN_CRYPT_HASHALGO *a, GWEN_DB_NODE *db);
00066 GWENHYWFAR_API void GWEN_Crypt_HashAlgo_Attach(GWEN_CRYPT_HASHALGO *a);
00067 GWENHYWFAR_API void GWEN_Crypt_HashAlgo_free(GWEN_CRYPT_HASHALGO *a);
00068 
00069 GWENHYWFAR_API GWEN_CRYPT_HASHALGOID GWEN_Crypt_HashAlgo_GetId(const GWEN_CRYPT_HASHALGO *a);
00070 GWENHYWFAR_API uint8_t *GWEN_Crypt_HashAlgo_GetInitVectorPtr(const GWEN_CRYPT_HASHALGO *a);
00071 GWENHYWFAR_API uint32_t GWEN_Crypt_HashAlgo_GetInitVectorLen(const GWEN_CRYPT_HASHALGO *a);
00072 GWENHYWFAR_API int GWEN_Crypt_HashAlgo_SetInitVector(GWEN_CRYPT_HASHALGO *a,
00073                                                      const uint8_t *pv,
00074                                                      uint32_t lv);
00075 
00076 #ifdef __cplusplus
00077 }
00078 #endif
00079 
00080 
00081 #endif
00082