ARMv8 SHA-256: recalc data in SHA256 update

This commit is contained in:
Sean Parkinson
2021-04-01 17:01:21 +10:00
parent fd94d05b0a
commit e3c86f8f77

View File

@ -301,6 +301,7 @@ static WC_INLINE int Sha256Update(wc_Sha256* sha256, const byte* data, word32 le
add = (len + sha256->buffLen) - numBlocks * WC_SHA256_BLOCK_SIZE;
Sha256Transform(sha256, data, numBlocks);
data += numBlocks * WC_SHA256_BLOCK_SIZE - sha256->buffLen;
AddLength(sha256, WC_SHA256_BLOCK_SIZE * numBlocks);
@ -885,6 +886,7 @@ static WC_INLINE int Sha256Update(wc_Sha256* sha256, const byte* data, word32 le
add = (len + sha256->buffLen) - numBlocks * WC_SHA256_BLOCK_SIZE;
Sha256Transform(sha256, data, numBlocks);
data += numBlocks * WC_SHA256_BLOCK_SIZE - sha256->buffLen;
AddLength(sha256, WC_SHA256_BLOCK_SIZE * numBlocks);