BeeCrypt  4.2.1
md4.h
Go to the documentation of this file.
1 /*
2  * This library is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU Lesser General Public
4  * License as published by the Free Software Foundation; either
5  * version 2.1 of the License, or (at your option) any later version.
6  *
7  * This library is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10  * Lesser General Public License for more details.
11  *
12  * You should have received a copy of the GNU Lesser General Public
13  * License along with this library; if not, write to the Free Software
14  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15  *
16  */
17 
25 #ifndef _MD4_H
26 #define _MD4_H
27 
28 #include "beecrypt/beecrypt.h"
29 
33 #ifdef __cplusplus
35 #else
36 struct _md4Param
37 #endif
38 {
41  uint32_t h[4];
44  uint32_t data[16];
49  #if (MP_WBITS == 64)
50  mpw length[1];
51  #elif (MP_WBITS == 32)
52  mpw length[2];
53  #else
54  # error
55  #endif
56 
60  uint32_t offset;
61 };
62 
63 #ifndef __cplusplus
64 typedef struct _md4Param md4Param;
65 #endif
66 
67 #ifdef __cplusplus
68 extern "C" {
69 #endif
70 
74 /*@unchecked@*/ /*@observer@*/
75 extern BEECRYPTAPI const hashFunction md4;
76 
84 void md4Process(md4Param* mp)
85  /*@modifies mp @*/;
86 
94 int md4Reset (md4Param* mp)
95  /*@modifies mp @*/;
96 
106 int md4Update (md4Param* mp, const byte* data, size_t size)
107  /*@modifies mp @*/;
108 
117 int md4Digest (md4Param* mp, byte* digest)
118  /*@modifies mp digest @*/;
119 
120 #ifdef __cplusplus
121 }
122 #endif
123 
124 #endif
int md4Update(md4Param *mp, const byte *data, size_t size)
This function should be used to pass successive blocks of data to be hashed.
void md4Process(md4Param *mp)
int md4Digest(md4Param *mp, byte *digest)
This function finishes the current hash computation and copies the digest value into digest...
int md4Reset(md4Param *mp)
This function resets the parameter block so that it's ready for a new hash.
uint32_t offset
Offset into data; points to the place where new data will be copied before it is processed.
Definition: md4.h:60
BeeCrypt API, headers.
uint8_t byte
Definition: api.h:72
const hashFunction md4
Holds the full API description of the MD4 algorithm.
#define BEECRYPTAPI
Definition: api.h:52
Holds all the parameters necessary for the MD4 algorithm.
Definition: md4.h:34
Definition: beecrypt.h:301
uint32_t mpw
Definition: api.h:94