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

@@ -17,7 +17,7 @@ object `SHA-384` : HashFunction {
0xdb0c2e0d64f98fa7UL, 0x47b5481dbefa4fa4UL,
).asLongArray()
override fun hashInto(value: ByteArray, destination: ByteArray) {
override fun hashInto(value: ByteArray, destination: ByteArray, destinationOffset: Int) {
val input = `SHA-512`.pad(value)
val h = initial.copyOf()
val w = LongArray(80)
@@ -26,6 +26,6 @@ object `SHA-384` : HashFunction {
for (i in input.indices step block) {
`SHA-512`.process(h, input, i, w, v)
}
h.copyInto(destination, endIndex = 6)
h.copyInto(destination, destinationOffset, endIndex = 6)
}
}