remove unsigned support
All checks were successful
/ test (pull_request) Successful in 1m45s

This commit is contained in:
2026-02-08 14:04:41 +01:00
parent e138ec0b6d
commit 902cb060a1
38 changed files with 455 additions and 696 deletions

View File

@@ -10,21 +10,20 @@ object `SHA-224` : HashFunction {
override val block: Int
get() = 64
private val initial = uintArrayOf(
0xc1059ed8U, 0x367cd507U,
0x3070dd17U, 0xf70e5939U,
0xffc00b31U, 0x68581511U,
0x64f98fa7U, 0xbefa4fa4U,
).asIntArray()
private val initial = intArrayOf(
-0x3efa6128, +0x367cd507,
+0x3070dd17, -0x08f1a6c7,
-0x003ff4cf, +0x68581511,
+0x64f98fa7, -0x4105b05c,
)
override fun hashInto(value: ByteArray, destination: ByteArray, destinationOffset: Int) {
val input = `SHA-256`.pad(value)
val h = initial.copyOf()
val w = IntArray(64)
val v = IntArray(8)
for (i in input.indices step block) {
`SHA-256`.process(h, input, i, w, v)
val block = input.sliceArray(i..<(i + block))
`SHA-256`.process(h, block)
}
h.copyInto(destination, destinationOffset, endIndex = 7)
}