ZenGo-X / curv

Rust language general purpose elliptic curve cryptography.
MIT License
265 stars 111 forks source link

Replace secp256k1 with libsecp256k1 pure rust implementation #135

Closed Gauthamastro closed 3 years ago

Gauthamastro commented 3 years ago

PR replaces secp256k1 with libsecp256k1 pure implementation from paritytech.

elichai commented 3 years ago

I'll link these 2 issues again: ZenGo-X/curv#44 and ZenGo-X/curv#43, and I recommend you read them before :) I'll quote what I wrote in #32:

I would prefer https://github.com/RustCrypto/elliptic-curves/tree/master/k256 or something based on fiat-crypto.

but even then it's quite scary, as libsecp256k1 is very battle tested. another option would be to fork libsecp256k1 and write bindings to the internal functionality, that allows infinity, jacobian points and more.

As for the SGX problems, I used libsecp256k1 in SGX in the past, and worked a lot to make rust-secp256k1 work in virtually every environment possible (See rust-bitcoin/rust-secp256k1#100, rust-bitcoin/rust-secp256k1#115, rust-bitcoin/rust-secp256k1#125, rust-bitcoin/rust-secp256k1#130) So if you can show me what's not working for you I'd love to try and help (I can also do that privately in Telegram/IRC/Signal if you prefer)

Gauthamastro commented 3 years ago

Closing this as per our discussion in telegram.