|
Packit |
13e0ca |
/*
|
|
Packit |
13e0ca |
* This is an implementation of the RSA Data Security, Inc.
|
|
Packit |
13e0ca |
* MD4 Message-Digest Algorithm.
|
|
Packit |
13e0ca |
*
|
|
Packit |
13e0ca |
* Written by Solar Designer <solar@openwall.com> in 2001, and placed in
|
|
Packit |
13e0ca |
* the public domain. See md4.c for more information.
|
|
Packit |
13e0ca |
*/
|
|
Packit |
13e0ca |
|
|
Packit |
13e0ca |
#ifndef _CRYPT_ALG_MD4_H
|
|
Packit |
13e0ca |
#define _CRYPT_ALG_MD4_H 1
|
|
Packit |
13e0ca |
|
|
Packit |
13e0ca |
#include <stddef.h>
|
|
Packit |
13e0ca |
#include <stdint.h>
|
|
Packit |
13e0ca |
|
|
Packit |
13e0ca |
/* Structure to save state of computation between the single steps. */
|
|
Packit |
13e0ca |
struct md4_ctx
|
|
Packit |
13e0ca |
{
|
|
Packit |
13e0ca |
uint32_t lo, hi;
|
|
Packit |
13e0ca |
uint32_t a, b, c, d;
|
|
Packit |
13e0ca |
unsigned char buffer[64];
|
|
Packit |
13e0ca |
uint32_t block[16];
|
|
Packit |
13e0ca |
};
|
|
Packit |
13e0ca |
|
|
Packit |
13e0ca |
/* Initialize structure containing state of computation.
|
|
Packit |
13e0ca |
(RFC 1320, 3.3: Step 3) */
|
|
Packit |
13e0ca |
extern void md4_init_ctx (struct md4_ctx *ctx);
|
|
Packit |
13e0ca |
|
|
Packit |
13e0ca |
/* Starting with the result of former calls of this function (or the
|
|
Packit |
13e0ca |
initialization function) update the context for the next LEN bytes
|
|
Packit |
13e0ca |
starting at BUFFER. LEN does not need to be a multiple of 64. */
|
|
Packit |
13e0ca |
extern void md4_process_bytes (const void *buffer, struct md4_ctx *ctx, size_t size);
|
|
Packit |
13e0ca |
|
|
Packit |
13e0ca |
/* Process the remaining bytes in the buffer and write the finalized
|
|
Packit |
13e0ca |
hash to RESBUF, which should point to 16 bytes of storage. All
|
|
Packit |
13e0ca |
data written to CTX is erased before returning from the function. */
|
|
Packit |
13e0ca |
extern void *md4_finish_ctx (struct md4_ctx *ctx, void *resbuf);
|
|
Packit |
13e0ca |
|
|
Packit |
13e0ca |
#endif
|