[−][src]Struct phase21::MPCParameters
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]
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 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]
fn clone(&self) -> MPCParameters
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for MPCParameters
[src]
impl PartialEq<MPCParameters> for MPCParameters
[src]
Auto Trait Implementations
impl RefUnwindSafe for MPCParameters
impl Send for MPCParameters
impl Sync for MPCParameters
impl Unpin for MPCParameters
impl UnwindSafe for MPCParameters
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,