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 `SHAKE256 Test` {
class SHAKE256_Test {
val function = SHAKE256(64)
@Test
@@ -16,27 +16,17 @@ class `SHAKE256 Test` {
@Test
fun `empty bytearray`() {
val expected = ubyteArrayOf(
0x46U, 0xb9U, 0xddU, 0x2bU,
0x0bU, 0xa8U, 0x8dU, 0x13U,
0x23U, 0x3bU, 0x3fU, 0xebU,
0x74U, 0x3eU, 0xebU, 0x24U,
0x3fU, 0xcdU, 0x52U, 0xeaU,
0x62U, 0xb8U, 0x1bU, 0x82U,
0xb5U, 0x0cU, 0x27U, 0x64U,
0x6eU, 0xd5U, 0x76U, 0x2fU,
0xd7U, 0x5dU, 0xc4U, 0xddU,
0xd8U, 0xc0U, 0xf2U, 0x00U,
0xcbU, 0x05U, 0x01U, 0x9dU,
0x67U, 0xb5U, 0x92U, 0xf6U,
0xfcU, 0x82U, 0x1cU, 0x49U,
0x47U, 0x9aU, 0xb4U, 0x86U,
0x40U, 0x29U, 0x2eU, 0xacU,
0xb3U, 0xb7U, 0xc4U, 0xbeU,
).asByteArray()
val actual = function.hash(
ByteArray(0),
val expected = byteArrayOf(
+0x46, -0x47, -0x23, +0x2b, +0x0b, -0x58, -0x73, +0x13,
+0x23, +0x3b, +0x3f, -0x15, +0x74, +0x3e, -0x15, +0x24,
+0x3f, -0x33, +0x52, -0x16, +0x62, -0x48, +0x1b, -0x7e,
-0x4b, +0x0c, +0x27, +0x64, +0x6e, -0x2b, +0x76, +0x2f,
-0x29, +0x5d, -0x3c, -0x23, -0x28, -0x40, -0x0e, +0x00,
-0x35, +0x05, +0x01, -0x63, +0x67, -0x4b, -0x6e, -0x0a,
-0x04, -0x7e, +0x1c, +0x49, +0x47, -0x66, -0x4c, -0x7a,
+0x40, +0x29, +0x2e, -0x54, -0x4d, -0x49, -0x3c, -0x42,
)
val actual = function.hash(ByteArray(0))
assertContentEquals(expected, actual)
}
}