From 59acd9436cd5981fb324b0c26171fc38d46569dd Mon Sep 17 00:00:00 2001 From: Nicholas Ward Date: Mon, 26 Sep 2022 10:44:51 -0700 Subject: [PATCH] fmt --- field/src/goldilocks_field.rs | 4 ++-- plonky2/examples/square_root.rs | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/field/src/goldilocks_field.rs b/field/src/goldilocks_field.rs index 21235e63..ef9e2c2b 100644 --- a/field/src/goldilocks_field.rs +++ b/field/src/goldilocks_field.rs @@ -301,7 +301,8 @@ impl GoldilocksField { if self.is_zero() { Some(*self) } else if self.is_quadratic_residue() { - let t = (Self::order() - BigUint::from(1u32)) / (BigUint::from(2u32).pow(Self::TWO_ADICITY as u32)); + 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 w = self.exp_biguint(&((t - BigUint::from(1u32)) / BigUint::from(2u32))); let mut x = w * *self; @@ -332,7 +333,6 @@ impl GoldilocksField { None } } - } /// Fast addition modulo ORDER for x86-64. diff --git a/plonky2/examples/square_root.rs b/plonky2/examples/square_root.rs index a19130fa..4e1a37d7 100644 --- a/plonky2/examples/square_root.rs +++ b/plonky2/examples/square_root.rs @@ -24,7 +24,11 @@ impl SimpleGenerator for SquareRootGenerator, out_buffer: &mut GeneratedValues) { + fn run_once( + &self, + witness: &PartitionWitness, + out_buffer: &mut GeneratedValues, + ) { let x_squared = witness.get_target(self.x_squared); let x = x_squared.sqrt().unwrap();