61 */ |
61 */ |
62 |
62 |
63 typedef unsigned char md5_byte_t; /* 8-bit byte */ |
63 typedef unsigned char md5_byte_t; /* 8-bit byte */ |
64 typedef unsigned int md5_word_t; /* 32-bit word */ |
64 typedef unsigned int md5_word_t; /* 32-bit word */ |
65 |
65 |
66 /* Define the state of the MD5 Algorithm. */ |
66 /*! Define the state of the MD5 Algorithm. */ |
67 typedef struct md5_state_s { |
67 typedef struct md5_state_s { |
68 md5_word_t count[2]; /* message length in bits, lsw first */ |
68 md5_word_t count[2]; /*! message length in bits, lsw first */ |
69 md5_word_t abcd[4]; /* digest buffer */ |
69 md5_word_t abcd[4]; /*! digest buffer */ |
70 md5_byte_t buf[64]; /* accumulate block */ |
70 md5_byte_t buf[64]; /*! accumulate block */ |
71 } md5_state_t; |
71 } md5_state_t; |
72 |
72 |
73 #ifdef __cplusplus |
73 #ifdef __cplusplus |
74 extern "C" |
74 extern "C" |
75 { |
75 { |
76 #endif |
76 #endif |
77 |
77 |
78 /* Initialize the algorithm. */ |
78 /*! Initialize the algorithm. */ |
79 void md5_init(md5_state_t *pms); |
79 void md5_init(md5_state_t *pms); |
80 |
80 |
81 /* Append a string to the message. */ |
81 /*! Append a string to the message. */ |
82 void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes); |
82 void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes); |
83 |
83 |
84 /* Finish the message and return the digest. */ |
84 /*! Finish the message and return the digest. */ |
85 void md5_finish(md5_state_t *pms, md5_byte_t digest[16]); |
85 void md5_finish(md5_state_t *pms, md5_byte_t digest[16]); |
86 |
86 |
87 #ifdef __cplusplus |
87 #ifdef __cplusplus |
88 } /* end extern "C" */ |
88 } /* end extern "C" */ |
89 #endif |
89 #endif |