FreeTDS API
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
md4.h
1 #ifndef MD4_H
2 #define MD4_H
3 
4 #ifndef HAVE_NETTLE
5 
6 #include <freetds/pushvis.h>
7 
8 struct MD4Context
9 {
10  TDS_UINT buf[4];
11  TDS_UINT8 bytes;
12  unsigned char in[64];
13 };
14 
15 void MD4Init(struct MD4Context *context);
16 void MD4Update(struct MD4Context *context, unsigned char const *buf, size_t len);
17 void MD4Final(struct MD4Context *context, unsigned char *digest);
18 void MD4Transform(TDS_UINT buf[4], TDS_UINT const in[16]);
19 
20 typedef struct MD4Context MD4_CTX;
21 
22 #include <freetds/popvis.h>
23 
24 #else
25 
26 #include <nettle/md4.h>
27 
28 typedef struct md4_ctx MD4_CTX;
29 
30 static inline void MD4Init(MD4_CTX *ctx)
31 {
32  nettle_md4_init(ctx);
33 }
34 
35 static inline void MD4Update(MD4_CTX *ctx, unsigned char const *buf, size_t len)
36 {
37  nettle_md4_update(ctx, len, buf);
38 }
39 
40 static inline void MD4Final(MD4_CTX *ctx, unsigned char *digest)
41 {
42  nettle_md4_digest(ctx, 16, digest);
43 }
44 
45 
46 #endif
47 
48 #endif /* !MD4_H */
Definition: md4.h:8