mirror of
https://github.com/arnaucube/poulpy.git
synced 2026-02-10 13:16:44 +01:00
fixed automorphism
This commit is contained in:
@@ -5,9 +5,9 @@ use math::dft::ntt::Table;
|
||||
|
||||
fn main() {
|
||||
// Example usage of `Prime<u64>`
|
||||
let q_base: u64 = 0x1fffffffffe00001; // Example prime base
|
||||
let q_base: u64 = 65537; // Example prime base
|
||||
let q_power: usize = 1; // Example power
|
||||
let mut prime_instance: Prime<u64> = Prime::<u64>::new(q_base, q_power);
|
||||
let prime_instance: Prime<u64> = Prime::<u64>::new(q_base, q_power);
|
||||
|
||||
// Display the fields of `Prime` to verify
|
||||
println!("Prime instance created:");
|
||||
@@ -15,7 +15,7 @@ fn main() {
|
||||
println!("q_base: {}", prime_instance.q_base());
|
||||
println!("q_power: {}", prime_instance.q_power());
|
||||
|
||||
let n: u64 = 1024;
|
||||
let n: u64 = 32;
|
||||
let nth_root: u64 = n<<1;
|
||||
|
||||
let ntt_table: Table<u64> = Table::<u64>::new(prime_instance, nth_root);
|
||||
@@ -38,4 +38,15 @@ fn main() {
|
||||
|
||||
let r : Ring<u64> = Ring::<u64>::new(n as usize, q_base, q_power);
|
||||
|
||||
let mut p0: math::poly::Poly<u64> = r.new_poly();
|
||||
let mut p1: math::poly::Poly<u64> = r.new_poly();
|
||||
|
||||
for i in 0..p0.n(){
|
||||
p0.0[i] = i as u64
|
||||
}
|
||||
|
||||
r.automorphism(p0, (2*r.n-1) as u64, &mut p1);
|
||||
|
||||
println!("{:?}", p1);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user