NCBI C++ ToolKit
md5.h
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef MD5_H
2 #define MD5_H
3 
4 #ifndef HAVE_NETTLE
5 
6 #include <freetds/pushvis.h>
7 
8 /* Rename functions in order to avoid conflicts with other versions. */
9 #define MD5Init FTDS100_MD5Init
10 #define MD5Update FTDS100_MD5Update
11 #define MD5Final FTDS100_MD5Final
12 
13 struct MD5Context {
16  unsigned char in[64];
17 };
18 
19 void MD5Init(struct MD5Context *context);
20 void MD5Update(struct MD5Context *context, unsigned char const *buf, size_t len);
21 void MD5Final(struct MD5Context *context, unsigned char *digest);
22 
23 /*
24  * This is needed to make RSAREF happy on some MS-DOS compilers.
25  */
26 typedef struct MD5Context MD5_CTX;
27 
28 #include <freetds/popvis.h>
29 
30 #else
31 
32 #include <nettle/md5.h>
33 
34 typedef struct md5_ctx MD5_CTX;
35 
36 static inline void MD5Init(MD5_CTX *ctx)
37 {
38  nettle_md5_init(ctx);
39 }
40 
41 static inline void MD5Update(MD5_CTX *ctx, unsigned char const *buf, size_t len)
42 {
43  nettle_md5_update(ctx, len, buf);
44 }
45 
46 static inline void MD5Final(MD5_CTX *ctx, unsigned char *digest)
47 {
48  nettle_md5_digest(ctx, 16, digest);
49 }
50 
51 #endif
52 
53 #endif /* !MD5_H */
CS_CONTEXT * ctx
Definition: t0006.c:12
tds_sysdep_uint64_type TDS_UINT8
Definition: tds.h:154
tds_sysdep_uint32_type TDS_UINT
Definition: tds.h:150
#define MD5Update
Definition: md5.h:10
#define MD5Init
Definition: md5.h:9
#define MD5Final
Definition: md5.h:11
char * buf
int len
Definition: md5.h:13
TDS_UINT buf[4]
Definition: md5.h:14
TDS_UINT8 bytes
Definition: md5.h:15
unsigned char in[64]
Definition: md5.h:16
static CS_CONTEXT * context
Definition: will_convert.c:21
Modified on Wed Jul 24 17:20:34 2024 by modify_doxy.py rev. 669887