FreeTDS API: include/freetds/utils/md4.h Source File

FreeTDS API

Loading...
Searching...
No Matches
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 uint32_t buf[4];
11 uint64_t bytes;
12 uint32_t in[16];
13};
14
15void MD4Init(struct MD4Context *context);
16void MD4Update(struct MD4Context *context, const uint8_t *buf, size_t len);
17void MD4Final(struct MD4Context *context, uint8_t *digest);
18
19typedef struct MD4Context MD4_CTX;
20
21#include <freetds/popvis.h>
22
23#else
24
25#include <nettle/md4.h>
26
27typedef struct md4_ctx MD4_CTX;
28
29static inline void MD4Init(MD4_CTX *ctx)
30{
31 nettle_md4_init(ctx);
32}
33
34static inline void MD4Update(MD4_CTX *ctx, const uint8_t *buf, size_t len)
35{
36 nettle_md4_update(ctx, len, buf);
37}
38
39static 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 /* !MD4_H */
MD4Context
Definition md4.h:9