FreeTDS API: include/md4.h Source File

FreeTDS API

- Main Page
- Related Pages
- Modules
- Classes
- Files

- File List
- File Members

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
19 typedef struct MD4Context MD4_CTX;
20
21 #include <freetds/popvis.h>
22
23 #else
24
25 #include <nettle/md4.h>
26
27 typedef struct md4_ctx MD4_CTX;
28
29 static inline void MD4Init(MD4_CTX *ctx)
30 {
31 nettle_md4_init(ctx);
32 }
33
34 static inline void MD4Update(MD4_CTX *ctx, unsigned char const *buf, size_t len)
35 {
36 nettle_md4_update(ctx, len, buf);
37 }
38
39 static inline void MD4Final(MD4_CTX *ctx, unsigned char *digest)
40 {
41 nettle_md4_digest(ctx, 16, digest);
42 }
43
44
45 #endif
46
47 #endif /* !MD4_H */
MD4Context
Definition: md4.h:8