]> git.stg.codes - stg.git/blob - stglibs/crypto.lib/include/stg/ag_md5.h
Merge branch 'stg-2.409-radius'
[stg.git] / stglibs / crypto.lib / include / stg / ag_md5.h
1 #ifndef _MD5_H
2 #define _MD5_H
3
4 #include <time.h>
5
6 #include "stg/os_int.h"
7
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11
12 struct MD5Context {
13         uint32_t buf[4];
14         uint32_t bits[2];
15         unsigned char in[64];
16 };
17
18 typedef struct MD5Context MD5_CTX;
19
20 char *crypt_make_salt(void);
21 void byteReverse(unsigned char*, unsigned);
22 void MD5Init(struct MD5Context *ctx);
23 void MD5Update(struct MD5Context*, char const*, unsigned);
24 void MD5Final(unsigned char digest[16], struct MD5Context *ctx);
25 void MD5Transform(uint32_t buf[4], uint32_t const in[16]);
26 char *libshadow_md5_crypt(const char*, const char*);
27 char *pw_encrypt(const char*, const char*);
28
29 /* AG functions */
30 char *make_ag_hash(time_t salt, const char *clear);
31 int check_ag_hash(time_t salt, const char *clear, const char *hash);
32
33 #ifdef __cplusplus
34 }
35 #endif
36
37 #endif