pub trait StructuredReferenceString: Sized {
type ProverParam;
type VerifierParam;
// Required methods
fn extract_prover_param(&self, supported_degree: usize) -> Self::ProverParam;
fn extract_verifier_param(
&self,
supported_degree: usize,
) -> Self::VerifierParam;
fn trim(
&self,
supported_degree: usize,
) -> Result<(Self::ProverParam, Self::VerifierParam), PCSError>;
fn trim_with_verifier_degree(
&self,
prover_supported_degree: usize,
verifier_supported_degree: usize,
) -> Result<(Self::ProverParam, Self::VerifierParam), PCSError>;
// Provided method
fn load_srs_from_file(
_supported_degree: usize,
_file: Option<&str>,
) -> Result<Self, PCSError> { ... }
}
Expand description
API definitions for structured reference string
Required Associated Types§
Sourcetype ProverParam
type ProverParam
Prover parameters
Sourcetype VerifierParam
type VerifierParam
Verifier parameters
Required Methods§
Sourcefn extract_prover_param(&self, supported_degree: usize) -> Self::ProverParam
fn extract_prover_param(&self, supported_degree: usize) -> Self::ProverParam
Extract the prover parameters from the public parameters.
Sourcefn extract_verifier_param(&self, supported_degree: usize) -> Self::VerifierParam
fn extract_verifier_param(&self, supported_degree: usize) -> Self::VerifierParam
Extract the verifier parameters from the public parameters.
Sourcefn trim(
&self,
supported_degree: usize,
) -> Result<(Self::ProverParam, Self::VerifierParam), PCSError>
fn trim( &self, supported_degree: usize, ) -> Result<(Self::ProverParam, Self::VerifierParam), PCSError>
Trim the universal parameters to specialize the public parameters
for polynomials to the given supported_degree
, and
returns committer key and verifier key.
- For univariate polynomials,
supported_degree
is the maximum degree. - For multilinear polynomials,
supported_degree
is 2 to the number of variables.
supported_log_size
should be in range 1..=params.log_size
Sourcefn trim_with_verifier_degree(
&self,
prover_supported_degree: usize,
verifier_supported_degree: usize,
) -> Result<(Self::ProverParam, Self::VerifierParam), PCSError>
fn trim_with_verifier_degree( &self, prover_supported_degree: usize, verifier_supported_degree: usize, ) -> Result<(Self::ProverParam, Self::VerifierParam), PCSError>
Trim the universal parameters to specialize the public parameters
for polynomials to the given prover/verifier_supported_degree
, and
returns committer key and verifier key.
- For univariate polynomials,
prover_/verifier_supported_degree
is the maximum degree. - For multilinear polynomials,
supported_degree
is 2 to the number of variables.
supported_log_size
should be in range 1..=params.log_size
Provided Methods§
Sourcefn load_srs_from_file(
_supported_degree: usize,
_file: Option<&str>,
) -> Result<Self, PCSError>
fn load_srs_from_file( _supported_degree: usize, _file: Option<&str>, ) -> Result<Self, PCSError>
Load public parameter in production environment.
These parameters are loaded from files with serialized pp
bytes, and
the actual setup is usually carried out via MPC and should be
implemented else where. We only load them into memory here.
If file=None
, we load the default choice of SRS.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl<E: Pairing> StructuredReferenceString for (MultilinearUniversalParams<E>, UnivariateUniversalParams<E>)
impl<E: Pairing> StructuredReferenceString for (MultilinearUniversalParams<E>, UnivariateUniversalParams<E>)
Source§fn trim_with_verifier_degree(
&self,
prover_supported_num_vars: usize,
_verifier_supported_num_vars: usize,
) -> Result<(Self::ProverParam, Self::VerifierParam), PCSError>
fn trim_with_verifier_degree( &self, prover_supported_num_vars: usize, _verifier_supported_num_vars: usize, ) -> Result<(Self::ProverParam, Self::VerifierParam), PCSError>
Naive implementation