diff options
Diffstat (limited to 'Utilities/cmlibrhash/librhash/md5.h')
-rw-r--r-- | Utilities/cmlibrhash/librhash/md5.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Utilities/cmlibrhash/librhash/md5.h b/Utilities/cmlibrhash/librhash/md5.h new file mode 100644 index 0000000..1af6f13 --- /dev/null +++ b/Utilities/cmlibrhash/librhash/md5.h @@ -0,0 +1,31 @@ +/* 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 */ + +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]); + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* MD5_HIDER */ |