Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the rust portion more modular #66

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open

Make the rust portion more modular #66

wants to merge 29 commits into from

Conversation

junderw
Copy link
Member

@junderw junderw commented Nov 28, 2021

This splits up the rust portion into two crates:

  1. Main library (no_std is optional)
  2. WASM cdylib which uses 1

This will allow others to make use of the main library.

I would like to add doc examples and maybe doc-tests in the main library and then publish to crates.io... but we'll see.
It looks like tiny-secp256k1 on crates.io is taken, but it is not being used. Maybe @maciejhirsz would like to give it to us? (Please?)

I also switched the release profile to opt-level "z" which gives a 66% reduction in binary size, but we get a 5~10% hit to performance.

@junderw
Copy link
Member Author

junderw commented Nov 28, 2021

Note: UnsafeCell use was because optimizer kept removing the export randomly for some reason.
I had to implement a wrapper that impl Sync in order to export it.

I have Copy restriction because I made a method to get a copy of the slice... but I ended up not using it.

@junderw
Copy link
Member Author

junderw commented Nov 30, 2021

Also, I got the ownership of https://crates.io/crates/tiny-secp256k1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant