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