|
|
@@ -256,7 +256,7 @@ extension SHA3: Updatable {
|
|
|
|
|
|
var processedBytes = 0
|
|
|
for chunk in BytesSequence(chunkSize: self.variant.blockSize, data: self.accumulated) {
|
|
|
- if (isLast || self.accumulated.count >= self.variant.blockSize) {
|
|
|
+ if (isLast || (self.accumulated.count - processedBytes) >= self.variant.blockSize) {
|
|
|
self.process(block: chunk.toUInt64Array(), currentHash: &self.accumulatedHash)
|
|
|
processedBytes += chunk.count
|
|
|
}
|