pub struct Params {
pub shares: usize,
pub threshold: usize,
}
Expand description
Parameters of a threshold ElGamal encryption scheme.
Fields§
Total number of shares / participants.
threshold: usize
Number of participants necessary to jointly restore the secret.
Implementations§
Source§impl Params
impl Params
Sourcepub const fn new(shares: usize, threshold: usize) -> Self
pub const fn new(shares: usize, threshold: usize) -> Self
Creates new parameters.
§Panics
Panics if shares
is equal to zero or if threshold
is not in 1..=shares
.
Combines shares decrypting the specified ciphertext
. The shares must be provided
together with the 0-based indexes of the participants they are coming from.
Returns the combined decryption, or None
if the number of shares is insufficient.
§Panics
Panics if any index in shares
exceeds the maximum participant’s index as per params
.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Params
impl<'de> Deserialize<'de> for Params
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Params
impl Eq for Params
impl StructuralPartialEq for Params
Auto Trait Implementations§
impl Freeze for Params
impl RefUnwindSafe for Params
impl Send for Params
impl Sync for Params
impl Unpin for Params
impl UnwindSafe for Params
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
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)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)