Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Kitware
GitHub Repository: Kitware/CMake
Path: blob/master/Utilities/cmlibrhash/librhash/md5.h
3150 views
1
/* md5.h */
2
#ifndef MD5_HIDER
3
#define MD5_HIDER
4
#include "ustd.h"
5
6
#ifdef __cplusplus
7
extern "C" {
8
#endif
9
10
#define md5_block_size 64
11
#define md5_hash_size 16
12
13
/* algorithm context */
14
typedef struct md5_ctx
15
{
16
unsigned message[md5_block_size / 4]; /* 512-bit buffer for leftovers */
17
uint64_t length; /* number of processed bytes */
18
unsigned hash[4]; /* 128-bit algorithm internal hashing state */
19
} md5_ctx;
20
21
/* hash functions */
22
23
void rhash_md5_init(md5_ctx* ctx);
24
void rhash_md5_update(md5_ctx* ctx, const unsigned char* msg, size_t size);
25
void rhash_md5_final(md5_ctx* ctx, unsigned char* result);
26
27
#ifdef __cplusplus
28
} /* extern "C" */
29
#endif /* __cplusplus */
30
31
#endif /* MD5_HIDER */
32
33