refactor math utility
All checks were successful
/ test (pull_request) Successful in 32s

This commit is contained in:
2026-01-17 15:44:50 +01:00
parent 62d6b8b01e
commit 4331145c34
12 changed files with 26 additions and 27 deletions

View File

@@ -4,7 +4,7 @@ import com.infendro.bytes.ByteOrder.LITTLE_ENDIAN
import com.infendro.bytes.bytearray.copyInto
import com.infendro.bytes.longarray.toByteArray
import com.infendro.hash.HashFunction
import com.infendro.hash.util.ceilPow2
import com.infendro.hash.util.align
class Blake2b(
override val bytes: Int,
@@ -53,7 +53,7 @@ class Blake2b(
}
private fun pad(value: ByteArray): ByteArray {
val size = maxOf(ceilPow2(value.size, block), block)
val size = maxOf(value.size.align(block), block)
val result = ByteArray(size)
value.copyInto(result)
return result