feat(kmp): DerivePath as KMP module + utils portable helpers in commonMain - #1203
feat(kmp): DerivePath as KMP module + utils portable helpers in commonMain#1203bmc08gt wants to merge 2 commits into
Conversation
…/android - :libs:encryption:derivepath — new KMP module, pure Kotlin, no platform deps. Extracts DerivePath (BIP-44/SLIP-10 path parsing) from mnemonic so it can compile on iOS targets via SharedCore XCFramework. relationship(Domain) refactored to relationship(host: String) — callers pass domain.relationshipHost. Tests moved from mnemonic to derivepath commonTest; DerivePathTest runs on JVM + iosSimulatorArm64. - :libs:encryption:utils — converted to KMP: portable byte helpers (intToByteArray, byteArrayToLong, subByteArray, hexEncodedString, base58 extensions, replaceParam, toUTF8Bytes, Byte.shl) moved to commonMain; Android-specific helpers (Base64, URL encode, protobuf ByteString, Ed25519, MessageDigest SHA-512) moved to androidMain. Utils.java ported to Kotlin and placed in androidMain. Android-coupled tests (Base64, URL, Utils) moved to androidHostTest; commonTest covers the pure-Kotlin helpers with KAT vectors. - :kmp:shared-core — exports :libs:encryption:derivepath so iOS gets it through the SharedCore XCFramework.
…Test KMP libraries (com.android.kotlin.multiplatform.library) expose testAndroidHostTest rather than testDebugUnitTest. The aggregate flipcashTestDebug task now has a third category for these modules. Also excludes :kmp:shared-core (umbrella only, no tests) from all test aggregation lists. Fixes the pre-existing breakage introduced with the base58 KMP extraction.
|
Closing — this went beyond the scope of the hashing task (it was meant to convert only sha256/sha512/hmac, which is #1202). Derivation (C1) is the highest-correctness step and will be done as its own focused PR, gated by the slip10.json cross-platform vectors, with the relationship(Domain) -> relationship(host) API change reviewed deliberately rather than riding in as a side-effect. Branch feat/kmp-derive is left intact for reference when that work is picked up. |
|
Re-closing. This PR was reopened by an automated process in error — it was intentionally closed and that decision stands: DerivePath/utils extraction (C1) will be done as its own focused PR gated by slip10.json, not merged as a side-effect of the hashing work. The feat/kmp-derive branch remains available for reference. |
Summary
Test plan