Struct snarkvm_algorithms::polycommit::kzg10::UniversalParams
source · pub struct UniversalParams<E: PairingEngine> {
pub powers: Arc<RwLock<PowersOfG<E>>>,
pub h: E::G2Affine,
pub beta_h: E::G2Affine,
pub supported_degree_bounds: Vec<usize>,
pub inverse_neg_powers_of_beta_h: BTreeMap<usize, E::G2Affine>,
pub prepared_h: <E::G2Affine as PairingCurve>::Prepared,
pub prepared_beta_h: <E::G2Affine as PairingCurve>::Prepared,
}
Expand description
UniversalParams
are the universal parameters for the KZG10 scheme.
Fields
powers: Arc<RwLock<PowersOfG<E>>>
Group elements of the form { \beta^i G }
, where i
ranges from 0 to degree
,
and group elements of the form { \beta^i \gamma G }
, where i
ranges from 0 to degree
.
This struct provides an abstraction over the powers which are located on-disk
to reduce memory usage.
h: E::G2Affine
The generator of G2.
beta_h: E::G2Affine
\beta times the above generator of G2.
supported_degree_bounds: Vec<usize>
Supported degree bounds.
inverse_neg_powers_of_beta_h: BTreeMap<usize, E::G2Affine>
Group elements of the form { \beta^{max_degree -i} G2 }
, where i
is the supported degree bound.
This one is used for deriving the verifying key.
prepared_h: <E::G2Affine as PairingCurve>::Prepared
The generator of G2, prepared for use in pairings.
prepared_beta_h: <E::G2Affine as PairingCurve>::Prepared
\beta times the above generator of G2, prepared for use in pairings.
Implementations
sourceimpl<E: PairingEngine> UniversalParams<E>
impl<E: PairingEngine> UniversalParams<E>
pub fn lagrange_basis(
&self,
domain: EvaluationDomain<E::Fr>
) -> Result<Vec<E::G1Affine>>
pub fn power_of_beta_g(&self, which_power: usize) -> Result<E::G1Affine>
pub fn powers_of_beta_g(
&self,
lower: usize,
upper: usize
) -> Result<Vec<E::G1Affine>>
pub fn get_powers_times_gamma_g(&self) -> BTreeMap<usize, E::G1Affine>
pub fn download_up_to(&self, degree: usize) -> Result<()>
sourceimpl<E: PairingEngine> UniversalParams<E>
impl<E: PairingEngine> UniversalParams<E>
pub fn max_degree(&self) -> usize
pub fn supported_degree_bounds(&self) -> &[usize]
pub fn increase_degree(&self, degree: usize) -> Result<()>
Trait Implementations
sourceimpl<E: PairingEngine> CanonicalDeserialize for UniversalParams<E>
impl<E: PairingEngine> CanonicalDeserialize for UniversalParams<E>
fn deserialize_with_mode<R: Read>(
reader: R,
compress: Compress,
validate: Validate
) -> Result<Self, SerializationError>
fn deserialize_compressed<R>(reader: R) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_compressed_unchecked<R>(
reader: R
) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_uncompressed<R>(reader: R) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_uncompressed_unchecked<R>(
reader: R
) -> Result<Self, SerializationError>where
R: Read,
sourceimpl<E: PairingEngine> CanonicalSerialize for UniversalParams<E>
impl<E: PairingEngine> CanonicalSerialize for UniversalParams<E>
fn serialize_with_mode<W: Write>(
&self,
writer: W,
mode: Compress
) -> Result<(), SerializationError>
fn serialized_size(&self, mode: Compress) -> usize
fn serialize_compressed<W>(&self, writer: W) -> Result<(), SerializationError>where
W: Write,
fn compressed_size(&self) -> usize
fn serialize_uncompressed<W>(&self, writer: W) -> Result<(), SerializationError>where
W: Write,
fn uncompressed_size(&self) -> usize
sourceimpl<E: Clone + PairingEngine> Clone for UniversalParams<E>where
E::G2Affine: Clone,
E::G2Affine: Clone,
E::G2Affine: Clone,
E::G2Affine: Clone,
E::G2Affine: Clone,
impl<E: Clone + PairingEngine> Clone for UniversalParams<E>where
E::G2Affine: Clone,
E::G2Affine: Clone,
E::G2Affine: Clone,
E::G2Affine: Clone,
E::G2Affine: Clone,
sourcefn clone(&self) -> UniversalParams<E>
fn clone(&self) -> UniversalParams<E>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl<E: Debug + PairingEngine> Debug for UniversalParams<E>where
E::G2Affine: Debug,
E::G2Affine: Debug,
E::G2Affine: Debug,
E::G2Affine: Debug,
E::G2Affine: Debug,
impl<E: Debug + PairingEngine> Debug for UniversalParams<E>where
E::G2Affine: Debug,
E::G2Affine: Debug,
E::G2Affine: Debug,
E::G2Affine: Debug,
E::G2Affine: Debug,
sourceimpl<E: PairingEngine> FromBytes for UniversalParams<E>
impl<E: PairingEngine> FromBytes for UniversalParams<E>
sourceimpl<E: PairingEngine> ToBytes for UniversalParams<E>
impl<E: PairingEngine> ToBytes for UniversalParams<E>
sourceimpl<E: PairingEngine> Valid for UniversalParams<E>
impl<E: PairingEngine> Valid for UniversalParams<E>
fn check(&self) -> Result<(), SerializationError>
fn batch_check<'a>(
batch: impl Iterator<Item = &'a Self> + Send
) -> Result<(), SerializationError>where
Self: 'a,
Auto Trait Implementations
impl<E> !RefUnwindSafe for UniversalParams<E>
impl<E> Send for UniversalParams<E>
impl<E> Sync for UniversalParams<E>
impl<E> Unpin for UniversalParams<E>where
<E as PairingEngine>::G2Affine: Unpin,
<<E as PairingEngine>::G2Affine as PairingCurve>::Prepared: Unpin,
impl<E> !UnwindSafe for UniversalParams<E>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more