Skip to content

Commit

Permalink
feat(ntt): impl product plan
Browse files Browse the repository at this point in the history
co-authored-by: sarah el kazdadi <[email protected]>
  • Loading branch information
IceTDrinker and sarah el kazdadi committed Nov 13, 2024
1 parent 6ba30eb commit ef8e12c
Show file tree
Hide file tree
Showing 5 changed files with 1,179 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ rust-version = "1.67"

[dependencies]
aligned-vec = { version = "0.5", default-features = false }
bytemuck = "1"
pulp = { version = "0.18.22", default-features = false }

[features]
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ pub mod native_binary32;
/// polynomial.
pub mod native_binary64;

pub mod product;

// Fn arguments are (simd, z0, z1, w, w_shoup, p, neg_p, two_p)
trait Butterfly<S: Copy, V: Copy>: Copy + Fn(S, V, V, V, V, V, V, V) -> (V, V) {}
impl<F: Copy + Fn(S, V, V, V, V, V, V, V) -> (V, V), S: Copy, V: Copy> Butterfly<S, V> for F {}
Expand Down
4 changes: 4 additions & 0 deletions src/prime32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,10 @@ impl Plan {
}
}

pub(crate) fn p_div(&self) -> Div32 {
self.p_div
}

/// Returns the polynomial size of the negacyclic NTT plan.
#[inline]
pub fn ntt_size(&self) -> usize {
Expand Down
4 changes: 4 additions & 0 deletions src/prime64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,10 @@ impl Plan {
}
}

pub(crate) fn p_div(&self) -> Div64 {
self.p_div
}

/// Returns the polynomial size of the negacyclic NTT plan.
#[inline]
pub fn ntt_size(&self) -> usize {
Expand Down
Loading

0 comments on commit ef8e12c

Please sign in to comment.