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

@@ -4,7 +4,7 @@ import kotlin.test.Test
import kotlin.test.assertContentEquals
import kotlin.test.assertEquals
class `SHA3-512 Test` {
class `SHA3-512_Test` {
val function = `SHA3-512`
@Test
@@ -16,27 +16,17 @@ class `SHA3-512 Test` {
@Test
fun `empty bytearray`() {
val expected = ubyteArrayOf(
0xa6U, 0x9fU, 0x73U, 0xccU,
0xa2U, 0x3aU, 0x9aU, 0xc5U,
0xc8U, 0xb5U, 0x67U, 0xdcU,
0x18U, 0x5aU, 0x75U, 0x6eU,
0x97U, 0xc9U, 0x82U, 0x16U,
0x4fU, 0xe2U, 0x58U, 0x59U,
0xe0U, 0xd1U, 0xdcU, 0xc1U,
0x47U, 0x5cU, 0x80U, 0xa6U,
0x15U, 0xb2U, 0x12U, 0x3aU,
0xf1U, 0xf5U, 0xf9U, 0x4cU,
0x11U, 0xe3U, 0xe9U, 0x40U,
0x2cU, 0x3aU, 0xc5U, 0x58U,
0xf5U, 0x00U, 0x19U, 0x9dU,
0x95U, 0xb6U, 0xd3U, 0xe3U,
0x01U, 0x75U, 0x85U, 0x86U,
0x28U, 0x1dU, 0xcdU, 0x26U,
).asByteArray()
val actual = function.hash(
ByteArray(0),
val expected = byteArrayOf(
-0x5a, -0x61, +0x73, -0x34, -0x5e, +0x3a, -0x66, -0x3b,
-0x38, -0x4b, +0x67, -0x24, +0x18, +0x5a, +0x75, +0x6e,
-0x69, -0x37, -0x7e, +0x16, +0x4f, -0x1e, +0x58, +0x59,
-0x20, -0x2f, -0x24, -0x3f, +0x47, +0x5c, -0x80, -0x5a,
+0x15, -0x4e, +0x12, +0x3a, -0x0f, -0x0b, -0x07, +0x4c,
+0x11, -0x1d, -0x17, +0x40, +0x2c, +0x3a, -0x3b, +0x58,
-0x0b, +0x00, +0x19, -0x63, -0x6b, -0x4a, -0x2d, -0x1d,
+0x01, +0x75, -0x7b, -0x7a, +0x28, +0x1d, -0x33, +0x26,
)
val actual = function.hash(ByteArray(0))
assertContentEquals(expected, actual)
}
}