gwenhywfar  4.7.0beta
mdigest.h
Go to the documentation of this file.
1 /***************************************************************************
2  $RCSfile$
3  -------------------
4  cvs : $Id: crypttoken.h 1113 2007-01-10 09:14:16Z martin $
5  begin : Wed Mar 16 2005
6  copyright : (C) 2005 by Martin Preuss
7  email : martin@libchipcard.de
8 
9  ***************************************************************************
10  * Please see toplevel file COPYING for license details *
11  ***************************************************************************/
12 
13 
14 #ifndef GWENHYWFAR_MDIGEST_H
15 #define GWENHYWFAR_MDIGEST_H
16 
17 #include <gwenhywfar/list1.h>
18 #include <gwenhywfar/list2.h>
19 
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 typedef struct GWEN_MDIGEST GWEN_MDIGEST;
26 
27 
30 
31 
32 #include <gwenhywfar/hashalgo.h>
33 #include <gwenhywfar/stringlist.h>
34 
35 
36 
38 void GWEN_MDigest_free(GWEN_MDIGEST *md);
39 
42 
44 uint8_t *GWEN_MDigest_GetDigestPtr(GWEN_MDIGEST *md);
45 
47 unsigned int GWEN_MDigest_GetDigestSize(GWEN_MDIGEST *md);
48 
50 int GWEN_MDigest_Begin(GWEN_MDIGEST *md);
51 
53 int GWEN_MDigest_End(GWEN_MDIGEST *md);
54 
56 int GWEN_MDigest_Update(GWEN_MDIGEST *md, const uint8_t *buf, unsigned int l);
57 
58 
59 
60 
61 
62 
63 GWENHYWFAR_API GWEN_MDIGEST *GWEN_MDigest_Md5_new(void);
64 GWENHYWFAR_API GWEN_MDIGEST *GWEN_MDigest_Rmd160_new(void);
65 GWENHYWFAR_API GWEN_MDIGEST *GWEN_MDigest_Sha1_new(void);
66 GWENHYWFAR_API GWEN_MDIGEST *GWEN_MDigest_Sha256_new(void);
67 
68 
72 GWENHYWFAR_API int GWEN_MDigest_PBKDF2(GWEN_MDIGEST *md,
73  const char *password,
74  const uint8_t *pSalt,
75  uint32_t lSalt,
76  uint8_t *pKey,
77  uint32_t lKey,
78  uint32_t iterations);
79 
80 GWENHYWFAR_API int GWEN_MDigest_HashFileTree(GWEN_MDIGEST *md,
81  const char *folder,
82  const char *ignoreFile,
83  GWEN_STRINGLIST *sl);
84 
85 
98 int GWEN_MDigest_CheckFileTree(GWEN_MDIGEST *md,
99  const char *folder,
100  const char *checksumFile,
101  int strictCheck,
102  uint32_t pid);
103 
104 #ifdef __cplusplus
105 }
106 #endif
107 
108 
109 #endif
110 
111