ff
Library for building and interfacing with finite fields
0.14.0
216M downloads/mo
#471 most downloaded on crates.io
zkcrypto/ff
What this package is like to depend on
Last release 2 months ago
30 May 2026
Ships unpredictably
gaps range from 8 days to 2.3 years
Some releases are documented
notes for 11 of 20 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
22 releases · first in 2017
2 releases in the last 12 months
see the full history below
Release timeline
22 releases · Jun 2017 to May 2026Releases
latest 22-
0.14.030 May 2026Release notes
Open source →Added
ff::Field::try_random<R: TryRng + ?Sized>(rng: &mut R) -> Result<Self, R::Error>, a new trait method that must be implemented by downstreams. It samples a field element using a fallible RNG and propagates the RNG's error.
Changed
- MSRV is now 1.85.0.
- Migrated to
rand_core 0.10. ff::Field::random(rng: impl RngCore) -> Selfhas been changed back toField::random<R: Rng + ?Sized>(rng: &mut R) -> Self, to enable passing a trait object as the RNG. It now has a default implementation in terms ofField::try_random.
Removed
derive_bitsfeature flag (usebitsinstead).
-
0.14.0-pre.121 May 2026 pre-releaseNothing published for this version
-
0.14.0-pre.017 Apr 2025 pre-releaseNothing published for this version
-
0.13.109 Mar 2025Release notes
Open source →Changed
ff_derivenow works with all odd primes, not just primes that are either3 (mod 4)or1 (mod 16).
Fixed
- A type inference problem when
ff_deriveandhybrid-arrayare in the same dependency tree has been fixed.
-
0.13.006 Dec 2022Release notes
Open source →Added
ff::Field::{ZERO, ONE}ff::Field::powff::Field::{sqrt_ratio, sqrt_alt}core::iter::{Sum, Product}bounds onff::Fieldff::PrimeField::from_u128ff::PrimeField::{MODULUS, TWO_INV}- Constants related to multiplicative generators:
ff::PrimeField::MULTIPLICATIVE_GENERATORff::PrimeField::{ROOT_OF_UNITY, ROOT_OF_UNITY_INV}ff::PrimeField::DELTA
ff::WithSmallOrderMulGroupff::FromUniformBytesff::helpers:sqrt_tonelli_shankssqrt_ratio_generic
Changed
ff::Field::sqrtis now a provided method that uses theField::sqrt_ratiomethod. Implementors of theFieldtrait can choose to implementField::sqrt_ratioand use the providedff::Field::sqrtmethod, especially if it is more efficient in practice, or they can keep their own implementation ofField::sqrtand implementField::sqrt_ratioin terms of that implementation using theff::helpers::sqrt_ratio_generichelper function.ff::PrimeFieldis now documented as representing a non-binary field (i.e. its prime is not 2). This was always the intention, but is now a concrete requirement in order forPrimeField::TWO_INVto exist.
Removed
ff::Field::{zero, one}(useff::Field::{ZERO, ONE}instead).ff::PrimeField::{multiplicative_generator, root_of_unity}(useff::PrimeField::{MULTIPLICATIVE_GENERATOR, ROOT_OF_UNITY}instead).
-
0.12.128 Oct 2022Release notes
Open source →Fixed
ff_derivepreviously generated aField::randomimplementation that would overflow for fields that needed a full 64-bit spare limb.
-
0.12.004 May 2022 -
0.11.104 May 2022Release notes
Open source →Fixed
ff_deriveprocedural macro can now be invoked within regular macros.- Previously,
ff_derive's procedural macro would generate implementations ofPrimeFieldBitseven when thebitscrate feature was disabled.ff_derivecan now be used without a dependency onbitvecby disabling feature features. The new crate featurederive_bitscan be used to force the generation ofPrimeFieldBitsimplementations. This new crate feature will be removed once our MSRV is at least 1.60 and we have access to weak dependency features.
-
0.11.002 Sep 2021Release notes
Open source →Added
subtle::ConstantTimeEqbound onff::FieldCopy + Send + Sync + 'staticbounds onff::PrimeField::Reprff::derivemodule behind thederivefeature flag, containing dependencies for thePrimeFieldderive macro:- Re-exports of required crates.
adc, mac, sbbconstant-time const helper functions.
ff::Field::is_zero_vartimeff::PrimeField::from_repr_vartime
Changed
ff::Field::is_zeronow returnssubtle::Choice.ff::PrimeField::{is_odd, is_even}now returnsubtle::Choice.ff::PrimeField::from_reprnow returnsubtle::CtOption<Self>.ff::PrimeField::from_strhas been renamed toPrimeField::from_str_vartime.
Removed
ff::{adc, mac_with_carry, sbb}(replaced byff::derive::{adc, mac, sbb}).
-
0.10.111 Aug 2021Release notes
Open source →Added
ff::BatchInvertextension trait, implemented for iterators over mutable field elements which allows those field elements to be inverted in a batch. This trait is behind the newallocfeature flag.ff::BatchInverterstruct, which provides methods for non-allocating batch inversion of field elements contained within slices.
-
0.10.001 Jun 2021Release notes
Open source →Added
ff::PrimeFieldBits: PrimeFieldtrait, behind abitsfeature flag.
Changed
- MSRV is now 1.51.0.
- Bumped
bitvecto 0.22 to enable fixing a performance regression inff 0.9. Thebitvec::view::BitViewre-export has been replaced bybitvec::view::BitViewSized. - The
bitvecdependency and its re-exports have been gated behind thebitsfeature flag.
Removed
ff::PrimeField::{ReprBits, char_le_bits, to_le_bits}(replaced byff::PrimeFieldBitstrait).
Fixed
#[derive(PrimeField)]now works on small moduli (that fit in a singleu64limb).
-
0.9.005 Jan 2021Release notes
Open source →Added
- Re-export of
bitvec::view::BitView. ff::FieldBits<V>type alias for the return type offf::PrimeField::{char_le_bits, to_le_bits}.
Changed
- Bumped
bitvecto 0.20,rand_coreto 0.6.
Removed
From<Self>andFrom<&Self>bounds onff::PrimeField::Repr.
- Re-export of
-
0.8.008 Sep 2020Release notes
Open source →Added
ff::PrimeField::{ReprBits, char_le_bits, to_le_bits}, and a public dependency onbitvec 0.18.ff::Field::cubemethod with provided implementation.Send + Syncbounds onff::PrimeField::ReprBits
Changed
- MSRV is now 1.44.0.
ff::Field::random<R: RngCore + ?Sized>(rng: &mut R) -> Selfhas been changed toField::random(rng: impl RngCore) -> Self, to align withgroup::Group::random.
Removed
fmt::Displaybound onff::Field.ff::PrimeField::char(replaced byff::PrimeField::char_le_bits).ff::{BitIterator, Endianness, PrimeField::ReprEndianness(replaced byff::PrimeField::to_le_bits).
-
0.7.024 Aug 2020Nothing published for this version
-
0.6.013 Mar 2020Nothing published for this version
-
0.5.208 Jan 2020Nothing published for this version
-
0.5.121 Dec 2019Nothing published for this version
-
0.5.008 Oct 2019Nothing published for this version
-
0.4.003 Jul 2018Nothing published for this version
-
0.3.002 Jul 2018Nothing published for this version
-
0.2.027 Jun 2017Nothing published for this version
-
0.1.026 Jun 2017Nothing published for this version