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-384` : HashFunction {
override val block: Int
get() = 128
private val initial = ulongArrayOf(
0xcbbb9d5dc1059ed8UL, 0x629a292a367cd507UL,
0x9159015a3070dd17UL, 0x152fecd8f70e5939UL,
0x67332667ffc00b31UL, 0x8eb44a8768581511UL,
0xdb0c2e0d64f98fa7UL, 0x47b5481dbefa4fa4UL,
).asLongArray()
private val initial = longArrayOf(
-0x344462a23efa6128L, +0x629a292a367cd507L,
-0x6ea6fea5cf8f22e9L, +0x152fecd8f70e5939L,
+0x67332667ffc00b31L, -0x714bb57897a7eaefL,
-0x24f3d1f29b067059L, +0x47b5481dbefa4fa4L,
)
override fun hashInto(value: ByteArray, destination: ByteArray, destinationOffset: Int) {
val input = `SHA-512`.pad(value)
val h = initial.copyOf()
val w = LongArray(80)
val v = LongArray(8)
for (i in input.indices step block) {
`SHA-512`.process(h, input, i, w, v)
val block = input.sliceArray(i..<(i + block))
`SHA-512`.process(h, block)
}
h.copyInto(destination, destinationOffset, endIndex = 6)
}