fix incremental sha512

This commit is contained in:
Matthias J. Kannwischer 2019-09-10 11:27:37 +02:00
parent d83d4a4bf1
commit 6ee774a593

View File

@ -561,7 +561,7 @@ void sha224_inc_blocks(sha224ctx *state, const uint8_t *in, size_t inblocks) {
void sha512_inc_blocks(sha512ctx *state, const uint8_t *in, size_t inblocks) { void sha512_inc_blocks(sha512ctx *state, const uint8_t *in, size_t inblocks) {
uint64_t bytes = load_bigendian_64(state->ctx + 64); uint64_t bytes = load_bigendian_64(state->ctx + 64);
crypto_hashblocks_sha256(state->ctx, in, 128 * inblocks); crypto_hashblocks_sha512(state->ctx, in, 128 * inblocks);
bytes += 128 * inblocks; bytes += 128 * inblocks;
store_bigendian_64(state->ctx + 64, bytes); store_bigendian_64(state->ctx + 64, bytes);