md4.h revision 70bb16e72afdcd87b6294501d035d5ba1e35af5f
b90c23a9862b91594959b918b035d73f7bc0b265Timo Sirainen/*
b90c23a9862b91594959b918b035d73f7bc0b265Timo Sirainen * This is an OpenSSL-compatible implementation of the RSA Data Security,
b90c23a9862b91594959b918b035d73f7bc0b265Timo Sirainen * Inc. MD4 Message-Digest Algorithm.
b90c23a9862b91594959b918b035d73f7bc0b265Timo Sirainen *
b90c23a9862b91594959b918b035d73f7bc0b265Timo Sirainen * Written by Solar Designer <solar@openwall.com> in 2001, and placed in
b90c23a9862b91594959b918b035d73f7bc0b265Timo Sirainen * the public domain. See md4.c for more information.
b90c23a9862b91594959b918b035d73f7bc0b265Timo Sirainen */
b90c23a9862b91594959b918b035d73f7bc0b265Timo Sirainen
b90c23a9862b91594959b918b035d73f7bc0b265Timo Sirainen#ifndef __MD4_H
b90c23a9862b91594959b918b035d73f7bc0b265Timo Sirainen#define __MD4_H
b90c23a9862b91594959b918b035d73f7bc0b265Timo Sirainen
b90c23a9862b91594959b918b035d73f7bc0b265Timo Sirainen#define MD4_RESULTLEN (128/8)
b90c23a9862b91594959b918b035d73f7bc0b265Timo Sirainen
b90c23a9862b91594959b918b035d73f7bc0b265Timo Sirainenstruct md4_context {
b90c23a9862b91594959b918b035d73f7bc0b265Timo Sirainen uint_fast32_t lo, hi;
b90c23a9862b91594959b918b035d73f7bc0b265Timo Sirainen uint_fast32_t a, b, c, d;
b90c23a9862b91594959b918b035d73f7bc0b265Timo Sirainen unsigned char buffer[64];
b90c23a9862b91594959b918b035d73f7bc0b265Timo Sirainen uint_fast32_t block[MD4_RESULTLEN];
b90c23a9862b91594959b918b035d73f7bc0b265Timo Sirainen};
b90c23a9862b91594959b918b035d73f7bc0b265Timo Sirainen
b90c23a9862b91594959b918b035d73f7bc0b265Timo Sirainenvoid md4_init(struct md4_context *ctx);
b90c23a9862b91594959b918b035d73f7bc0b265Timo Sirainenvoid md4_update(struct md4_context *ctx, const void *data, size_t size);
b90c23a9862b91594959b918b035d73f7bc0b265Timo Sirainenvoid md4_final(struct md4_context *ctx, unsigned char result[MD4_RESULTLEN]);
b90c23a9862b91594959b918b035d73f7bc0b265Timo Sirainen
b90c23a9862b91594959b918b035d73f7bc0b265Timo Sirainenvoid md4_get_digest(const void *data, size_t size,
b90c23a9862b91594959b918b035d73f7bc0b265Timo Sirainen unsigned char result[MD4_RESULTLEN]);
b90c23a9862b91594959b918b035d73f7bc0b265Timo Sirainen
b90c23a9862b91594959b918b035d73f7bc0b265Timo Sirainen#endif
b90c23a9862b91594959b918b035d73f7bc0b265Timo Sirainen