return n;
}
-static uint32 get_file_hash_index(struct manifest *mf,
- char *path,
- struct file_hash *file_hash,
- struct hashtable *mf_files,
- struct hashtable *mf_file_infos)
+static uint32_t get_file_hash_index(struct manifest *mf,
+ char *path,
+ struct file_hash *file_hash,
+ struct hashtable *mf_files,
+ struct hashtable *mf_file_infos)
{
struct file_info fi;
uint32_t *fi_index;
#define ROUND3(a,b,c,d,k,s) a = lshift((a + H(b,c,d) + M[k] + 0x6ED9EBA1)&MASK32,s)
/* this applies md4 to 64 byte chunks */
-static void mdfour64(uint32 *M)
+static void mdfour64(uint32_t *M)
{
- uint32 AA, BB, CC, DD;
- uint32 A,B,C,D;
+ uint32_t AA, BB, CC, DD;
+ uint32_t A,B,C,D;
A = m->A; B = m->B; C = m->C; D = m->D;
AA = A; BB = B; CC = C; DD = D;
m->A = A; m->B = B; m->C = C; m->D = D;
}
-static void copy64(uint32 *M, const unsigned char *in)
+static void copy64(uint32_t *M, const unsigned char *in)
{
int i;
(in[i*4+1]<<8) | (in[i*4+0]<<0);
}
-static void copy4(unsigned char *out,uint32 x)
+static void copy4(unsigned char *out, uint32_t x)
{
out[0] = x&0xFF;
out[1] = (x>>8)&0xFF;
static void mdfour_tail(const unsigned char *in, int n)
{
unsigned char buf[128];
- uint32 M[16];
- uint32 b;
+ uint32_t M[16];
+ uint32_t b;
m->totalN += n;
void mdfour_update(struct mdfour *md, const unsigned char *in, int n)
{
- uint32 M[16];
+ uint32_t M[16];
m = md;
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#ifndef MDFOUR_H
+#define MDFOUR_H
+
+#include <inttypes.h>
+
struct mdfour {
- uint32 A, B, C, D;
- uint32 totalN;
+ uint32_t A, B, C, D;
+ uint32_t totalN;
unsigned char tail[64];
unsigned tail_len;
};
void mdfour_update(struct mdfour *md, const unsigned char *in, int n);
void mdfour_result(struct mdfour *md, unsigned char *out);
void mdfour(unsigned char *out, const unsigned char *in, int n);
+
+#endif