#elliptic-curve #prime #ecc

no-std primefield

Generic implementation of prime fields built on crypto-bigint, along with macros for writing field element newtypes including ones with formally verified arithmetic using fiat-crypto

15 releases

Uses new Rust 2024

0.14.0-rc.7 Feb 3, 2026
0.14.0-rc.2 Dec 30, 2025
0.14.0-rc.1 Nov 25, 2025
0.14.0-pre.4 Jul 10, 2025
0.0.0 Dec 17, 2023

#2713 in Cryptography

Download history 13903/week @ 2025-11-01 13044/week @ 2025-11-08 16469/week @ 2025-11-15 15630/week @ 2025-11-22 23335/week @ 2025-11-29 22606/week @ 2025-12-06 15401/week @ 2025-12-13 6485/week @ 2025-12-20 4186/week @ 2025-12-27 23737/week @ 2026-01-03 33391/week @ 2026-01-10 24891/week @ 2026-01-17 17785/week @ 2026-01-24 27763/week @ 2026-01-31 26355/week @ 2026-02-07 20462/week @ 2026-02-14

96,251 downloads per month
Used in 37 crates (2 directly)

Apache-2.0 OR MIT

89KB
2K SLoC

RustCrypto: Generic Prime Fields

crate Docs Build Status Apache2/MIT licensed Rust Version Project Chat

Generic implementation of prime fields built on crypto-bigint, along with macros for writing field element newtypes including ones with formally verified arithmetic using fiat-crypto.

Documentation

About

A prime field is a finite field of order 𝑝, where 𝑝 is a prime number. Because 𝑝 is prime, every non-zero element of the field has a modular inverse.

Prime fields are notable for their use in cryptography, particularly for their use as coordinates (a.k.a. base field) and the scalar field of elliptic curve implementations.

The implementation provided by this crate is built on crypto_bigint::modular, which provides a generic implementation of modular arithmetic with a modulus fixed at compile-time.

Minimum Supported Rust Version (MSRV) Policy

MSRV increases are not considered breaking changes and can happen in patch releases.

The crate MSRV accounts for all supported targets and crate feature combinations, excluding explicitly unstable features.

License

Licensed under either of:

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~2.5MB
~54K SLoC