Line data Source code
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 : #include <nettle/version.h>
27 :
28 : typedef struct md4_ctx MD4_CTX;
29 :
30 : static inline void MD4Init(MD4_CTX *ctx)
31 : {
32 405 : nettle_md4_init(ctx);
33 : }
34 :
35 : static inline void MD4Update(MD4_CTX *ctx, const uint8_t *buf, size_t len)
36 : {
37 430 : nettle_md4_update(ctx, len, buf);
38 : }
39 :
40 : static inline void MD4Final(MD4_CTX *ctx, uint8_t *digest)
41 : {
42 : #if defined(NETTLE_VERSION_MAJOR) && NETTLE_VERSION_MAJOR >= 4
43 : nettle_md4_digest(ctx, digest);
44 : #else
45 405 : nettle_md4_digest(ctx, 16, digest);
46 : #endif
47 : }
48 :
49 :
50 : #endif
51 :
52 : #endif /* !_tdsguard_bJRBdagK4r9w58mnUbyvA0_ */
|