void hash_buffer(struct mdfour *md, const void *s, size_t len);
char *hash_result(struct mdfour *md);
void hash_result_as_bytes(struct mdfour *md, unsigned char *out);
+int hash_equal(struct mdfour *md1, struct mdfour *md2);
void hash_delimiter(struct mdfour *md, const char* type);
void hash_string(struct mdfour *md, const char *s);
void hash_int(struct mdfour *md, int x);
mdfour_result(md, out);
}
+int
+hash_equal(struct mdfour *md1, struct mdfour *md2)
+{
+ unsigned char sum1[16], sum2[16];
+ hash_result_as_bytes(md1, sum1);
+ hash_result_as_bytes(md2, sum2);
+ return memcmp(sum1, sum2, sizeof(sum1)) == 0;
+}
+
/*
* Hash some data that is unlikely to occur in the input. The idea is twofold:
*