implement tests
Some checks failed
/ publish (push) Has been cancelled

also fix MD5
This commit is contained in:
2025-11-10 17:42:15 +01:00
parent 9b93fbd093
commit d033d895da
28 changed files with 469 additions and 30 deletions

View File

@@ -0,0 +1,38 @@
package com.infendro.hash.keccak.sha3
import kotlin.test.Test
import kotlin.test.assertContentEquals
import kotlin.test.assertEquals
class `SHA3-384 Test` {
val function = `SHA3-384`
@Test
fun `bytes and block`() {
assertEquals(48, function.bytes)
assertEquals(384, function.bits)
assertEquals(104, function.block)
}
@Test
fun `empty bytearray`() {
val expected = ubyteArrayOf(
0x0cU, 0x63U, 0xa7U, 0x5bU,
0x84U, 0x5eU, 0x4fU, 0x7dU,
0x01U, 0x10U, 0x7dU, 0x85U,
0x2eU, 0x4cU, 0x24U, 0x85U,
0xc5U, 0x1aU, 0x50U, 0xaaU,
0xaaU, 0x94U, 0xfcU, 0x61U,
0x99U, 0x5eU, 0x71U, 0xbbU,
0xeeU, 0x98U, 0x3aU, 0x2aU,
0xc3U, 0x71U, 0x38U, 0x31U,
0x26U, 0x4aU, 0xdbU, 0x47U,
0xfbU, 0x6bU, 0xd1U, 0xe0U,
0x58U, 0xd5U, 0xf0U, 0x04U,
)
val actual = function.hash(
ubyteArrayOf()
)
assertContentEquals(expected, actual)
}
}