Add new memflip() function to fix block flipping a bit.

Unfortunately it takes too mutch time, about 80 seconds a call,
despite the optimization of saving the intermediate hash state.
This commit is contained in:
Andrea Mazzoleni 2015-05-04 22:55:04 +02:00
parent 246c1d3b72
commit 09fa4af509
4 changed files with 371 additions and 84 deletions

View file

@ -118,6 +118,13 @@ void crc32c_init(void);
*/
void memhash(unsigned kind, const unsigned char* seed, void* digest, const void* src, unsigned size);
/**
* Flips some bit in the data to make it to match the HASH.
* Seed is a 128 bit vector.
* Returns 0 on success.
*/
int memflip(unsigned kind, const unsigned char* seed, const void* digest, void* src, unsigned size);
/**
* Return the hash name.
*/