-
Notifications
You must be signed in to change notification settings - Fork 110
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
replace secp256k1 to libsecp256k1-rs #44
Conversation
test by `cargo test --features "curvesecp256k1 ecc"`
Now I find two library libsecp256k1-rs and libsecp256k1, I use libsecp256k1-rs. |
Hi @namuyan - looks like great work. |
Thank you for reply. |
I just change README.md? |
you are right, we just need to run it again. The problem is that it is unknown for me how to do unit test for probabilistic code. We got stuck on this a while ago (#10). Any suggestions will be welcome. |
rust-bitcoin/rust-secp256k1#125 (comment) According to latest merged PR in original rust-secp256k1 - it now supports WASM that was only benefit of libsecp256k1. Performance benefit over rust-secp256k1 is supposedly due to later being constant time. Additionally rust-secp256k1 is a wrapper over original Bitcoin's secp256k1 that is most tested and commonly used library out there. So maybe it's a good idea to switch back to it in emerald-city as well. |
Glad to hear :) |
FYI After this: rust-bitcoin/rust-secp256k1#132 |
Oh. Context creation in Secp256k1 is the most intensive part of the library. You should use |
Ok. let's put the benchmarking stats to bed once and for all: Before I changed anything I got consistently these stats: After I changed the context to be created before the tests and then used it globally I got these stats: And this is with a lot of over head. @omershlo @namuyan. And this is before the 15% faster verification using gmp |
@elichai please! |
Will do. |
unsafe |
Thank you for quality up!
I replaced to https://github.com/elichai/emerald-city/tree/secp |
curv. and create a key before you measure performance so that the context will be available already (you shouldn't count the context creation as part of the performance test) (and change your performance tests to use nanoseconds) |
#43
test passed by
cargo test --features ec_secp256k1
performance improved!
please check my code, thank you.