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.long.copyInto
import com.infendro.hash.HashFunction
import com.infendro.hash.util.ceil
import com.infendro.hash.util.align
open class Keccak(
override val bytes: Int,
@@ -52,7 +52,7 @@ open class Keccak(
}
private fun pad(value: ByteArray): ByteArray {
val size = ceil(value.size + 2, block)
val size = (value.size + 2).align(block)
val result = ByteArray(size)
value.copyInto(result)
result[value.size] = domain