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

@@ -43,7 +43,7 @@ object `SHA-512` : HashFunction {
0x4cc5d4becb3e42b6UL, 0x597f299cfc657e2aUL, 0x5fcb6fab3ad6faecUL, 0x6c44198c4a475817UL,
).asLongArray()
override fun hashInto(value: ByteArray, destination: ByteArray) {
override fun hashInto(value: ByteArray, destination: ByteArray, destinationOffset: Int) {
val input = pad(value)
val h = initial.copyOf()
val w = LongArray(80)
@@ -52,7 +52,7 @@ object `SHA-512` : HashFunction {
for (i in input.indices step block) {
process(h, input, i, w, v)
}
h.copyInto(destination)
h.copyInto(destination, destinationOffset)
}
internal fun pad(value: ByteArray): ByteArray {