mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-28 19:06:42 -05:00
Adds a random hash seed.
This commit is contained in:
parent
548e90c30f
commit
4455ba7e4f
14 changed files with 120 additions and 29 deletions
4
check.c
4
check.c
|
|
@ -68,7 +68,7 @@ static int blockcmp(struct snapraid_state* state, struct snapraid_block* block,
|
|||
size = block_file_size(block, state->block_size);
|
||||
|
||||
/* now compute the hash of the valid part */
|
||||
memhash(state->hash, hash, buffer, size);
|
||||
memhash(state->hash, state->hashseed, hash, buffer, size);
|
||||
|
||||
/* compare the hash */
|
||||
if (memcmp(hash, block->hash, HASH_SIZE) != 0) {
|
||||
|
|
@ -700,7 +700,7 @@ static int state_check_process(struct snapraid_state* state, int check, int fix,
|
|||
/* if the block has the hash */
|
||||
if (block_state == BLOCK_STATE_BLK) {
|
||||
/* compute the hash of the block just read */
|
||||
memhash(state->hash, hash, buffer[j], read_size);
|
||||
memhash(state->hash, state->hashseed, hash, buffer[j], read_size);
|
||||
|
||||
/* compare the hash */
|
||||
if (memcmp(hash, block->hash, HASH_SIZE) != 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue