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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Attempt to deserialise the value from input.

Attempt to skip the encoded value from input. Read more

Returns the fixed encoded size of the type. Read more

Deserialize this value from the given Serde deserializer. Read more

Convert self to a slice and append it to the destination.

If possible give a hint of expected size of the encoding. Read more

Convert self to an owned vector.

Convert self to a slice and then invoke the given closure with it.

Calculates the encoded size. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Convert from a value of T into an equivalent instance of Option<Self>. Read more

Consume self to return Some equivalent value of Option<T>. Read more

Decode Self and consume all of the given input data. Read more

Decode Self and consume all of the given input data. Read more

Decode Self and advance input by the number of bytes consumed. Read more

Decode Self with the given maximum recursion depth. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Cast reference.

Cast reference.

Cast mutable reference.

Cast mutable reference.

Get a reference to the inner from the outer.

Get a mutable reference to the inner from the outer.

Return an encoding of Self prepended by given slice.

Should always be Self

Convert from a value of T into an equivalent instance of Self. Read more

Consume self to return an equivalent value of T. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The counterpart to unchecked_from.

Consume self to return an equivalent value of T.

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