pub struct PublicKeySet<G: Group> { /* private fields */ }
Expand description
Full public information about the participants of a threshold ElGamal encryption scheme after all participants’ commitments are collected.
Implementations§
Source§impl<G: Group> PublicKeySet<G>
impl<G: Group> PublicKeySet<G>
Sourcepub fn new(
params: Params,
public_polynomial: Vec<G::Element>,
proof_of_possession: &ProofOfPossession<G>,
) -> Result<Self, Error>
pub fn new( params: Params, public_polynomial: Vec<G::Element>, proof_of_possession: &ProofOfPossession<G>, ) -> Result<Self, Error>
Sourcepub fn from_participants(
params: Params,
participant_keys: Vec<PublicKey<G>>,
) -> Result<Self, Error>
pub fn from_participants( params: Params, participant_keys: Vec<PublicKey<G>>, ) -> Result<Self, Error>
Creates a key set from the parameters and public keys of all participants.
§Errors
Returns an error if the number of keys in participant_keys
does not match the number
of participants in params
, or if participant_keys
are inconsistent (do not correspond
to a single shared key).
Returns the shared public key used in this scheme.
Sourcepub fn participant_key(&self, index: usize) -> Option<&PublicKey<G>>
pub fn participant_key(&self, index: usize) -> Option<&PublicKey<G>>
Returns the public key of a participant with the specified index
. If index
is
out of bounds, returns None
.
Sourcepub fn participant_keys(&self) -> &[PublicKey<G>]
pub fn participant_keys(&self) -> &[PublicKey<G>]
Returns the slice with all participants’ public keys.
Sourcepub fn verify_participant(
&self,
index: usize,
proof: &ProofOfPossession<G>,
) -> Result<(), VerificationError>
pub fn verify_participant( &self, index: usize, proof: &ProofOfPossession<G>, ) -> Result<(), VerificationError>
Verifies a proof of possession of the participant’s secret key.
Proofs of possession for participants are not required for protocol correctness. Still, they can be useful to attribute failures or just as an additional safety mechanism; see the module docs for details.
§Panics
Panics if index
does not correspond to a participant.
§Errors
Returns an error if the proof
does not verify.
Verifies a candidate decryption share for ciphertext
provided by a participant
with the specified index
.
§Errors
Returns an error if the proof
does not verify.
Trait Implementations§
Source§impl<G: Clone + Group> Clone for PublicKeySet<G>
impl<G: Clone + Group> Clone for PublicKeySet<G>
Source§fn clone(&self) -> PublicKeySet<G>
fn clone(&self) -> PublicKeySet<G>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<'de, G: Group> Deserialize<'de> for PublicKeySet<G>
impl<'de, G: Group> Deserialize<'de> for PublicKeySet<G>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl<G> Freeze for PublicKeySet<G>
impl<G> RefUnwindSafe for PublicKeySet<G>
impl<G> Send for PublicKeySet<G>
impl<G> Sync for PublicKeySet<G>
impl<G> Unpin for PublicKeySet<G>
impl<G> UnwindSafe for PublicKeySet<G>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)