#elliptic-curve

no-std stark-curve

Stark curve implementation

3 releases

0.1.2 Sep 26, 2024
0.1.1 Feb 8, 2024
0.1.0 Nov 24, 2023

#1835 in Cryptography

Download history 40/week @ 2024-06-28 112/week @ 2024-07-05 92/week @ 2024-07-12 78/week @ 2024-07-19 130/week @ 2024-07-26 162/week @ 2024-08-02 65/week @ 2024-08-09 181/week @ 2024-08-16 190/week @ 2024-08-23 92/week @ 2024-08-30 67/week @ 2024-09-06 47/week @ 2024-09-13 242/week @ 2024-09-20 254/week @ 2024-09-27 116/week @ 2024-10-04 135/week @ 2024-10-11

752 downloads per month
Used in 3 crates (via generic-ec-curves)

MIT/Apache

24KB
542 lines

License Docs Crates io Discord

Stark Curve

Pure Rust implementation of Stark Curve. Provides basic elliptic curve arithmetic backed by primeorder, elliptic-curve, and ff crates. #![no_std] friendly.

Curve parameters

As specified in a stark curve specs, this crate provides an implementation of a curve defined by equation:

$$y^2 = x^3 + \alpha x + \beta \pmod p$$

where:

$$ \begin{aligned} \alpha &= 1\\ \beta &= 3141592653589793238462643383279502884197169399375105820974944592307816406665\\ p &= 3618502788666131213697322783095070105623107215331596699973092056135872020481\\ &= 2^{251} + 17 \cdot 2^{192} + 1 \end{aligned} $$

Also, curve order $n$, which is not mentioned in the specs but can be found here:
$n = 3618502788666131213697322783095070105526743751716087489154079457884512865583$

Both $p$ and $n$ are prime.

Security

This crate doesn't implement any sensitive cryptography code. Instead, we delegate scalar arithmetic to ff crate, and elliptic point arithmetic to primeorder crate, which are considered to be heavily used and tested.

Join us in Discord!

Feel free to reach out to us in Discord!

License

Licensed under either of

  • Apache License, Version 2.0
  • MIT license

at your option.

Dependencies

~4.5MB
~96K SLoC