pub struct KeyPair {
pub pk: PublicKey,
pub sk: SecretKey,
pub size: u32,
pub threshold: u32,
}
Fields§
§pk: PublicKey
§sk: SecretKey
§size: u32
§threshold: u32
Implementations§
Source§impl KeyPair
impl KeyPair
Sourcepub fn new(
size: &'static u32,
threshold: Threshold,
) -> Result<Self, &'static str>
pub fn new( size: &'static u32, threshold: Threshold, ) -> Result<Self, &'static str>
Generate a new KeyPair Struct from scratch by giving the size of the key desired (in bits) and the threshold of P(err) while assuming that a number is prime. Statistic methods are used to found that numbers. P(err) = 4^-threshold (As is demonstraded on the Rabin-Miller algorithm)
Trait Implementations§
impl StructuralPartialEq for KeyPair
Auto Trait Implementations§
impl Freeze for KeyPair
impl RefUnwindSafe for KeyPair
impl Send for KeyPair
impl Sync for KeyPair
impl Unpin for KeyPair
impl UnwindSafe for KeyPair
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