diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 17:36:47 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 17:36:47 +0000 |
commit | 0441d265f2bb9da249c7abf333f0f771fadb4ab5 (patch) | |
tree | 3f3789daa2f6db22da6e55e92bee0062a7d613fe /src/lib/md5.h | |
parent | Initial commit. (diff) | |
download | dovecot-0441d265f2bb9da249c7abf333f0f771fadb4ab5.tar.xz dovecot-0441d265f2bb9da249c7abf333f0f771fadb4ab5.zip |
Adding upstream version 1:2.3.21+dfsg1.upstream/1%2.3.21+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/lib/md5.h')
-rw-r--r-- | src/lib/md5.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/lib/md5.h b/src/lib/md5.h new file mode 100644 index 0000000..682a6c5 --- /dev/null +++ b/src/lib/md5.h @@ -0,0 +1,33 @@ +/* + * This is an OpenSSL-compatible implementation of the RSA Data Security, + * Inc. MD5 Message-Digest Algorithm. + * + * Written by Solar Designer <solar@openwall.com> in 2001, and placed in + * the public domain. See md5.c for more information. + */ + +#ifndef MD5_H +#define MD5_H + +#include "hash-method.h" + +#define MD5_RESULTLEN (128/8) + +struct md5_context { + uint_fast32_t lo, hi; + uint_fast32_t a, b, c, d; + unsigned char buffer[64]; + uint_fast32_t block[MD5_RESULTLEN]; +}; + +void md5_init(struct md5_context *ctx); +void md5_update(struct md5_context *ctx, const void *data, size_t size); +void md5_final(struct md5_context *ctx, + unsigned char result[STATIC_ARRAY MD5_RESULTLEN]); + +void md5_get_digest(const void *data, size_t size, + unsigned char result[STATIC_ARRAY MD5_RESULTLEN]); + +extern const struct hash_method hash_method_md5; + +#endif |