tiny-secp256k1
tiny-secp256k1 copied to clipboard
Make the rust portion more modular
This splits up the rust portion into two crates:
- Main library (no_std is optional)
- 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.
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.
Also, I got the ownership of https://crates.io/crates/tiny-secp256k1