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

Fast witness generation #1

Open
wants to merge 1 commit into
base: fhedude/bfvpy-to-fhers
Choose a base branch
from

Conversation

nulltea
Copy link

@nulltea nulltea commented Sep 27, 2024

Changes

  • replace naive poly mult with NTT
  • add poly_div_cyclo and poly_modulo_cyclo that leverage structure of cyclotomic poly
  • rewrite poly_div recursively using "divide-and-conquer" strategy.

Known issue

  • concrete-ntt native NTT plan fails for poly sizes > 2**15`

Possible future work

  • if r1i and p1i can be converted to field elements modulo some suitable p can apply batch multiplicative inverse (Mongomery trick) to further optimize poly_div (currently takes about ~80ms for n=2**14)

tracing = "0.1.40"
tracing-subscriber = { version = "0.3.17", features = ["std", "env-filter"] }
tracing-forest = { version = "0.1.6", features = ["ansi", "smallvec"] }
concrete-ntt = { git = "https://github.com/zama-ai/concrete-ntt", features = [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fhedude, fhe.rs already implements NTT, no? Perhaps we can use fhe.rs' implementation to avoid adding another dependency?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants