mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-08 00:33:06 +00:00
fmt
This commit is contained in:
parent
d239d3ffb5
commit
59acd9436c
@ -301,7 +301,8 @@ impl GoldilocksField {
|
|||||||
if self.is_zero() {
|
if self.is_zero() {
|
||||||
Some(*self)
|
Some(*self)
|
||||||
} else if self.is_quadratic_residue() {
|
} 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 z = Self::POWER_OF_TWO_GENERATOR.exp_biguint(&t);
|
||||||
let mut w = self.exp_biguint(&((t - BigUint::from(1u32)) / BigUint::from(2u32)));
|
let mut w = self.exp_biguint(&((t - BigUint::from(1u32)) / BigUint::from(2u32)));
|
||||||
let mut x = w * *self;
|
let mut x = w * *self;
|
||||||
@ -332,7 +333,6 @@ impl GoldilocksField {
|
|||||||
None
|
None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Fast addition modulo ORDER for x86-64.
|
/// Fast addition modulo ORDER for x86-64.
|
||||||
|
|||||||
@ -24,7 +24,11 @@ impl SimpleGenerator<GoldilocksField> for SquareRootGenerator<GoldilocksField, 2
|
|||||||
vec![self.x_squared]
|
vec![self.x_squared]
|
||||||
}
|
}
|
||||||
|
|
||||||
fn run_once(&self, witness: &PartitionWitness<GoldilocksField>, out_buffer: &mut GeneratedValues<GoldilocksField>) {
|
fn run_once(
|
||||||
|
&self,
|
||||||
|
witness: &PartitionWitness<GoldilocksField>,
|
||||||
|
out_buffer: &mut GeneratedValues<GoldilocksField>,
|
||||||
|
) {
|
||||||
let x_squared = witness.get_target(self.x_squared);
|
let x_squared = witness.get_target(self.x_squared);
|
||||||
let x = x_squared.sqrt().unwrap();
|
let x = x_squared.sqrt().unwrap();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user