pub struct Random32Bytes(/* private fields */);
Expand description
A convenience wrapper for generating and encoding/decoding cryptographically secure random values.
Implementations§
Source§impl Random32Bytes
impl Random32Bytes
Sourcepub fn generate_mod_q() -> Self
pub fn generate_mod_q() -> Self
Generates a cryptographically secure random value which is less than the order of the Secp256k1
elliptic curve.
Sourcepub fn to_be_bytes(&self) -> [u8; 32]
pub fn to_be_bytes(&self) -> [u8; 32]
Returns 32 bytes representation of the “secret share”.
Trait Implementations§
Source§impl Clone for Random32Bytes
impl Clone for Random32Bytes
Source§fn clone(&self) -> Random32Bytes
fn clone(&self) -> Random32Bytes
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 moreSource§impl Debug for Random32Bytes
impl Debug for Random32Bytes
Source§impl Display for Random32Bytes
impl Display for Random32Bytes
Source§fn from(value: Random32Bytes) -> Self
fn from(value: Random32Bytes) -> Self
Converts Random32Bytes
into a “secret share”.
Source§fn from(value: Random32Bytes) -> Self
fn from(value: Random32Bytes) -> Self
Converts Random32Bytes
into a “signing share”.
Source§impl From<Uint<crypto_bigint::::uint::U256::{constant#0}>> for Random32Bytes
impl From<Uint<crypto_bigint::::uint::U256::{constant#0}>> for Random32Bytes
Source§impl Ord for Random32Bytes
impl Ord for Random32Bytes
Source§fn cmp(&self, other: &Random32Bytes) -> Ordering
fn cmp(&self, other: &Random32Bytes) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for Random32Bytes
impl PartialEq for Random32Bytes
Source§impl PartialOrd for Random32Bytes
impl PartialOrd for Random32Bytes
Source§impl TryFrom<&[u8]> for Random32Bytes
impl TryFrom<&[u8]> for Random32Bytes
Source§impl Zeroize for Random32Bytes
impl Zeroize for Random32Bytes
impl Copy for Random32Bytes
impl Eq for Random32Bytes
impl StructuralPartialEq for Random32Bytes
Auto Trait Implementations§
impl Freeze for Random32Bytes
impl RefUnwindSafe for Random32Bytes
impl Send for Random32Bytes
impl Sync for Random32Bytes
impl Unpin for Random32Bytes
impl UnwindSafe for Random32Bytes
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