diff options
| -rw-r--r-- | modules/orgflow-crypto/src/commonTest/kotlin/jp/orgflow/crypto/HashingServiceTest.kt | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/modules/orgflow-crypto/src/commonTest/kotlin/jp/orgflow/crypto/HashingServiceTest.kt b/modules/orgflow-crypto/src/commonTest/kotlin/jp/orgflow/crypto/HashingServiceTest.kt index c52c7f5..a139501 100644 --- a/modules/orgflow-crypto/src/commonTest/kotlin/jp/orgflow/crypto/HashingServiceTest.kt +++ b/modules/orgflow-crypto/src/commonTest/kotlin/jp/orgflow/crypto/HashingServiceTest.kt @@ -16,20 +16,18 @@ class HashingServiceTest { @Test fun integrityVerify() { - val v = IntegrityVerifier() val bytes = "payload".encodeToByteArray() val hex = HashingService.sha256Hex(bytes) - assertTrue(v.verify(bytes, hex)) - assertFalse(v.verify(bytes + 1, hex)) + assertTrue(IntegrityVerifier.verify(bytes, hex)) + assertFalse(IntegrityVerifier.verify(bytes + byteArrayOf(1), hex)) } @Test fun chainVerification() { - val v = IntegrityVerifier() val e1 = "a".encodeToByteArray() to HashingService.sha256Hex("a".encodeToByteArray()) val e2 = "b".encodeToByteArray() to HashingService.sha256Hex("b".encodeToByteArray()) val bad = "c".encodeToByteArray() to e2.second - assertTrue(v.verifyChain(listOf(e1, e2))) - assertFalse(v.verifyChain(listOf(e1, bad))) + assertTrue(IntegrityVerifier.verifyChain(listOf(e1, e2))) + assertFalse(IntegrityVerifier.verifyChain(listOf(e1, bad))) } } |
