32 lines
697 B
C
Raw Normal View History

2017-04-14 19:02:05 +02:00
/* md5.h */
#ifndef MD5_HIDER
#define MD5_HIDER
#include "ustd.h"
#ifdef __cplusplus
extern "C" {
#endif
#define md5_block_size 64
#define md5_hash_size 16
/* algorithm context */
typedef struct md5_ctx
{
unsigned message[md5_block_size / 4]; /* 512-bit buffer for leftovers */
uint64_t length; /* number of processed bytes */
unsigned hash[4]; /* 128-bit algorithm internal hashing state */
} md5_ctx;
/* hash functions */
2020-08-30 11:54:41 +02:00
void rhash_md5_init(md5_ctx* ctx);
void rhash_md5_update(md5_ctx* ctx, const unsigned char* msg, size_t size);
void rhash_md5_final(md5_ctx* ctx, unsigned char result[16]);
2017-04-14 19:02:05 +02:00
#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */
#endif /* MD5_HIDER */