pub struct GenericDistributionSharesBox<G: Group> {
pub commitments: Vec<G::Element>,
pub positions: HashMap<Vec<u8>, i64>,
pub shares: HashMap<Vec<u8>, G::Element>,
pub publickeys: Vec<G::Element>,
pub challenge: G::Scalar,
pub responses: HashMap<Vec<u8>, G::Scalar>,
pub U: BigInt,
}Expand description
Generic distribution shares box for any cryptographic group.
Used to store all encrypted shares with commitments and proofs.
Note: Uses HashMap with Vec
Fields§
§commitments: Vec<G::Element>§positions: HashMap<Vec<u8>, i64>Maps serialized element bytes to position
Maps serialized element bytes to encrypted share
publickeys: Vec<G::Element>§challenge: G::Scalar§responses: HashMap<Vec<u8>, G::Scalar>Maps serialized element bytes to response
U: BigIntImplementations§
pub fn new() -> Self
Sourcepub fn init(
&mut self,
commitments: &[G::Element],
positions: HashMap<Vec<u8>, i64>,
shares: HashMap<Vec<u8>, G::Element>,
publickeys: &[G::Element],
challenge: &G::Scalar,
responses: HashMap<Vec<u8>, G::Scalar>,
U: &BigInt,
)
pub fn init( &mut self, commitments: &[G::Element], positions: HashMap<Vec<u8>, i64>, shares: HashMap<Vec<u8>, G::Element>, publickeys: &[G::Element], challenge: &G::Scalar, responses: HashMap<Vec<u8>, G::Scalar>, U: &BigInt, )
Initialize the distribution shares box.
Note: positions, shares, and responses should use Vec
Trait Implementations§
Source§fn clone(&self) -> GenericDistributionSharesBox<G>
fn clone(&self) -> GenericDistributionSharesBox<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 moreAuto Trait Implementations§
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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more