4 releases (2 breaking)

0.3.1 Oct 25, 2021
0.3.0 Oct 29, 2020
0.2.0 Oct 1, 2020
0.1.0 Sep 22, 2020

#3 in #elliptic

Download history 98/week @ 2022-06-03 188/week @ 2022-06-10 154/week @ 2022-06-17 60/week @ 2022-06-24 74/week @ 2022-07-01 124/week @ 2022-07-08 169/week @ 2022-07-15 90/week @ 2022-07-22 89/week @ 2022-07-29 94/week @ 2022-08-05 139/week @ 2022-08-12 135/week @ 2022-08-19 131/week @ 2022-08-26 128/week @ 2022-09-02 168/week @ 2022-09-09 110/week @ 2022-09-16

566 downloads per month


54K SLoC

ECCoxide -- Rust Elliptic Curve Cryptography

General elliptic curve cryptography

Design space

The aim of this crate is to provide all necessary elliptic curve cryptographic to experiments and write new protocol, based on reasonably guaranteed based modules.

The primitives needed for basic arithmetic in finite field is provided by formally written/generated rust modules fiat-crypto, which aim to provide correct, secure and constant time functions to implement those finite field.

Some other parts have been generated algorithmically, so as increase the number of supported features and reduce the work needed to provide complete set of features for wide-variety of curves, but with no guaranteed of being the fastest

The package rely on the following priorities list:

make it work, then make it secure, then make it fast

Finally we rely on other arithmetic tools (e.g. sage and magma) to provides some further guarantees on the values expected.


For now, most SEC2 curves are supported through fiat-crypto:

  • p256r1, p256k1, p384r1, p521r1
  • p190r1, p190k1: not particularly recommended due to size

Special cases:

  • p224k1: p=5 mod 8, using alternative approach for sqrt calculation
  • p224r1: p=1 mod 8, using tonelli shanks algorithm for sqrt calculation

Optionally someone can enable all SEC2 curves less than 190bits (112 to 160 bits) using sec2-small features, but the size of those curves are too small to be used in normal settings. Also those curves are using a generic backend using num-traits and num-bigint, which is not particularly fast, nor secure.

Futures plans includes support of ed25519, ed448, curve9767, and other edwards curves, and maybe other.


Q: Does using formally generated modules makes this crate more secure ? A: No, while it improve basic guaranteed of correctness, it is also based on model that are assumed correct. It also depends on the rust/llvm compiler to not bring various optimisation / code change that could break some properties (e.g. constant time) and finally there's also lots of glue being written on top to provide high level usable ECC, that have been manually written.

⚠️ Disclaimer

This is not a ready-to-use in production code crate. see TODO.md.