zama-ai / concrete-ntt Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
Given a prime modulus p ~ 2^q
, why we compute the barrett pre-conditioner using 2^{q + max_bits}/q
instead of
using 2^{2 * max_bits} / q
?
For example, for the non-AVX implementation, we can store the barrett as 2^{2*64}/q
so that we can lazy reduce a value
in [0, 2^{128}) back to [0, q) (which the Div64
trait seems do the same thing)
When trying to construct
concrete_ntt::prime64::Plan::try_new(2048, 1024)
the programs crashes (instead of returning None
, as I would have expected):
thread 'main' panicked at /Users/tlepoint/.cargo/registry/src/index.crates.io-6f17d22bba15001f/concrete-ntt-0.1.0/src/roots.rs:56:13:
assertion failed: t_pow == 1
stack backtrace:
0: rust_begin_unwind
at /rustc/bf9a1c8a193fc373897196321215794c8bebbeec/library/std/src/panicking.rs:597:5
1: core::panicking::panic_fmt
at /rustc/bf9a1c8a193fc373897196321215794c8bebbeec/library/core/src/panicking.rs:72:14
2: core::panicking::panic
at /rustc/bf9a1c8a193fc373897196321215794c8bebbeec/library/core/src/panicking.rs:127:5
3: concrete_ntt::roots::sqrt_mod_ex64
at /Users/tlepoint/.cargo/registry/src/index.crates.io-6f17d22bba15001f/concrete-ntt-0.1.0/src/roots.rs:56:13
4: concrete_ntt::roots::find_primitive_root64
at /Users/tlepoint/.cargo/registry/src/index.crates.io-6f17d22bba15001f/concrete-ntt-0.1.0/src/roots.rs:83:22
5: concrete_ntt::prime64::Plan::try_new
at /Users/tlepoint/.cargo/registry/src/index.crates.io-6f17d22bba15001f/concrete-ntt-0.1.0/src/prime64.rs:710:16
6: bug_concrete_ntt::main
at ./src/main.rs:4:22
7: core::ops::function::FnOnce::call_once
at /rustc/bf9a1c8a193fc373897196321215794c8bebbeec/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.