Struct plonk_pallet::PublicParameters [−][src]
pub struct PublicParameters { /* fields omitted */ }
Expand description
The Public Parameters can also be referred to as the Structured Reference String (SRS). It is available to both the prover and verifier and allows the verifier to efficiently verify and make claims about polynomials up to and including a configured degree.
Implementations
Returns an untrimmed CommitKey
reference contained in the
PublicParameters
instance.
Returns an OpeningKey
reference contained in the
PublicParameters
instance.
Setup generates the public parameters using a random number generator.
This method will in most cases be used for testing and exploration.
In reality, a Trusted party
or a Multiparty Computation
will be used
to generate the SRS. Returns an error if the configured degree is less
than one.
Serialize the PublicParameters
into bytes.
This operation is designed to store the raw representation of the
contents of the PublicParameters. Therefore, the size of the bytes
outputed by this function is expected to be the double than the one
that PublicParameters::to_var_bytes
.
Note
This function should be used when we want to serialize the
PublicParameters allowing a really fast deserialization later.
This functions output should not be used by the regular
PublicParameters::from_slice
fn.
Deserialize PublicParameters
from a set of bytes created by
PublicParameters::to_raw_var_bytes
.
The bytes source is expected to be trusted and no checks will be performed reggarding the content of the points that the bytes contain serialized.
Safety
This function will not produce any memory errors but can deal to the generation of invalid or unsafe points/keys. To make sure this does not happen, the inputed bytes must match the ones that were generated by the encoding functions of this lib.
Serialises a PublicParameters
struct into a slice of bytes.
Deserialise a slice of bytes into a Public Parameter struct performing security and consistency checks for each point that the bytes contain.
Note
This function can be really slow if the PublicParameters
have a
certain degree. If the bytes come from a trusted source such as a
local file, we recommend to use
PublicParameters::from_slice_unchecked
and
PublicParameters::to_raw_var_bytes
.
Trim truncates the PublicParameters
to allow the prover to commit to
polynomials up to the and including the truncated degree.
Returns the CommitKey
and OpeningKey
used to generate and verify
proofs.
Returns an error if the truncated degree is larger than the public parameters configured degree.
Max degree specifies the largest Polynomial that this prover key can commit to.
Trait Implementations
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<PublicParameters, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<PublicParameters, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for PublicParameters
impl Send for PublicParameters
impl Sync for PublicParameters
impl Unpin for PublicParameters
impl UnwindSafe for PublicParameters
Blanket Implementations
Mutably borrows from an owned value. Read more
fn checked_from<T>(t: T) -> Option<Self> where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self> where
Self: TryFrom<T>,
Convert from a value of T
into an equivalent instance of Option<Self>
. Read more
fn checked_into<T>(self) -> Option<T> where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T> where
Self: TryInto<T>,
Consume self to return Some
equivalent value of Option<T>
. Read more
pub fn blake2_128_concat(&self) -> Vec<u8, Global>ⓘ
pub fn twox_64_concat(&self) -> Vec<u8, Global>ⓘ
fn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>,
Convert from a value of T
into an equivalent instance of Self
. Read more
fn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of T
. Read more
pub fn unchecked_into(self) -> T
pub fn unchecked_into(self) -> T
The counterpart to unchecked_from
.
pub fn unique_saturated_into(self) -> T
pub fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of T
.
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more