diff --git a/.github/workflows/release-documentation.yml b/.github/workflows/release-documentation.yml index 18eeb4c3f..4787c2567 100644 --- a/.github/workflows/release-documentation.yml +++ b/.github/workflows/release-documentation.yml @@ -56,6 +56,17 @@ jobs: run: | brew install autoconf automake libtool + - name: "Install rust toolchain (Linux)" + if: matrix.os-type == 'linux' + run: sudo apt install rustc build-essential -y + + - name: "Install rust toolchain (Macos)" + if: matrix.os-type == 'macos' + run: brew install rustup + + - name: "Install wasm-pack" + run: cargo install wasm-pack + - name: "Dokka Documentation Generation" run: | ./gradlew dokkaHtml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 33b086d28..4b0538bf8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -59,6 +59,17 @@ jobs: git_user_signingkey: true git_commit_gpgsign: true + - name: "Install rust toolchain (Linux)" + if: matrix.os-type == 'linux' + run: sudo apt install rustc build-essential -y + + - name: "Install rust toolchain (Macos)" + if: matrix.os-type == 'macos' + run: brew install rustup + + - name: "Install wasm-pack" + run: cargo install wasm-pack + - name: "Release" env: GIT_AUTHOR_EMAIL: ${{ steps.import_gpg.outputs.email }} diff --git a/apollo/src/androidInstrumentedTest/kotlin/io/iohk/atala/prism/apollo/derivation/EdHDKeyTest.kt b/apollo/src/androidInstrumentedTest/kotlin/io/iohk/atala/prism/apollo/derivation/EdHDKeyTest.kt new file mode 100644 index 000000000..8c52d31f7 --- /dev/null +++ b/apollo/src/androidInstrumentedTest/kotlin/io/iohk/atala/prism/apollo/derivation/EdHDKeyTest.kt @@ -0,0 +1,21 @@ +package io.iohk.atala.prism.apollo.derivation + +import io.iohk.atala.prism.apollo.utils.decodeHex +import io.iohk.atala.prism.apollo.utils.toHexString +import kotlin.test.Test +import kotlin.test.assertEquals + +@RunWith(AndroidJUnit4::class) +class EdHDKeyTest { + @Test + fun test_derive_m1() { + val privateKey = "f8a29231ee38d6c5bf715d5bac21c750577aa3798b22d79d65bf97d6fadea15adcd1ee1abdf78bd4be64731a12deb94d3671784112eb6f364b871851fd1c9a24".decodeHex() + val chainCode = "7384db9ad6003bbd08b3b1ddc0d07a597293ff85e961bf252b331262eddfad0d".decodeHex() + + val key = EdHDKey(privateKey, chainCode) + val derived = key.derive("m/1'") + + assertEquals(derived.privateKey.toHexString(), "4057eb6cab9000e3b6fe7e556341da1ca2f5dde0b689a7b58cb93f1902dfa15a5a10732ff348051c6e0865c62931d4a73fa8050b8ff543b43fc0000a7e2c5700") + assertEquals(derived.chainCode.toHexString(), "9a170f689c8b9b3502ee846f457ab3dd1b017cfb2cd68865c7f24dbabcbc2256") + } +} diff --git a/apollo/src/commonMain/kotlin/io/iohk/atala/prism/apollo/utils/ConvertEd25519.kt b/apollo/src/commonMain/kotlin/io/iohk/atala/prism/apollo/utils/ConvertEd25519.kt index 8ead6d0bc..f6e4b4846 100644 --- a/apollo/src/commonMain/kotlin/io/iohk/atala/prism/apollo/utils/ConvertEd25519.kt +++ b/apollo/src/commonMain/kotlin/io/iohk/atala/prism/apollo/utils/ConvertEd25519.kt @@ -5,7 +5,7 @@ import kotlin.experimental.and import kotlin.experimental.or /** - * This function converts an Ed25519 secret key into a Curve25519 secret key. + * This function converts an Ed25519 secret key into a Curve25519 secret key. * Curve25519 keys are used in the key exchange process to encrypt communications over networks. * * @param secretKey The Ed25519 secret key to be converted into a Curve25519 secret key.