BeeCrypt 4.2.1
md5.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2000, 2002 X-Way Rights BV
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 */
19
25
26#ifndef _MD5_H
27#define _MD5_H
28
29#include "beecrypt/beecrypt.h"
30
34#ifdef __cplusplus
36#else
37struct _md5Param
38#endif
39{
42 uint32_t h[4];
45 uint32_t data[16];
50 #if (MP_WBITS == 64)
52 #elif (MP_WBITS == 32)
53 mpw length[2];
54 #else
55 # error
56 #endif
61 uint32_t offset;
62};
63
64#ifndef __cplusplus
65typedef struct _md5Param md5Param;
66#endif
67
68#ifdef __cplusplus
69extern "C" {
70#endif
71
75extern BEECRYPTAPI const hashFunction md5;
76
85
94
104int md5Update (md5Param* mp, const byte* data, size_t size);
105
114int md5Digest (md5Param* mp, byte* digest);
115
116#ifdef __cplusplus
117}
118#endif
119
120#endif
#define BEECRYPTAPI
Definition api.h:52
uint64_t mpw
Definition api.h:87
BeeCrypt API, headers.
int md5Digest(md5Param *mp, byte *digest)
This function finishes the current hash computation and copies the digest value into digest.
void md5Process(md5Param *mp)
int md5Update(md5Param *mp, const byte *data, size_t size)
This function should be used to pass successive blocks of data to be hashed.
int md5Reset(md5Param *mp)
This function resets the parameter block so that it's ready for a new hash.
const hashFunction md5
Holds the full API description of the MD5 algorithm.
Definition beecrypt.h:305
Holds all the parameters necessary for the MD5 algorithm.
Definition md5.h:39
mpw length[1]
Multi-precision integer counter for the bits that have been processed so far.
Definition md5.h:51
uint32_t data[16]
Definition md5.h:45
uint32_t h[4]
Definition md5.h:42
uint32_t offset
Offset into data; points to the place where new data will be copied before it is processed.
Definition md5.h:61