FreeTDS API

Loading...
Searching...
No Matches
md4.h
1#ifndef _tdsguard_bJRBdagK4r9w58mnUbyvA0_
2#define _tdsguard_bJRBdagK4r9w58mnUbyvA0_
3
4#ifndef HAVE_NETTLE
5
6#include <freetds/pushvis.h>
7
8 struct MD4Context
9{
10 uint32_t buf[4];
11 uint64_t bytes;
12 uint32_t in[16];
13};
14
15 void MD4Init(struct MD4Context *context);
16 void MD4Update(struct MD4Context *context, const uint8_t *buf, size_t len);
17 void MD4Final(struct MD4Context *context, uint8_t *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, const uint8_t *buf, size_t len)
35{
36 nettle_md4_update(ctx, len, buf);
37}
38
39 static inline void MD4Final(MD4_CTX *ctx, uint8_t *digest)
40{
41 nettle_md4_digest(ctx, 16, digest);
42}
43
44
45#endif
46
47#endif /* !_tdsguard_bJRBdagK4r9w58mnUbyvA0_ */
MD4Context
Definition md4.h:9