Struct chain_vote::committee::ElectionPublicKey
source · pub struct ElectionPublicKey(pub(crate) PublicKey);
Expand description
The overall committee public key used for everyone to encrypt their vote to.
Tuple Fields§
§0: PublicKey
Implementations§
source§impl ElectionPublicKey
impl ElectionPublicKey
sourcepub fn encrypt_and_prove_vote<R: RngCore + CryptoRng>(
&self,
rng: &mut R,
crs: &Crs,
vote: Vote
) -> (EncryptedVote, ProofOfCorrectVote)
pub fn encrypt_and_prove_vote<R: RngCore + CryptoRng>( &self, rng: &mut R, crs: &Crs, vote: Vote ) -> (EncryptedVote, ProofOfCorrectVote)
Take a vote and encrypt it + provide a proof of correct voting
sourcepub fn from_participants(pks: &[MemberPublicKey]) -> Self
pub fn from_participants(pks: &[MemberPublicKey]) -> Self
Create an election public key from all the participants of this committee
pub fn to_bytes(&self) -> Vec<u8>
pub fn from_bytes(buf: &[u8]) -> Option<Self>
Trait Implementations§
source§impl Bech32 for ElectionPublicKey
impl Bech32 for ElectionPublicKey
source§const BECH32_HRP: &'static str = _
const BECH32_HRP: &'static str = _
The human-readable prefix that is used to represent the
the object in the Bech32 format. On decoding, the HRP of the input
string is checked against this value.
source§fn try_from_bech32_str(bech32_str: &str) -> Result<Self, Error>
fn try_from_bech32_str(bech32_str: &str) -> Result<Self, Error>
Decodes the object from its Bech32 string representation.
source§fn to_bech32_str(&self) -> String
fn to_bech32_str(&self) -> String
Produces a Bech32 string format representation of the object.
source§impl Clone for ElectionPublicKey
impl Clone for ElectionPublicKey
source§fn clone(&self) -> ElectionPublicKey
fn clone(&self) -> ElectionPublicKey
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 moresource§impl Debug for ElectionPublicKey
impl Debug for ElectionPublicKey
source§impl PartialEq<ElectionPublicKey> for ElectionPublicKey
impl PartialEq<ElectionPublicKey> for ElectionPublicKey
source§fn eq(&self, other: &ElectionPublicKey) -> bool
fn eq(&self, other: &ElectionPublicKey) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for ElectionPublicKey
impl StructuralEq for ElectionPublicKey
impl StructuralPartialEq for ElectionPublicKey
Auto Trait Implementations§
impl RefUnwindSafe for ElectionPublicKey
impl Send for ElectionPublicKey
impl Sync for ElectionPublicKey
impl Unpin for ElectionPublicKey
impl UnwindSafe for ElectionPublicKey
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