From 3bc1e65a7abfa2dd3c54c4048698b562c7e4746f Mon Sep 17 00:00:00 2001 From: Nicholas Ward Date: Mon, 26 Sep 2022 11:11:41 -0700 Subject: [PATCH] fix --- field/src/goldilocks_field.rs | 2 +- plonky2/examples/square_root.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/field/src/goldilocks_field.rs b/field/src/goldilocks_field.rs index 65315a01..537b1f11 100644 --- a/field/src/goldilocks_field.rs +++ b/field/src/goldilocks_field.rs @@ -303,7 +303,7 @@ impl GoldilocksField { } else if self.is_quadratic_residue() { let t = (Self::order() - BigUint::from(1u32)) / (BigUint::from(2u32).pow(Self::TWO_ADICITY as u32)); - let mut z = Self::POWER_OF_TWO_GENERATOR.exp_biguint(&t); + let mut z = Self::MULTIPLICATIVE_GROUP_GENERATOR.exp_biguint(&t); let mut w = self.exp_biguint(&((t - BigUint::from(1u32)) / BigUint::from(2u32))); let mut x = w * *self; let mut b = x * w; diff --git a/plonky2/examples/square_root.rs b/plonky2/examples/square_root.rs index 4e1a37d7..b20bf8e6 100644 --- a/plonky2/examples/square_root.rs +++ b/plonky2/examples/square_root.rs @@ -30,7 +30,9 @@ impl SimpleGenerator for SquareRootGenerator, ) { let x_squared = witness.get_target(self.x_squared); + dbg!(x_squared); let x = x_squared.sqrt().unwrap(); + dbg!(x); out_buffer.set_target(self.x, x); }