Struct chain_vote::cryptography::commitment::CommitmentKey
source · pub struct CommitmentKey {
pub h: GroupElement,
}
Expand description
Pedersen Commitment key
Fields§
§h: GroupElement
Implementations§
source§impl CommitmentKey
impl CommitmentKey
pub fn to_bytes(&self) -> [u8; 32]
sourcepub(crate) fn commit_with_open(&self, o: &Open) -> GroupElement
pub(crate) fn commit_with_open(&self, o: &Open) -> GroupElement
Return a commitment with the given opening, o
fn commit_with_random(&self, m: &Scalar, r: &Scalar) -> GroupElement
sourcepub(crate) fn commit<R>(
&self,
m: &Scalar,
rng: &mut R
) -> (GroupElement, Scalar)where
R: CryptoRng + RngCore,
pub(crate) fn commit<R>( &self, m: &Scalar, rng: &mut R ) -> (GroupElement, Scalar)where R: CryptoRng + RngCore,
Return a commitment, and the used randomness, r
, where the latter is computed
from a Rng + CryptoRng
Trait Implementations§
source§impl Clone for CommitmentKey
impl Clone for CommitmentKey
source§fn clone(&self) -> CommitmentKey
fn clone(&self) -> CommitmentKey
Returns a copy 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 moreAuto Trait Implementations§
impl RefUnwindSafe for CommitmentKey
impl Send for CommitmentKey
impl Sync for CommitmentKey
impl Unpin for CommitmentKey
impl UnwindSafe for CommitmentKey
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