|
Packit |
13e0ca |
/* Declaration of functions and data types used for MD5 sum computing
|
|
Packit |
13e0ca |
library functions.
|
|
Packit |
13e0ca |
|
|
Packit |
13e0ca |
Copyright (C) 1995-2017 Free Software Foundation, Inc.
|
|
Packit |
13e0ca |
|
|
Packit |
13e0ca |
This library is free software; you can redistribute it and/or
|
|
Packit |
13e0ca |
modify it under the terms of the GNU Lesser General Public License
|
|
Packit |
13e0ca |
as published by the Free Software Foundation; either version 2.1 of
|
|
Packit |
13e0ca |
the License, or (at your option) any later version.
|
|
Packit |
13e0ca |
|
|
Packit |
13e0ca |
This library is distributed in the hope that it will be useful,
|
|
Packit |
13e0ca |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
13e0ca |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit |
13e0ca |
GNU Lesser General Public License for more details.
|
|
Packit |
13e0ca |
|
|
Packit |
13e0ca |
You should have received a copy of the GNU Lesser General Public
|
|
Packit |
13e0ca |
License along with this library; if not, see
|
|
Packit |
13e0ca |
<https://www.gnu.org/licenses/>. */
|
|
Packit |
13e0ca |
|
|
Packit |
13e0ca |
#ifndef _CRYPT_ALG_MD5_H
|
|
Packit |
13e0ca |
#define _CRYPT_ALG_MD5_H 1
|
|
Packit |
13e0ca |
|
|
Packit |
13e0ca |
/* Structure to save state of computation between the single steps. */
|
|
Packit |
13e0ca |
struct md5_ctx
|
|
Packit |
13e0ca |
{
|
|
Packit |
13e0ca |
uint32_t A;
|
|
Packit |
13e0ca |
uint32_t B;
|
|
Packit |
13e0ca |
uint32_t C;
|
|
Packit |
13e0ca |
uint32_t D;
|
|
Packit |
13e0ca |
|
|
Packit |
13e0ca |
uint64_t total;
|
|
Packit |
13e0ca |
uint32_t buflen;
|
|
Packit |
13e0ca |
uint32_t correct_words[16];
|
|
Packit |
13e0ca |
unsigned char buffer[128];
|
|
Packit |
13e0ca |
};
|
|
Packit |
13e0ca |
|
|
Packit |
13e0ca |
/* Initialize structure containing state of computation.
|
|
Packit |
13e0ca |
(RFC 1321, 3.3: Step 3) */
|
|
Packit |
13e0ca |
extern void md5_init_ctx (struct md5_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 md5_process_bytes (const void *buffer, size_t len,
|
|
Packit |
13e0ca |
struct md5_ctx *ctx);
|
|
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 *md5_finish_ctx (struct md5_ctx *ctx, void *resbuf);
|
|
Packit |
13e0ca |
|
|
Packit |
13e0ca |
#endif /* alg-md5.h */
|