Upgrade bytes-kt
All checks were successful
/ test (pull_request) Successful in 44s

This commit is contained in:
2026-02-14 16:32:50 +01:00
parent 902cb060a1
commit cb3ff7ec6c
13 changed files with 91 additions and 91 deletions

View File

@@ -2,7 +2,7 @@ package com.infendro.hash.sha2
import com.infendro.bytes.bytearray.copyInto
import com.infendro.bytes.intarray.copyInto
import com.infendro.bytes.ulong.copyInto
import com.infendro.bytes.long.copyInto
import com.infendro.hash.HashFunction
import com.infendro.hash.util.align
@@ -43,12 +43,12 @@ object `SHA-256` : HashFunction {
}
internal fun pad(value: ByteArray): ByteArray {
val length = value.size.toULong() * 8UL
val length = value.size * 8L
val size = (value.size + 9).align(block)
return ByteArray(size).also {
value.copyInto(it)
it[value.size] = 0x80U.toByte()
it[value.size] = -0x80
length.copyInto(it, size - 8)
}
}