25 lines
516 B
C
25 lines
516 B
C
#ifndef MD5_H
|
|
#define MD5_H
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
struct md5_ctx
|
|
{
|
|
uint32_t state[4];
|
|
uint64_t count;
|
|
uint8_t buf[64];
|
|
};
|
|
|
|
void md5_init(void *ctx);
|
|
void md5_update(void *ctx, const uint8_t *data, size_t len);
|
|
void md5_final(void *ctx, uint8_t *out);
|
|
|
|
/* RFC 1321 — per-step sine-derived constants (64 values) */
|
|
extern const uint32_t g_md5_T[64];
|
|
|
|
/* RFC 1321 — per-step left-rotation amounts (4 rounds x 4 values, each
|
|
* repeated 4 times) */
|
|
extern const uint32_t g_md5_s[64];
|
|
|
|
#endif
|