From d06674c28c2fd69814e1027be346ad76ab83bcd4 Mon Sep 17 00:00:00 2001 From: Infendro Date: Thu, 15 Jan 2026 22:12:52 +0100 Subject: [PATCH] change tests to use ByteArray --- .../kotlin/com/infendro/hash/blake/Blake-224.kt | 12 ++++++------ .../kotlin/com/infendro/hash/blake/Blake-256.kt | 12 ++++++------ .../kotlin/com/infendro/hash/blake/Blake-384.kt | 16 ++++++++-------- .../kotlin/com/infendro/hash/blake/Blake-512.kt | 12 ++++++------ .../com/infendro/hash/blake2/Blake2b-384.kt | 4 ++-- .../com/infendro/hash/blake2/Blake2b-512.kt | 4 ++-- .../com/infendro/hash/blake2/Blake2s-224.kt | 4 ++-- .../com/infendro/hash/blake2/Blake2s-256.kt | 4 ++-- .../com/infendro/hash/keccak/sha3/SHA3-224.kt | 4 ++-- .../com/infendro/hash/keccak/sha3/SHA3-256.kt | 4 ++-- .../com/infendro/hash/keccak/sha3/SHA3-384.kt | 4 ++-- .../com/infendro/hash/keccak/sha3/SHA3-512.kt | 4 ++-- .../com/infendro/hash/keccak/shake/SHAKE128.kt | 4 ++-- .../com/infendro/hash/keccak/shake/SHAKE256.kt | 4 ++-- .../kotlin/com/infendro/hash/md/MD5.kt | 4 ++-- .../kotlin/com/infendro/hash/sha1/SHA1.kt | 4 ++-- .../kotlin/com/infendro/hash/sha2/SHA-224.kt | 4 ++-- .../kotlin/com/infendro/hash/sha2/SHA-256.kt | 4 ++-- .../kotlin/com/infendro/hash/sha2/SHA-384.kt | 4 ++-- .../kotlin/com/infendro/hash/sha2/SHA-512.kt | 4 ++-- 20 files changed, 58 insertions(+), 58 deletions(-) diff --git a/src/commonTest/kotlin/com/infendro/hash/blake/Blake-224.kt b/src/commonTest/kotlin/com/infendro/hash/blake/Blake-224.kt index cd50066..592bb7c 100644 --- a/src/commonTest/kotlin/com/infendro/hash/blake/Blake-224.kt +++ b/src/commonTest/kotlin/com/infendro/hash/blake/Blake-224.kt @@ -24,9 +24,9 @@ class `Blake-224 Test` { 0xecU, 0xbeU, 0xe0U, 0x90U, 0x3dU, 0x40U, 0xa8U, 0xa5U, 0x69U, 0xc9U, 0x4eU, 0xedU, - ) + ).asByteArray() val actual = function.hash( - UByteArray(0) + ByteArray(0), ) assertContentEquals(expected, actual) } @@ -41,9 +41,9 @@ class `Blake-224 Test` { 0xfeU, 0x3fU, 0x24U, 0x68U, 0xfeU, 0x31U, 0x2cU, 0x73U, 0xa5U, 0x27U, 0x8eU, 0xc5U, - ) + ).asByteArray() val actual = function.hash( - UByteArray(1) + ByteArray(1), ) assertContentEquals(expected, actual) } @@ -58,9 +58,9 @@ class `Blake-224 Test` { 0x88U, 0x8dU, 0x82U, 0xc8U, 0xc0U, 0xa9U, 0x17U, 0x91U, 0x3cU, 0xfbU, 0x5dU, 0x04U, - ) + ).asByteArray() val actual = function.hash( - UByteArray(72) + ByteArray(72), ) assertContentEquals(expected, actual) } diff --git a/src/commonTest/kotlin/com/infendro/hash/blake/Blake-256.kt b/src/commonTest/kotlin/com/infendro/hash/blake/Blake-256.kt index e77cd87..4f49609 100644 --- a/src/commonTest/kotlin/com/infendro/hash/blake/Blake-256.kt +++ b/src/commonTest/kotlin/com/infendro/hash/blake/Blake-256.kt @@ -25,9 +25,9 @@ class `Blake-256 Test` { 0x2fU, 0x67U, 0xc6U, 0x15U, 0x10U, 0xbfU, 0xc4U, 0x75U, 0x13U, 0x84U, 0xeaU, 0x7aU, - ) + ).asByteArray() val actual = function.hash( - UByteArray(0) + ByteArray(0), ) assertContentEquals(expected, actual) } @@ -43,9 +43,9 @@ class `Blake-256 Test` { 0x92U, 0x9aU, 0x74U, 0xdaU, 0x23U, 0x10U, 0x9eU, 0x8fU, 0x11U, 0x13U, 0x9cU, 0x87U, - ) + ).asByteArray() val actual = function.hash( - UByteArray(1) + ByteArray(1), ) assertContentEquals(expected, actual) } @@ -61,9 +61,9 @@ class `Blake-256 Test` { 0x13U, 0x5dU, 0xecU, 0x31U, 0xe2U, 0x1bU, 0xd9U, 0xabU, 0xdcU, 0xc2U, 0x2dU, 0x41U, - ) + ).asByteArray() val actual = function.hash( - UByteArray(72) + ByteArray(72), ) assertContentEquals(expected, actual) } diff --git a/src/commonTest/kotlin/com/infendro/hash/blake/Blake-384.kt b/src/commonTest/kotlin/com/infendro/hash/blake/Blake-384.kt index add61ae..e853f52 100644 --- a/src/commonTest/kotlin/com/infendro/hash/blake/Blake-384.kt +++ b/src/commonTest/kotlin/com/infendro/hash/blake/Blake-384.kt @@ -29,9 +29,9 @@ class `Blake-384 Test` { 0xddU, 0x2bU, 0x47U, 0x88U, 0xb1U, 0xc8U, 0x08U, 0x69U, 0x84U, 0xafU, 0x87U, 0x06U, - ) + ).asByteArray() val actual = function.hash( - UByteArray(0) + ByteArray(0), ) assertContentEquals(expected, actual) } @@ -50,10 +50,10 @@ class `Blake-384 Test` { 0x29U, 0x39U, 0x1eU, 0x85U, 0x45U, 0xb5U, 0x27U, 0x2dU, 0x13U, 0xa7U, 0xc2U, 0x87U, - 0x9dU, 0xa3U, 0xd8U, 0x07U - ) + 0x9dU, 0xa3U, 0xd8U, 0x07U, + ).asByteArray() val actual = function.hash( - UByteArray(1) + ByteArray(1), ) assertContentEquals(expected, actual) } @@ -72,10 +72,10 @@ class `Blake-384 Test` { 0x69U, 0x78U, 0x0bU, 0x2dU, 0xaaU, 0x66U, 0xc4U, 0xb2U, 0x24U, 0xa2U, 0xecU, 0x2eU, - 0x5dU, 0x09U, 0x17U, 0x4cU - ) + 0x5dU, 0x09U, 0x17U, 0x4cU, + ).asByteArray() val actual = function.hash( - UByteArray(144) + ByteArray(144), ) assertContentEquals(expected, actual) } diff --git a/src/commonTest/kotlin/com/infendro/hash/blake/Blake-512.kt b/src/commonTest/kotlin/com/infendro/hash/blake/Blake-512.kt index a56d0d3..afa540f 100644 --- a/src/commonTest/kotlin/com/infendro/hash/blake/Blake-512.kt +++ b/src/commonTest/kotlin/com/infendro/hash/blake/Blake-512.kt @@ -33,9 +33,9 @@ class `Blake-512 Test` { 0xa2U, 0x5aU, 0x63U, 0x6dU, 0x80U, 0xafU, 0x3fU, 0xc7U, 0x91U, 0x3eU, 0xf5U, 0xb8U, - ) + ).asByteArray() val actual = function.hash( - UByteArray(0) + ByteArray(0), ) assertContentEquals(expected, actual) } @@ -59,9 +59,9 @@ class `Blake-512 Test` { 0x8bU, 0xd0U, 0x81U, 0xb6U, 0x34U, 0x05U, 0x8bU, 0xe0U, 0xecU, 0x49U, 0xbeU, 0xb3U, - ) + ).asByteArray() val actual = function.hash( - UByteArray(1) + ByteArray(1), ) assertContentEquals(expected, actual) } @@ -85,9 +85,9 @@ class `Blake-512 Test` { 0x6eU, 0x01U, 0xadU, 0x95U, 0x89U, 0xc2U, 0x13U, 0x04U, 0x5dU, 0x54U, 0x5dU, 0xdeU, - ) + ).asByteArray() val actual = function.hash( - UByteArray(144) + ByteArray(144), ) assertContentEquals(expected, actual) } diff --git a/src/commonTest/kotlin/com/infendro/hash/blake2/Blake2b-384.kt b/src/commonTest/kotlin/com/infendro/hash/blake2/Blake2b-384.kt index e463156..62defc3 100644 --- a/src/commonTest/kotlin/com/infendro/hash/blake2/Blake2b-384.kt +++ b/src/commonTest/kotlin/com/infendro/hash/blake2/Blake2b-384.kt @@ -29,9 +29,9 @@ class `Blake2b-384 Test` { 0x98U, 0x81U, 0x26U, 0x73U, 0xc5U, 0xe0U, 0x5eU, 0xf5U, 0x83U, 0x82U, 0x51U, 0x00U, - ) + ).asByteArray() val actual = function.hash( - UByteArray(0) + ByteArray(0), ) assertContentEquals(expected, actual) } diff --git a/src/commonTest/kotlin/com/infendro/hash/blake2/Blake2b-512.kt b/src/commonTest/kotlin/com/infendro/hash/blake2/Blake2b-512.kt index ee4d83a..de82fc4 100644 --- a/src/commonTest/kotlin/com/infendro/hash/blake2/Blake2b-512.kt +++ b/src/commonTest/kotlin/com/infendro/hash/blake2/Blake2b-512.kt @@ -33,9 +33,9 @@ class `Blake2b-512 Test` { 0x14U, 0x48U, 0xb7U, 0x55U, 0xd5U, 0x6fU, 0x70U, 0x1aU, 0xfeU, 0x9bU, 0xe2U, 0xceU, - ) + ).asByteArray() val actual = function.hash( - UByteArray(0) + ByteArray(0), ) assertContentEquals(expected, actual) } diff --git a/src/commonTest/kotlin/com/infendro/hash/blake2/Blake2s-224.kt b/src/commonTest/kotlin/com/infendro/hash/blake2/Blake2s-224.kt index 7fde71b..5138eb1 100644 --- a/src/commonTest/kotlin/com/infendro/hash/blake2/Blake2s-224.kt +++ b/src/commonTest/kotlin/com/infendro/hash/blake2/Blake2s-224.kt @@ -24,9 +24,9 @@ class `Blake2s-224 Test` { 0xd5U, 0x4aU, 0x11U, 0xecU, 0xc4U, 0xe3U, 0xe0U, 0x34U, 0xe7U, 0xbcU, 0x1eU, 0xf4U, - ) + ).asByteArray() val actual = function.hash( - UByteArray(0) + ByteArray(0), ) assertContentEquals(expected, actual) } diff --git a/src/commonTest/kotlin/com/infendro/hash/blake2/Blake2s-256.kt b/src/commonTest/kotlin/com/infendro/hash/blake2/Blake2s-256.kt index 65e91db..06e48de 100644 --- a/src/commonTest/kotlin/com/infendro/hash/blake2/Blake2s-256.kt +++ b/src/commonTest/kotlin/com/infendro/hash/blake2/Blake2s-256.kt @@ -25,9 +25,9 @@ class `Blake2s-256 Test` { 0x2cU, 0xa1U, 0xa5U, 0x1eU, 0x1bU, 0x25U, 0x0dU, 0xfdU, 0x1eU, 0xd0U, 0xeeU, 0xf9U, - ) + ).asByteArray() val actual = function.hash( - UByteArray(0) + ByteArray(0), ) assertContentEquals(expected, actual) } diff --git a/src/commonTest/kotlin/com/infendro/hash/keccak/sha3/SHA3-224.kt b/src/commonTest/kotlin/com/infendro/hash/keccak/sha3/SHA3-224.kt index 19a5982..aa7845d 100644 --- a/src/commonTest/kotlin/com/infendro/hash/keccak/sha3/SHA3-224.kt +++ b/src/commonTest/kotlin/com/infendro/hash/keccak/sha3/SHA3-224.kt @@ -24,9 +24,9 @@ class `SHA3-224 Test` { 0xd4U, 0x59U, 0x7fU, 0x9aU, 0x1bU, 0x07U, 0x8eU, 0x3fU, 0x5bU, 0x5aU, 0x6bU, 0xc7U, - ) + ).asByteArray() val actual = function.hash( - ubyteArrayOf() + ByteArray(0), ) assertContentEquals(expected, actual) } diff --git a/src/commonTest/kotlin/com/infendro/hash/keccak/sha3/SHA3-256.kt b/src/commonTest/kotlin/com/infendro/hash/keccak/sha3/SHA3-256.kt index 815de1c..3f45c7d 100644 --- a/src/commonTest/kotlin/com/infendro/hash/keccak/sha3/SHA3-256.kt +++ b/src/commonTest/kotlin/com/infendro/hash/keccak/sha3/SHA3-256.kt @@ -25,9 +25,9 @@ class `SHA3-256 Test` { 0xe4U, 0x3bU, 0x49U, 0xfaU, 0x82U, 0xd8U, 0x0aU, 0x4bU, 0x80U, 0xf8U, 0x43U, 0x4aU, - ) + ).asByteArray() val actual = function.hash( - ubyteArrayOf() + ByteArray(0), ) assertContentEquals(expected, actual) } diff --git a/src/commonTest/kotlin/com/infendro/hash/keccak/sha3/SHA3-384.kt b/src/commonTest/kotlin/com/infendro/hash/keccak/sha3/SHA3-384.kt index 80ae376..b300062 100644 --- a/src/commonTest/kotlin/com/infendro/hash/keccak/sha3/SHA3-384.kt +++ b/src/commonTest/kotlin/com/infendro/hash/keccak/sha3/SHA3-384.kt @@ -29,9 +29,9 @@ class `SHA3-384 Test` { 0x26U, 0x4aU, 0xdbU, 0x47U, 0xfbU, 0x6bU, 0xd1U, 0xe0U, 0x58U, 0xd5U, 0xf0U, 0x04U, - ) + ).asByteArray() val actual = function.hash( - ubyteArrayOf() + ByteArray(0), ) assertContentEquals(expected, actual) } diff --git a/src/commonTest/kotlin/com/infendro/hash/keccak/sha3/SHA3-512.kt b/src/commonTest/kotlin/com/infendro/hash/keccak/sha3/SHA3-512.kt index 1e29b02..3cdacf7 100644 --- a/src/commonTest/kotlin/com/infendro/hash/keccak/sha3/SHA3-512.kt +++ b/src/commonTest/kotlin/com/infendro/hash/keccak/sha3/SHA3-512.kt @@ -33,9 +33,9 @@ class `SHA3-512 Test` { 0x95U, 0xb6U, 0xd3U, 0xe3U, 0x01U, 0x75U, 0x85U, 0x86U, 0x28U, 0x1dU, 0xcdU, 0x26U, - ) + ).asByteArray() val actual = function.hash( - ubyteArrayOf() + ByteArray(0), ) assertContentEquals(expected, actual) } diff --git a/src/commonTest/kotlin/com/infendro/hash/keccak/shake/SHAKE128.kt b/src/commonTest/kotlin/com/infendro/hash/keccak/shake/SHAKE128.kt index 9d29cbf..9a4cd1e 100644 --- a/src/commonTest/kotlin/com/infendro/hash/keccak/shake/SHAKE128.kt +++ b/src/commonTest/kotlin/com/infendro/hash/keccak/shake/SHAKE128.kt @@ -25,9 +25,9 @@ class `SHAKE128 Test` { 0xf6U, 0xefU, 0xbcU, 0x88U, 0xebU, 0x1aU, 0x6eU, 0xacU, 0xfaU, 0x66U, 0xefU, 0x26U, - ) + ).asByteArray() val actual = function.hash( - ubyteArrayOf() + ByteArray(0), ) assertContentEquals(expected, actual) } diff --git a/src/commonTest/kotlin/com/infendro/hash/keccak/shake/SHAKE256.kt b/src/commonTest/kotlin/com/infendro/hash/keccak/shake/SHAKE256.kt index 8086dfe..2543878 100644 --- a/src/commonTest/kotlin/com/infendro/hash/keccak/shake/SHAKE256.kt +++ b/src/commonTest/kotlin/com/infendro/hash/keccak/shake/SHAKE256.kt @@ -33,9 +33,9 @@ class `SHAKE256 Test` { 0x47U, 0x9aU, 0xb4U, 0x86U, 0x40U, 0x29U, 0x2eU, 0xacU, 0xb3U, 0xb7U, 0xc4U, 0xbeU, - ) + ).asByteArray() val actual = function.hash( - ubyteArrayOf() + ByteArray(0), ) assertContentEquals(expected, actual) } diff --git a/src/commonTest/kotlin/com/infendro/hash/md/MD5.kt b/src/commonTest/kotlin/com/infendro/hash/md/MD5.kt index 7d95d69..9b542cd 100644 --- a/src/commonTest/kotlin/com/infendro/hash/md/MD5.kt +++ b/src/commonTest/kotlin/com/infendro/hash/md/MD5.kt @@ -21,9 +21,9 @@ class `MD5 Test` { 0x8fU, 0x00U, 0xb2U, 0x04U, 0xe9U, 0x80U, 0x09U, 0x98U, 0xecU, 0xf8U, 0x42U, 0x7eU, - ) + ).asByteArray() val actual = function.hash( - ubyteArrayOf() + ByteArray(0), ) assertContentEquals(expected, actual) } diff --git a/src/commonTest/kotlin/com/infendro/hash/sha1/SHA1.kt b/src/commonTest/kotlin/com/infendro/hash/sha1/SHA1.kt index 1b8101f..32018df 100644 --- a/src/commonTest/kotlin/com/infendro/hash/sha1/SHA1.kt +++ b/src/commonTest/kotlin/com/infendro/hash/sha1/SHA1.kt @@ -22,9 +22,9 @@ class `SHA1 Test` { 0x32U, 0x55U, 0xbfU, 0xefU, 0x95U, 0x60U, 0x18U, 0x90U, 0xafU, 0xd8U, 0x07U, 0x09U, - ) + ).asByteArray() val actual = function.hash( - ubyteArrayOf() + ByteArray(0), ) assertContentEquals(expected, actual) } diff --git a/src/commonTest/kotlin/com/infendro/hash/sha2/SHA-224.kt b/src/commonTest/kotlin/com/infendro/hash/sha2/SHA-224.kt index f97d449..e324370 100644 --- a/src/commonTest/kotlin/com/infendro/hash/sha2/SHA-224.kt +++ b/src/commonTest/kotlin/com/infendro/hash/sha2/SHA-224.kt @@ -24,9 +24,9 @@ class `SHA-224 Test` { 0x15U, 0xa2U, 0xb0U, 0x1fU, 0x82U, 0x8eU, 0xa6U, 0x2aU, 0xc5U, 0xb3U, 0xe4U, 0x2fU, - ) + ).asByteArray() val actual = function.hash( - ubyteArrayOf() + ByteArray(0), ) assertContentEquals(expected, actual) } diff --git a/src/commonTest/kotlin/com/infendro/hash/sha2/SHA-256.kt b/src/commonTest/kotlin/com/infendro/hash/sha2/SHA-256.kt index 5bf43c5..4cba687 100644 --- a/src/commonTest/kotlin/com/infendro/hash/sha2/SHA-256.kt +++ b/src/commonTest/kotlin/com/infendro/hash/sha2/SHA-256.kt @@ -25,9 +25,9 @@ class `SHA-256 Test` { 0x64U, 0x9bU, 0x93U, 0x4cU, 0xa4U, 0x95U, 0x99U, 0x1bU, 0x78U, 0x52U, 0xb8U, 0x55U, - ) + ).asByteArray() val actual = function.hash( - ubyteArrayOf() + ByteArray(0), ) assertContentEquals(expected, actual) } diff --git a/src/commonTest/kotlin/com/infendro/hash/sha2/SHA-384.kt b/src/commonTest/kotlin/com/infendro/hash/sha2/SHA-384.kt index eb09dc3..68a0704 100644 --- a/src/commonTest/kotlin/com/infendro/hash/sha2/SHA-384.kt +++ b/src/commonTest/kotlin/com/infendro/hash/sha2/SHA-384.kt @@ -29,9 +29,9 @@ class `SHA-384 Test` { 0xe7U, 0x6fU, 0x65U, 0xfbU, 0xd5U, 0x1aU, 0xd2U, 0xf1U, 0x48U, 0x98U, 0xb9U, 0x5bU, - ) + ).asByteArray() val actual = function.hash( - ubyteArrayOf() + ByteArray(0), ) assertContentEquals(expected, actual) } diff --git a/src/commonTest/kotlin/com/infendro/hash/sha2/SHA-512.kt b/src/commonTest/kotlin/com/infendro/hash/sha2/SHA-512.kt index fd4bbe2..1ac9cc6 100644 --- a/src/commonTest/kotlin/com/infendro/hash/sha2/SHA-512.kt +++ b/src/commonTest/kotlin/com/infendro/hash/sha2/SHA-512.kt @@ -33,9 +33,9 @@ class `SHA-512 Test` { 0x47U, 0x41U, 0x7aU, 0x81U, 0xa5U, 0x38U, 0x32U, 0x7aU, 0xf9U, 0x27U, 0xdaU, 0x3eU, - ) + ).asByteArray() val actual = function.hash( - ubyteArrayOf() + ByteArray(0), ) assertContentEquals(expected, actual) }