Skip to content

Make the rust portion more modular - #66

Open
junderw wants to merge 29 commits into
masterfrom
wip/modular
Open

Make the rust portion more modular#66
junderw wants to merge 29 commits into
masterfrom
wip/modular

Conversation

@junderw

@junderw junderw commented Nov 28, 2021

Copy link
Copy Markdown
Member

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

junderw commented Nov 28, 2021

Copy link
Copy Markdown
Member Author

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

junderw commented Nov 30, 2021

Copy link
Copy Markdown
Member Author

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