Skip to content

Commit

Permalink
Uniffi-backed crate for Android on XMTPv2 (#125)
Browse files Browse the repository at this point in the history
We need to expose the Rust-backed Diffie-Hellman operation to unblock performance improvements in Android, context [here](xmtp/xmtp-react-native#33 (comment)). To keep binary size and build-times low, as well as to avoid significant time overhauling `xmtp_swift`, I've made a separate crate called `xmtp_dh` that only contains the single `diffie_hellman_k256` API that is needed for now.

There are three pieces here:
- The `xmtp_dh` crate. The `README.md` describes how to integrate it into an Android app.
- An example Android app (`xmtp_dh/examples`). Used to run an end-to-end test.
- The `uniffi_bindgen_generator` crate. A boilerplate binary crate used to [generate the platform-specific bindings](https://mozilla.github.io/uniffi-rs/tutorial/foreign_language_bindings.html#multi-crate-workspaces) in the other crates. Will be used for `bindings_ffi` soon as well.

This review is not as big as it looks - **you can ignore everything in the Android example app under `xmtp_dh/examples` except for `MainActivity.kt`**.

Credit to @michaelx11 - I reused a lot of the structure from his vmac prototype here.
  • Loading branch information
richardhuaaa authored May 30, 2023
1 parent 53d7297 commit 4c5bbc5
Show file tree
Hide file tree
Showing 56 changed files with 3,899 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ dist
*.swp
*.swo

# OS files
.DS_Store

# Generated code
xmtp_proto/src/gen
Expand Down
Loading

0 comments on commit 4c5bbc5

Please sign in to comment.