pub struct SessionSecretRand(/* private fields */);Expand description
Session Id for a MuSig session.
Implementations§
Source§impl SessionSecretRand
impl SessionSecretRand
Sourcepub fn assume_unique_per_nonce_gen(inner: [u8; 32]) -> SessionSecretRand
pub fn assume_unique_per_nonce_gen(inner: [u8; 32]) -> SessionSecretRand
Creates a new SessionSecretRand with the given bytes.
Special care must be taken that the bytes are unique for each call to
KeyAggCache::nonce_gen or new_nonce_pair. The simplest
recommendation is to use a cryptographicaly random 32-byte value.
If the rand feature is enabled, [SessionSecretRand::from_rng] can be used to generate a
random session id.
§Panics
Panics if passed the all-zeros string. This is disallowed by the upstream library. The input to this function should either be the whitened output of a random number generator, or if that is not available, the output of a stable monotonic counter.
Sourcepub fn to_byte_array(&self) -> [u8; 32]
pub fn to_byte_array(&self) -> [u8; 32]
Obtains the inner bytes of the SessionSecretRand.
Sourcepub fn as_byte_array(&self) -> &[u8; 32]
pub fn as_byte_array(&self) -> &[u8; 32]
Obtains a reference to the inner bytes of the SessionSecretRand.
Trait Implementations§
Source§impl Debug for SessionSecretRand
impl Debug for SessionSecretRand
Source§impl PartialEq for SessionSecretRand
impl PartialEq for SessionSecretRand
impl Eq for SessionSecretRand
impl StructuralPartialEq for SessionSecretRand
Auto Trait Implementations§
impl Freeze for SessionSecretRand
impl RefUnwindSafe for SessionSecretRand
impl Send for SessionSecretRand
impl Sync for SessionSecretRand
impl Unpin for SessionSecretRand
impl UnwindSafe for SessionSecretRand
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