Repository navigation
Use native libsodium for iOS crypto on Node 24 - #3542
Conversation
Manual physical-device Tor/lifecycle resultThe user reports that, apart from the initial connection lag, Tor appears to work across lifecycle transitions between the physical iPhone and the matching Linux desktop. Reconnecting was substantially faster than the initial join. This was Tor-only testing; the community has QSS disabled. The captured logs quantify the initial delay:
The initial bottleneck is narrowed to onion-service discovery/reachability. Current logs do not distinguish delayed publication of the desktop's fresh onion descriptor from a problem retrieving it on the phone; the desktop does not currently retain the relevant Tor publication events. That initial delay remains a follow-up item. This is user-reported manual lifecycle validation supported by captured logs. Raw logs, onion addresses, peer identifiers, and invitation data are kept private. |
iOS runs costly curve operations in the existing libsodium JavaScript fallback. This adds a small Node-API binding that calls upstream libsodium directly for Ed25519 key generation/sign/verify, X25519 public-key derivation, and box encryption/decryption. The production backend activates it after
ready; failed startup checks retain the existing implementation.Targets
developafter merged #3423: unreleased React Native 0.81.5/New Architecture and embedded Node 24.18.0. Related to #3536 and the native-crypto portion of #3539. Message indexing and auth-cache changes from #3539 are separate.The official libsodium 1.0.19 source is SHA-256 pinned and compiled without modifications. Our additions are the 142-line C boundary, a 106-line API adapter, and build/embedding tooling. The version matches the existing wrapper core. ARM64 device/simulator frameworks are built from source, checked for stale/corrupt cache artifacts, embedded with the license, and signed. The writable cache manifest is not authenticated build provenance. Only the two Node-API entry symbols are exported. The device executable adds about 245 KiB before app signing/compression.
Validation
All 33 app E2E tests passed again after the audit fix, before pushing, with zero skips:
The latest run rebuilt the backend, desktop peer, and iOS QSS app. All four suites use
ios.sim.e2e.qss; starter and native-community choose no server. The original staging run is retained in the evidence. The running app loaded the native framework and the updated backend bundle; captured logs contain zero fallback warnings.make check, Linux Node 24 host tests, both iOS framework builds, embedding/cache/signing checks, and 11 iOS workflow checks passed.Daybreak Blue audit
The independent Daybreak Blue subagent found one low-severity output-format compatibility difference. The fix now matches the wrapper’s defaults for every falsy format, with a regression across all five output-producing operations. Daybreak independently re-ran the focused native/webpack suite (16/16) and accepted the fix with no remaining findings. It reported no medium/high findings and clarified the cache/signing trust boundary. Its app-evidence review did not independently repeat the Mac app tests.
Audit report, latest E2E evidence, and implementation report record source hashes, reproduction instructions, and scope. Physical iPhone message/lifecycle validation, release signing/distribution, production libsodium version selection, and integration with #3539's other optimizations remain pending.
Pull Request Checklist
Physical phone and Tor desktop tryout (September 16)
A development-signed Release build is installed on an iPhone 16e / iOS 18.5. It launches with bundled JavaScript, and the user confirmed it appears to work. A matching Linux desktop is available for manual Tor messaging and lifecycle checks with QSS/QPS disabled. Both packaged apps contain the same backend bundle as the passing post-audit E2E run. This update changes reports only.
Physical native-library mapping was not independently confirmed, and physical multiplayer/lifecycle results are not asserted. Phone push notifications are unavailable without Firebase configuration. Installation and desktop evidence records the checks and limitations.
Develop integration — 2026-09-21
Fresh develop integration retains auth 17e0b5b and current security/QSS changes. Rebuilt pinned libsodium from source with upstream make check; all 17 native binding/webpack/cache tests pass on both Node 20.20.1 and 24.21.0, including all 669 crypto vectors. Eleven iOS workflow tests pass. Prior native iOS evidence remains applicable to the feature implementation; Apple builds were not repeated on this Linux host.