feat(android): migrate from SpongyCastle to BouncyCastle#15
Conversation
Replace the unmaintained SpongyCastle fork (com.madgag.spongycastle core+prov 1.58.0.0) with org.bouncycastle:bcprov-jdk18on:1.84. Pure package-prefix swap; the library is used as plain classes, not registered as a JCE provider. Verified byte-compatible via the known-answer harness on Android (31/31, incl. fixed-vector KATs). NATIVE-1284
|
Warning Review limit reached
Next review available in: 55 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. WalkthroughThis PR migrates the Android cryptography implementation from SpongyCastle to BouncyCastle. The Gradle dependency was replaced with ChangesBouncyCastle Migration
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Migrates the Android implementation off the unmaintained SpongyCastle fork (
com.madgag.spongycastle:core+:prov1.58.0.0) to BouncyCastleorg.bouncycastle:bcprov-jdk18on:1.84(latest on Maven Central).SpongyCastle is a package-renamed BouncyCastle fork, so this is a pure mechanical swap:
android/build.gradle: 2 deps → 1 (bcprov-jdk18oncovers everything previously supplied bycore+provfor the classes used:crypto.digests/generators/params,asn1.*,util.io.pem)PBKDF2Crypto.kt+RSACrypto.kt:org.spongycastle.*→org.bouncycastle.*(imports + fully-qualified refs). Class names identical, no logic changes.The library is used as plain classes only — never registered as a JCE provider (no
Security.addProvider), so there is no collision with Android's platform BC (com.android.org.bouncycastlenamespace).No iOS, TypeScript, CI, or ProGuard changes. Zero
spongycastle/madgagreferences remain repo-wide.Verification
Known-answer harness (
example/src/App.tsx) on Android emulator (API 36): 31/31 entries pass, including the fixed-vector KATs (RSA OAEP-SHA256 decrypt, deterministic PKCS#1 v1.5 SHA-256 sign exact-match, JWK export fixed n/e, JWK import→verify) that compare against literal pinned bytes from before the migration — proving byte-compatibility for E2E encryption. KAT expected values are shared with iOS, so cross-platform equality holds by construction.Unit tests are deliberately out of scope — tracked separately in NATIVE-1378.
Jira: NATIVE-1284
Summary by CodeRabbit