Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated ff crate to 0.13 #1

Merged
merged 6 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fffft"
version = "0.4.2"
version = "0.5.0"
authors = ["kwantam <[email protected]>"]
edition = "2018"
description = "Number theoretic transform for PrimeField types (from ff crate)"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ impl<T: ff::PrimeField> FieldFFT for T {
const S: u32 = <Self as ff::PrimeField>::S;

fn root_of_unity() -> Self {
<Self as ff::PrimeField>::root_of_unity()
<Self as ff::PrimeField>::ROOT_OF_UNITY
}
}

Expand Down Expand Up @@ -303,7 +303,7 @@ fn roots_of_unity<T: Field>(mut root: T, log_len: u32, rdeg: u32) -> Vec<T> {

// 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();
}
Expand All @@ -325,7 +325,7 @@ fn rou_rec<T: Field>(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];
}
Expand Down Expand Up @@ -358,7 +358,7 @@ fn roots_of_unity_ser<T: Field>(mut root: T, log_len: u32, rdeg: u32) -> Vec<T>
root *= root;
}

iterate(T::one(), |&v| v * root)
iterate(T::ONE, |&v| v * root)
.take(1 << (log_len - 1))
.collect()
}
Expand Down Expand Up @@ -452,7 +452,7 @@ fn derange<T>(xi: &mut [T], log_len: u32) {
}

fn n_inv<T: Field>(log_len: u32) -> T {
let mut tmp = <T as Field>::one();
let mut tmp = <T as Field>::ONE;
for _ in 0..log_len {
tmp = tmp.double();
}
Expand Down
Loading