mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-09 09:13:09 +00:00
documentation
This commit is contained in:
parent
33d97eff1c
commit
20053ac4c7
@ -11,6 +11,8 @@ use plonky2::plonk::circuit_data::CircuitConfig;
|
||||
use plonky2::plonk::config::{GenericConfig, PoseidonGoldilocksConfig};
|
||||
use plonky2_field::extension::Extendable;
|
||||
|
||||
/// A generator used by the prover to calculate the square root (`x`) of a given value
|
||||
/// (`x_squared`), outside of the circuit, in order to supply it as an additional public input.
|
||||
#[derive(Debug)]
|
||||
struct SquareRootGenerator<F: RichField + Extendable<D>, const D: usize> {
|
||||
x: Target,
|
||||
@ -56,6 +58,7 @@ fn main() -> Result<()> {
|
||||
_phantom: PhantomData,
|
||||
});
|
||||
|
||||
// Randomly generate the value of x^2: any quadratic residue in the field works.
|
||||
let x_squared_value = {
|
||||
let mut val = F::rand();
|
||||
while !val.is_quadratic_residue() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user