mirror of
https://github.com/arnaucube/poulpy.git
synced 2026-02-10 13:16:44 +01:00
[prime]: nth_root does not mutate prime anymore
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
extern crate math;
|
||||
use math::ring::Ring;
|
||||
use math::modulus::prime::Prime;
|
||||
use math::dft::ntt::Table;
|
||||
|
||||
fn main() {
|
||||
// Example usage of `Prime<u64>`
|
||||
let q_base: u64 = 0x1fffffffffe00001; // Example prime base
|
||||
let q_power: u64 = 1; // Example power
|
||||
let q_power: usize = 1; // Example power
|
||||
let mut prime_instance: Prime<u64> = Prime::<u64>::new(q_base, q_power);
|
||||
|
||||
// Display the fields of `Prime` to verify
|
||||
@@ -17,7 +18,7 @@ fn main() {
|
||||
let n: u64 = 1024;
|
||||
let nth_root: u64 = n<<1;
|
||||
|
||||
let ntt_table: Table<'_, u64> = Table::<u64>::new(&mut prime_instance, nth_root);
|
||||
let ntt_table: Table<u64> = Table::<u64>::new(prime_instance, nth_root);
|
||||
|
||||
let mut a: Vec<u64> = vec![0; (nth_root >> 1) as usize];
|
||||
|
||||
@@ -35,4 +36,6 @@ fn main() {
|
||||
|
||||
println!("{:?}", a);
|
||||
|
||||
let r : Ring<u64> = Ring::<u64>::new(n as usize, q_base, q_power);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user