From 477d341691b059eb5121dff8220e82a9ac84e0d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Ribo=CC=81?= Date: Mon, 30 Sep 2024 14:00:18 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20tests=20Signed-off-by:=20Javier=20Ribo?= =?UTF-8?q?=CC=81=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../identus/apollo/ed25519/KMMEdKeyPairTest.kt | 12 ------------ .../identus/apollo/utils/KMMEdKeyPairTests.kt | 12 ++++++------ 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/apollo/src/appleTest/kotlin/org/hyperledger/identus/apollo/ed25519/KMMEdKeyPairTest.kt b/apollo/src/appleTest/kotlin/org/hyperledger/identus/apollo/ed25519/KMMEdKeyPairTest.kt index 4ba205e5b..6c7a017c1 100644 --- a/apollo/src/appleTest/kotlin/org/hyperledger/identus/apollo/ed25519/KMMEdKeyPairTest.kt +++ b/apollo/src/appleTest/kotlin/org/hyperledger/identus/apollo/ed25519/KMMEdKeyPairTest.kt @@ -11,13 +11,8 @@ import kotlin.test.assertNotNull import kotlin.test.assertTrue class KMMEdKeyPairTest { - private val rawMessage = "Hello".encodeToByteArray() private val rawSK = "M7+EvGp9vjLyx5SQ1xiKhRUN+YQ0kjx6d21WgX8P1hE".base64DecodedBytes private val rawSKEncoded = rawSK.base64UrlEncoded - private val rawPk = "6kXLIS4a3UAzHm/5XTcvjCTGoAQ+yqPTT0YsM76EeuQ".base64DecodedBytes - private val rawPKEncoded = rawPk.base64UrlEncoded - private val rawSig = "rQHC0fmOclPBFiPVJCK_WJB0NgTAxSqpggPwRotNdncKrhgM2eECtr3j7UBTBmDdPTmpXGwQvyhTRTG8cymeBA".base64UrlDecodedBytes - @Test fun ed_signature_verify() { @@ -42,11 +37,4 @@ class KMMEdKeyPairTest { assertTrue(key.raw contentEquals rawSK) } - @Test - fun testSignMessageKnownValue() { - val privateKey = KMMEdPrivateKey(rawSK) - val sig = privateKey.sign(rawMessage) - assertNotNull(sig) - assertTrue(sig contentEquals rawSig) - } } diff --git a/apollo/src/jsTest/kotlin/org/hyperledger/identus/apollo/utils/KMMEdKeyPairTests.kt b/apollo/src/jsTest/kotlin/org/hyperledger/identus/apollo/utils/KMMEdKeyPairTests.kt index fcbf76c55..c51c9ba60 100644 --- a/apollo/src/jsTest/kotlin/org/hyperledger/identus/apollo/utils/KMMEdKeyPairTests.kt +++ b/apollo/src/jsTest/kotlin/org/hyperledger/identus/apollo/utils/KMMEdKeyPairTests.kt @@ -11,12 +11,12 @@ import kotlin.test.assertNotNull import kotlin.test.assertTrue class KMMEdKeyPairTests { - private val rawMessage = "Hello".encodeToByteArray() - private val rawSK = "M7+EvGp9vjLyx5SQ1xiKhRUN+YQ0kjx6d21WgX8P1hE".base64DecodedBytes - private val rawSKEncoded = rawSK.base64UrlEncoded - private val rawPk = "6kXLIS4a3UAzHm/5XTcvjCTGoAQ+yqPTT0YsM76EeuQ".base64DecodedBytes - private val rawPKEncoded = rawPk.base64UrlEncoded - private val rawSig = "rQHC0fmOclPBFiPVJCK_WJB0NgTAxSqpggPwRotNdncKrhgM2eECtr3j7UBTBmDdPTmpXGwQvyhTRTG8cymeBA".base64UrlDecodedBytes + val rawMessage = "Hello".encodeToByteArray() + val rawSK = "M7+EvGp9vjLyx5SQ1xiKhRUN+YQ0kjx6d21WgX8P1hE".base64DecodedBytes + val rawSKEncoded = rawSK.base64UrlEncoded + val rawPk = "6kXLIS4a3UAzHm/5XTcvjCTGoAQ+yqPTT0YsM76EeuQ".base64DecodedBytes + val rawPKEncoded = rawPk.base64UrlEncoded + val rawSig = "rQHC0fmOclPBFiPVJCK_WJB0NgTAxSqpggPwRotNdncKrhgM2eECtr3j7UBTBmDdPTmpXGwQvyhTRTG8cymeBA".base64UrlDecodedBytes @Test fun testGenerateKeyPair() {