Struct phase2::MPCParameters
[−]
[src]
pub struct MPCParameters { /* fields omitted */ }
MPC parameters are just like bellman Parameters
except, when serialized,
they contain a transcript of contributions at the end, which can be verified.
Methods
impl MPCParameters
[src]
pub fn new<C>(circuit: C) -> Result<MPCParameters, SynthesisError> where
C: Circuit<Bls12>,
[src]
C: Circuit<Bls12>,
Create new Groth16 parameters (compatible with bellman) for a
given circuit. The resulting parameters are unsafe to use
until there are contributions (see contribute()
).
pub fn get_params(&self) -> &Parameters<Bls12>
[src]
Get the underlying Groth16 Parameters
pub fn contribute<R: Rng>(&mut self, rng: &mut R) -> [u8; 64]
[src]
Contributes some randomness to the parameters. Only one contributor needs to be honest for the parameters to be secure.
This function returns a "hash" that is bound to the
contribution. Contributors can use this hash to make
sure their contribution is in the final parameters, by
checking to see if it appears in the output of
MPCParameters::verify
.
pub fn verify<C: Circuit<Bls12>>(&self, circuit: C) -> Result<Vec<[u8; 64]>, ()>
[src]
Verify the correctness of the parameters, given a circuit
instance. This will return all of the hashes that
contributors obtained when they ran
MPCParameters::contribute
, for ensuring that contributions
exist in the final parameters.
pub fn write<W: Write>(&self, writer: W) -> Result<()>
[src]
Serialize these parameters. The serialized parameters
can be read by bellman as Groth16 Parameters
.
pub fn read<R: Read>(reader: R, checked: bool) -> Result<MPCParameters>
[src]
Deserialize these parameters. If checked
is false,
we won't perform curve validity and group order
checks.
Trait Implementations
impl Clone for MPCParameters
[src]
fn clone(&self) -> MPCParameters
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more