implement destination offset
All checks were successful
/ test (pull_request) Successful in 27s

This commit is contained in:
2026-01-22 12:18:22 +01:00
parent b00d231da5
commit 8535476674
16 changed files with 41 additions and 34 deletions

View File

@@ -19,7 +19,7 @@ object `Blake-224` : HashFunction {
0x64f98fa7U, 0xbefa4fa4U,
).asIntArray()
override fun hashInto(value: ByteArray, destination: ByteArray) {
override fun hashInto(value: ByteArray, destination: ByteArray, destinationOffset: Int) {
val length = value.size.toULong() * 8UL
val input = pad(value)
val h = initial.copyOf()
@@ -31,7 +31,7 @@ object `Blake-224` : HashFunction {
t += minOf(length - t, 512UL).toUInt()
`Blake-256`.compress(h, input, i, m, v, t)
}
h.copyInto(destination, endIndex = 7)
h.copyInto(destination, destinationOffset, endIndex = 7)
}
private fun pad(value: ByteArray): ByteArray {