diff --git a/Cargo.toml b/Cargo.toml index f430ceb..3d33535 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fffft" -version = "0.4.2" +version = "0.5.0" authors = ["kwantam "] edition = "2018" description = "Number theoretic transform for PrimeField types (from ff crate)" @@ -11,14 +11,14 @@ repository = "https://github.com/kwantam/fffft" [dependencies] err-derive = "0.2" -ff = "0.12" +ff = "0.13" itertools = "0.10" rayon = "1.5" [dev-dependencies] bitvec = "1.0.1" byteorder = "1" -ff = { version = "0.12", features = ["derive"] } +ff = { version = "0.13", features = ["derive"] } rand = "0.8" rand_core = "0.6" rug = "1" diff --git a/README.md b/README.md index e0626d4..f0104e8 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ This crate contains a blanket trait impl for [ff::PrimeField]. - 0.4.0: Update deps. Add new functions that use precomputed roots of unity. -- 0.4.1: Update deps. +- 0.5.0: Update deps (`ff` 0.10 => 0.13; `bitvec` 0.22 => 1.0.1) ## license diff --git a/src/lib.rs b/src/lib.rs index 861682c..c6df4c0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -182,7 +182,7 @@ impl FieldFFT for T { const S: u32 = ::S; fn root_of_unity() -> Self { - ::root_of_unity() + ::ROOT_OF_UNITY } } @@ -303,7 +303,7 @@ fn roots_of_unity(mut root: T, log_len: u32, rdeg: u32) -> Vec { // early exit for short inputs if log_len - 1 <= LOG_PAR_LIMIT { - return iterate(T::one(), |&v| v * root) + return iterate(T::ONE, |&v| v * root) .take(1 << (log_len - 1)) .collect(); } @@ -325,7 +325,7 @@ fn rou_rec(out: &mut [T], log_roots: &[T]) { // base case: just compute the roots sequentially if log_roots.len() <= LOG_PAR_LIMIT as usize { - out[0] = T::one(); + out[0] = T::ONE; for idx in 1..out.len() { out[idx] = out[idx - 1] * log_roots[0]; } @@ -358,7 +358,7 @@ fn roots_of_unity_ser(mut root: T, log_len: u32, rdeg: u32) -> Vec root *= root; } - iterate(T::one(), |&v| v * root) + iterate(T::ONE, |&v| v * root) .take(1 << (log_len - 1)) .collect() } @@ -452,7 +452,7 @@ fn derange(xi: &mut [T], log_len: u32) { } fn n_inv(log_len: u32) -> T { - let mut tmp = ::one(); + let mut tmp = ::ONE; for _ in 0..log_len { tmp = tmp.double(); }