[][src]Struct phase21::MPCParameters

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.

Implementations

impl MPCParameters[src]

pub fn new<C>(circuit: C) -> Result<MPCParameters, SynthesisError> where
    C: Circuit<Bls12>, 
[src]

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 n_contributions(&self) -> usize[src]

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 write_small<W: Write>(&self, writer: W) -> Result<()>[src]

Serializes these parameters as MPCSmall.

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.

pub fn copy(&self) -> Self[src]

pub fn copy_small(&self) -> MPCSmall[src]

pub fn add_contrib(&mut self, contrib: MPCSmall)[src]

pub fn has_last_contrib(&self, small: &MPCSmall) -> bool[src]

Trait Implementations

impl Clone for MPCParameters[src]

impl Debug for MPCParameters[src]

impl PartialEq<MPCParameters> for MPCParameters[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,