c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen/*
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen * This is an OpenSSL-compatible implementation of the RSA Data Security,
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen * Inc. MD4 Message-Digest Algorithm.
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen *
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen * Written by Solar Designer <solar@openwall.com> in 2001, and placed in
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen * the public domain. See md4.c for more information.
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen */
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen
c25356d5978632df6203437e1953bcb29e0c736fTimo Sirainen#ifndef MD4_H
c25356d5978632df6203437e1953bcb29e0c736fTimo Sirainen#define MD4_H
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen
74ae32512357bdd4872bf160dc697ff7b54b54c5Timo Sirainen#include "hash-method.h"
74ae32512357bdd4872bf160dc697ff7b54b54c5Timo Sirainen
70bb16e72afdcd87b6294501d035d5ba1e35af5fTimo Sirainen#define MD4_RESULTLEN (128/8)
70bb16e72afdcd87b6294501d035d5ba1e35af5fTimo Sirainen
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainenstruct md4_context {
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen uint_fast32_t lo, hi;
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen uint_fast32_t a, b, c, d;
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen unsigned char buffer[64];
70bb16e72afdcd87b6294501d035d5ba1e35af5fTimo Sirainen uint_fast32_t block[MD4_RESULTLEN];
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen};
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainenvoid md4_init(struct md4_context *ctx);
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainenvoid md4_update(struct md4_context *ctx, const void *data, size_t size);
9625595c47c665f5aee57ebfcb1fcbe9ad1bf3a0Martti Rannanjärvivoid md4_final(struct md4_context *ctx,
9625595c47c665f5aee57ebfcb1fcbe9ad1bf3a0Martti Rannanjärvi unsigned char result[STATIC_ARRAY MD4_RESULTLEN]);
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen
70bb16e72afdcd87b6294501d035d5ba1e35af5fTimo Sirainenvoid md4_get_digest(const void *data, size_t size,
9625595c47c665f5aee57ebfcb1fcbe9ad1bf3a0Martti Rannanjärvi unsigned char result[STATIC_ARRAY MD4_RESULTLEN]);
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen
74ae32512357bdd4872bf160dc697ff7b54b54c5Timo Sirainenextern const struct hash_method hash_method_md4;
74ae32512357bdd4872bf160dc697ff7b54b54c5Timo Sirainen
c7480644202e5451fbed448508ea29a25cffc99cTimo Sirainen#endif