Struct snarkvm_algorithms::commitment::pedersen::PedersenCommitment
source · [−]pub struct PedersenCommitment<G: ProjectiveCurve, const NUM_WINDOWS: usize, const WINDOW_SIZE: usize> {
pub crh: PedersenCRH<G, NUM_WINDOWS, WINDOW_SIZE>,
pub random_base: Vec<G>,
}
Fields
crh: PedersenCRH<G, NUM_WINDOWS, WINDOW_SIZE>
random_base: Vec<G>
Trait Implementations
sourceimpl<G: Clone + ProjectiveCurve, const NUM_WINDOWS: usize, const WINDOW_SIZE: usize> Clone for PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
impl<G: Clone + ProjectiveCurve, const NUM_WINDOWS: usize, const WINDOW_SIZE: usize> Clone for PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
sourcefn clone(&self) -> PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
fn clone(&self) -> PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
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 more
sourceimpl<G: ProjectiveCurve, const NUM_WINDOWS: usize, const WINDOW_SIZE: usize> CommitmentScheme for PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
impl<G: ProjectiveCurve, const NUM_WINDOWS: usize, const WINDOW_SIZE: usize> CommitmentScheme for PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
type Output = G::Affine
type Parameters = (Vec<Vec<G>>, Vec<G>)
type Randomness = G::ScalarField
fn setup(message: &str) -> Self
fn commit(
&self,
input: &[u8],
randomness: &Self::Randomness
) -> Result<Self::Output, CommitmentError>
fn parameters(&self) -> Self::Parameters
sourceimpl<G: Debug + ProjectiveCurve, const NUM_WINDOWS: usize, const WINDOW_SIZE: usize> Debug for PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
impl<G: Debug + ProjectiveCurve, const NUM_WINDOWS: usize, const WINDOW_SIZE: usize> Debug for PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
sourceimpl<G: ProjectiveCurve, const NUM_WINDOWS: usize, const WINDOW_SIZE: usize> From<(Vec<Vec<G, Global>, Global>, Vec<G, Global>)> for PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
impl<G: ProjectiveCurve, const NUM_WINDOWS: usize, const WINDOW_SIZE: usize> From<(Vec<Vec<G, Global>, Global>, Vec<G, Global>)> for PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
sourceimpl<G: ProjectiveCurve, const NUM_WINDOWS: usize, const WINDOW_SIZE: usize> From<PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>> for PedersenCompressedCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
impl<G: ProjectiveCurve, const NUM_WINDOWS: usize, const WINDOW_SIZE: usize> From<PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>> for PedersenCompressedCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
sourcefn from(pedersen: PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>) -> Self
fn from(pedersen: PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>) -> Self
Performs the conversion.
sourceimpl<G: ProjectiveCurve, const NUM_WINDOWS: usize, const WINDOW_SIZE: usize> FromBytes for PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
impl<G: ProjectiveCurve, const NUM_WINDOWS: usize, const WINDOW_SIZE: usize> FromBytes for PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
sourceimpl<G: Ord + ProjectiveCurve, const NUM_WINDOWS: usize, const WINDOW_SIZE: usize> Ord for PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
impl<G: Ord + ProjectiveCurve, const NUM_WINDOWS: usize, const WINDOW_SIZE: usize> Ord for PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
sourcefn cmp(
&self,
other: &PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
) -> Ordering
fn cmp(
&self,
other: &PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
sourceimpl<G: PartialEq + ProjectiveCurve, const NUM_WINDOWS: usize, const WINDOW_SIZE: usize> PartialEq<PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>> for PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
impl<G: PartialEq + ProjectiveCurve, const NUM_WINDOWS: usize, const WINDOW_SIZE: usize> PartialEq<PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>> for PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
sourcefn eq(&self, other: &PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>) -> bool
fn eq(&self, other: &PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>) -> bool
fn ne(&self, other: &PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>) -> bool
This method tests for !=
.
sourceimpl<G: PartialOrd + ProjectiveCurve, const NUM_WINDOWS: usize, const WINDOW_SIZE: usize> PartialOrd<PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>> for PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
impl<G: PartialOrd + ProjectiveCurve, const NUM_WINDOWS: usize, const WINDOW_SIZE: usize> PartialOrd<PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>> for PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
sourcefn partial_cmp(
&self,
other: &PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
) -> Option<Ordering>
fn partial_cmp(
&self,
other: &PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<G: ProjectiveCurve, const NUM_WINDOWS: usize, const WINDOW_SIZE: usize> ToBytes for PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
impl<G: ProjectiveCurve, const NUM_WINDOWS: usize, const WINDOW_SIZE: usize> ToBytes for PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
sourceimpl<F: Field, G: ProjectiveCurve + ToConstraintField<F>, const NUM_WINDOWS: usize, const WINDOW_SIZE: usize> ToConstraintField<F> for PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
impl<F: Field, G: ProjectiveCurve + ToConstraintField<F>, const NUM_WINDOWS: usize, const WINDOW_SIZE: usize> ToConstraintField<F> for PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
fn to_field_elements(&self) -> Result<Vec<F>, ConstraintFieldError>
impl<G: Eq + ProjectiveCurve, const NUM_WINDOWS: usize, const WINDOW_SIZE: usize> Eq for PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
impl<G: ProjectiveCurve, const NUM_WINDOWS: usize, const WINDOW_SIZE: usize> StructuralEq for PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
impl<G: ProjectiveCurve, const NUM_WINDOWS: usize, const WINDOW_SIZE: usize> StructuralPartialEq for PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
Auto Trait Implementations
impl<G, const NUM_WINDOWS: usize, const WINDOW_SIZE: usize> RefUnwindSafe for PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE> where
G: RefUnwindSafe,
impl<G, const NUM_WINDOWS: usize, const WINDOW_SIZE: usize> Send for PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
impl<G, const NUM_WINDOWS: usize, const WINDOW_SIZE: usize> Sync for PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE>
impl<G, const NUM_WINDOWS: usize, const WINDOW_SIZE: usize> Unpin for PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE> where
G: Unpin,
impl<G, const NUM_WINDOWS: usize, const WINDOW_SIZE: usize> UnwindSafe for PedersenCommitment<G, NUM_WINDOWS, WINDOW_SIZE> where
G: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcepub fn equivalent(&self, key: &K) -> bool
pub fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more