blake2b-ref: memcpy() -> memmove() for overlapping regions
This commit is contained in:
parent
d7edf5c34b
commit
136af03cc3
@ -395,7 +395,7 @@ int blake2b_final( blake2b_state *S, uint8_t *out, uint8_t outlen )
|
|||||||
blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES );
|
blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES );
|
||||||
blake2b_compress( S, S->buf );
|
blake2b_compress( S, S->buf );
|
||||||
S->buflen -= BLAKE2B_BLOCKBYTES;
|
S->buflen -= BLAKE2B_BLOCKBYTES;
|
||||||
memcpy( S->buf, S->buf + BLAKE2B_BLOCKBYTES, S->buflen );
|
memmove( S->buf, S->buf + BLAKE2B_BLOCKBYTES, S->buflen );
|
||||||
}
|
}
|
||||||
|
|
||||||
blake2b_increment_counter( S, S->buflen );
|
blake2b_increment_counter( S, S->buflen );
|
||||||
|
Loading…
Reference in New Issue
Block a user