#elliptic-curve #finite-fields #scalar-field

no-std ark-bn254

The BN254 pairing-friendly elliptic curve

5 unstable releases

0.4.0 Jan 17, 2023
0.4.0-alpha.2 Dec 28, 2022
0.4.0-alpha.1 Nov 29, 2022
0.3.0 Jun 6, 2021
0.2.0 Mar 25, 2021

#547 in Cryptography

Download history 40780/week @ 2023-12-13 31055/week @ 2023-12-20 22019/week @ 2023-12-27 42021/week @ 2024-01-03 43154/week @ 2024-01-10 51468/week @ 2024-01-17 45472/week @ 2024-01-24 43761/week @ 2024-01-31 43248/week @ 2024-02-07 39806/week @ 2024-02-14 44166/week @ 2024-02-21 42662/week @ 2024-02-28 44467/week @ 2024-03-06 48332/week @ 2024-03-13 47239/week @ 2024-03-20 38971/week @ 2024-03-27

186,639 downloads per month
Used in 1,139 crates (40 directly)

MIT/Apache

25KB
515 lines

This library implements the BN254 curve that was sampled as part of the [BCTV14] paper . The name denotes that it is a Barreto--Naehrig curve of embedding degree 12, defined over a 254-bit (prime) field. The scalar field is highly 2-adic.

This curve is also implemented in libff under the name bn128. It is the same as the bn256 curve used in Ethereum (eg: go-ethereum).

#CAUTION This curve does not satisfy the 128-bit security level anymore.

Curve information:

  • Base field: q = 21888242871839275222246405745257275088696311157297823662689037894645226208583
  • Scalar field: r = 21888242871839275222246405745257275088548364400416034343698204186575808495617
  • valuation(q - 1, 2) = 1
  • valuation(r - 1, 2) = 28
  • G1 curve equation: y^2 = x^3 + 3
  • G2 curve equation: y^2 = x^3 + B, where
    • B = 3/(u+9) where Fq2 is represented as Fq[u]/(u^2+1) = Fq2(19485874751759354771024239261021720505790618469301721065564631296452457478373, 266929791119991161246907387137283842545076965332900288569378510910307636690)

Dependencies

~5.5MB
~108K SLoC