pub struct MemberCommitmentKey<G: AffineRepr> {
pub g: G,
pub h: G,
}Expand description
Commitment key to commit the set member
Fields§
§g: G§h: GImplementations§
Source§impl<G: AffineRepr> MemberCommitmentKey<G>
impl<G: AffineRepr> MemberCommitmentKey<G>
pub fn new<D: Digest>(label: &[u8]) -> Self
pub fn generate_using_rng<R: RngCore>(rng: &mut R) -> Self
Sourcepub fn commit(&self, member: &G::ScalarField, randomness: &G::ScalarField) -> G
pub fn commit(&self, member: &G::ScalarField, randomness: &G::ScalarField) -> G
Pedersen commitment to the set member, g * member + h * randomness
Sourcepub fn commit_decomposed(
&self,
base: u16,
digits: &[G::ScalarField],
randomness: &G::ScalarField,
) -> G
pub fn commit_decomposed( &self, base: u16, digits: &[G::ScalarField], randomness: &G::ScalarField, ) -> G
Given base-ary representation of a value, commit to its digits, g * (1 * digits[0] + base * digits[1] + base^2 * digits[2] + base^{n-1} * digits[n-1]) + h * randomness
Sourcepub fn commit_decomposed_given_base_powers(
&self,
base_powers: &[G::ScalarField],
digits: &[G::ScalarField],
randomness: &G::ScalarField,
) -> G
pub fn commit_decomposed_given_base_powers( &self, base_powers: &[G::ScalarField], digits: &[G::ScalarField], randomness: &G::ScalarField, ) -> G
Same as commit_decomposed but takes [1, base, base^2, ..., base^{n-1}]
Trait Implementations§
Source§impl<G: AffineRepr> CanonicalDeserialize for MemberCommitmentKey<G>
impl<G: AffineRepr> CanonicalDeserialize for MemberCommitmentKey<G>
Source§fn deserialize_with_mode<R: Read>(
reader: R,
compress: Compress,
validate: Validate,
) -> Result<Self, SerializationError>
fn deserialize_with_mode<R: Read>( reader: R, compress: Compress, validate: Validate, ) -> Result<Self, SerializationError>
The general deserialize method that takes in customization flags.
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,
Source§impl<G: AffineRepr> CanonicalSerialize for MemberCommitmentKey<G>
impl<G: AffineRepr> CanonicalSerialize for MemberCommitmentKey<G>
Source§fn serialize_with_mode<W: Write>(
&self,
writer: W,
compress: Compress,
) -> Result<(), SerializationError>
fn serialize_with_mode<W: Write>( &self, writer: W, compress: Compress, ) -> Result<(), SerializationError>
The general serialize method that takes in customization flags.
fn serialized_size(&self, compress: 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
Source§impl<G: Clone + AffineRepr> Clone for MemberCommitmentKey<G>
impl<G: Clone + AffineRepr> Clone for MemberCommitmentKey<G>
Source§fn clone(&self) -> MemberCommitmentKey<G>
fn clone(&self) -> MemberCommitmentKey<G>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<G: Debug + AffineRepr> Debug for MemberCommitmentKey<G>
impl<G: Debug + AffineRepr> Debug for MemberCommitmentKey<G>
Source§impl<G: PartialEq + AffineRepr> PartialEq for MemberCommitmentKey<G>
impl<G: PartialEq + AffineRepr> PartialEq for MemberCommitmentKey<G>
Source§impl<G: AffineRepr> Valid for MemberCommitmentKey<G>
impl<G: AffineRepr> Valid for MemberCommitmentKey<G>
fn check(&self) -> Result<(), SerializationError>
fn batch_check<'a>(
batch: impl Iterator<Item = &'a Self> + Send,
) -> Result<(), SerializationError>where
Self: 'a,
impl<G: Eq + AffineRepr> Eq for MemberCommitmentKey<G>
impl<G: AffineRepr> StructuralPartialEq for MemberCommitmentKey<G>
Auto Trait Implementations§
impl<G> Freeze for MemberCommitmentKey<G>where
G: Freeze,
impl<G> RefUnwindSafe for MemberCommitmentKey<G>where
G: RefUnwindSafe,
impl<G> Send for MemberCommitmentKey<G>
impl<G> Sync for MemberCommitmentKey<G>
impl<G> Unpin for MemberCommitmentKey<G>where
G: Unpin,
impl<G> UnwindSafe for MemberCommitmentKey<G>where
G: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more