also fix MD5
This commit is contained in:
33
src/commonTest/kotlin/com/infendro/hash/sha2/SHA-224.kt
Normal file
33
src/commonTest/kotlin/com/infendro/hash/sha2/SHA-224.kt
Normal file
@@ -0,0 +1,33 @@
|
||||
package com.infendro.hash.sha2
|
||||
|
||||
import kotlin.test.Test
|
||||
import kotlin.test.assertContentEquals
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
class `SHA-224 Test` {
|
||||
val function = `SHA-224`
|
||||
|
||||
@Test
|
||||
fun `bytes and block`() {
|
||||
assertEquals(28, function.bytes)
|
||||
assertEquals(224, function.bits)
|
||||
assertEquals(64, function.block)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `empty bytearray`() {
|
||||
val expected = ubyteArrayOf(
|
||||
0xd1U, 0x4aU, 0x02U, 0x8cU,
|
||||
0x2aU, 0x3aU, 0x2bU, 0xc9U,
|
||||
0x47U, 0x61U, 0x02U, 0xbbU,
|
||||
0x28U, 0x82U, 0x34U, 0xc4U,
|
||||
0x15U, 0xa2U, 0xb0U, 0x1fU,
|
||||
0x82U, 0x8eU, 0xa6U, 0x2aU,
|
||||
0xc5U, 0xb3U, 0xe4U, 0x2fU,
|
||||
)
|
||||
val actual = function.hash(
|
||||
ubyteArrayOf()
|
||||
)
|
||||
assertContentEquals(expected, actual)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user