pub trait RandomizedConstraintSystem<F: PrimeField>: ConstraintSystem<F> {
// Required method
fn challenge_scalar(&mut self, label: &'static [u8]) -> F;
}Expand description
Represents a constraint system in the second phase: when the challenges can be sampled to create randomized constraints.
Note: this trait also includes ConstraintSystem trait
in order to allow composition of gadgets: e.g. a shuffle gadget can be used in both phases.
Required Methods§
Sourcefn challenge_scalar(&mut self, label: &'static [u8]) -> F
fn challenge_scalar(&mut self, label: &'static [u8]) -> F
Generates a challenge scalar.
§Usage
This method is available only within the scope of a closure provided
to specify_randomized_constraints, which implements
the “randomization” phase of the protocol.
Arbitrary number of challenges can be generated with additional calls.
cs.specify_randomized_constraints(move |cs| {
let z = cs.challenge_scalar(b"some challenge");
// ...
})Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".