mirror of
https://github.com/arnaucube/poulpy.git
synced 2026-02-10 05:06:44 +01:00
[dft]: working NTT roots generation with prime power
This commit is contained in:
22
examples/main.rs
Normal file
22
examples/main.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
extern crate math;
|
||||
use math::modulus::prime::Prime;
|
||||
use math::dft::ntt::Table;
|
||||
|
||||
fn main() {
|
||||
// Example usage of `Prime<u64>`
|
||||
let q_base: u64 = 65537; // Example prime base
|
||||
let q_power: u64 = 2; // Example power
|
||||
let mut prime_instance: Prime<u64> = Prime::<u64>::new(q_base, q_power);
|
||||
|
||||
// Display the fields of `Prime` to verify
|
||||
println!("Prime instance created:");
|
||||
println!("q: {}", prime_instance.q());
|
||||
println!("q_base: {}", prime_instance.q_base());
|
||||
println!("q_power: {}", prime_instance.q_power());
|
||||
|
||||
let n: u64 = 1024;
|
||||
let nth_root: u64 = n<<1;
|
||||
|
||||
let ntt_table: Table<'_, u64> = Table::<u64>::new(&mut prime_instance, n, nth_root);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user