feat(kmp/ed25519): in-place KMP module (JNI on Android, cinterop on iOS) + mnemonic Kotlin rewrite - #1204
Merged
Merged
Conversation
…ual (B1) - New KMP module :libs:encryption:ed25519-kmp exposing Ed25519Kmp (createKeyPair, sign, verify, onCurve) to commonMain via expect/actual - iosMain actual: Kotlin/Native cinterop to vendored orlp/ed25519 C sources; per-target static archive compiled via Gradle Exec task - androidMain actual: delegates to existing com.getcode.ed25519.Ed25519 JNI - commonTest: RFC 8032 vector gate reads ed25519.json on Android host + iOS - Wires into :kmp:shared-core (api + export in SharedCore XCFramework) - Existing :libs:encryption:ed25519 (JNI + CMake) left untouched
- Replace android.util.Base64 with java.util.Base64 so androidHostTest runs on JVM without Android stubs - Add macOS arm64 dylibs (libnative-lib.dylib, libed25519.dylib) to androidHostTest/jniLibs so the JNI native-lib can load in host tests - Use definitionFile (non-deprecated) instead of defFile in cinterop DSL - Enable kotlin.mpp.enableCInteropCommonization in gradle.properties
- Rename :libs:encryption:ed25519-kmp → :libs:encryption:ed25519 (KMP module takes the clean name; no -kmp suffix exposed to consumers) - Rename :libs:encryption:ed25519 → :libs:encryption:ed25519-native (JNI/CMake module becomes an internal impl detail; androidMain delegates to it) - Update cinterop path in ed25519.def and C source reference in build.gradle.kts - Update kmpUnitTestModules and settings.gradle.kts registrations - Update :kmp:shared-core api/export references - Convert MnemonicCode and MnemonicException from Java to Kotlin (cherry-picked from origin/fix/kmp-consumer-compile)
bmc08gt
force-pushed
the
feat/kmp-ed25519
branch
from
August 7, 2026 21:07
a1865d8 to
d03479d
Compare
…the JNI Ed25519 API
…ude ed25519 JNI host test on Linux - compileDebugSources transitively needs processDebugGoogleServices; write a dummy google-services.json (pkg com.flipcash.app.android) so the credless gate can build. - ed25519's androidHostTest is a JNI vector test needing a host-native lib; it can't run on the Linux CI runner. Exclude it from CI unit tests (kmpUnitTestModules + noUnitTestModules); ed25519.json parity stays gated via the iOS cinterop path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Why not in-place CMake in the KMP module?
`com.android.kotlin.multiplatform.library` (AGP 9.3.1) does not expose `externalNativeBuild` in its restricted DSL — the CMake/NDK build must live in a separate `com.android.library` module. The fallback path was taken as specified.
Files changed:
No consumer `build.gradle.kts` files needed changes.
Change B — Mnemonic Kotlin rewrite
`MnemonicCode.java` and `MnemonicException.java` replaced by Kotlin equivalents (cherry-picked from `origin/fix/kmp-consumer-compile`). The Java `main/java/` source files are deleted; Kotlin files land in `main/kotlin/`. Same package, same API surface.
Module map after this PR
Verification checklist