Struct schnorr_fun::binonce::Nonce
source · pub struct Nonce<Z = NonZero>(pub [Point<Normal, Public, Z>; 2]);
Expand description
A nonce (pair of points) that each party must share with the others in the first stage of signing.
The type argument determines whether the nonces can be Zero
or not. The musig
spec specifies that the aggregate nonce is allowed
to be zero to avoid having to abort the protocol in this case.
Tuple Fields§
§0: [Point<Normal, Public, Z>; 2]
Implementations§
source§impl<Z: ZeroChoice> Nonce<Z>
impl<Z: ZeroChoice> Nonce<Z>
sourcepub fn from_bytes(bytes: [u8; 66]) -> Option<Self>
pub fn from_bytes(bytes: [u8; 66]) -> Option<Self>
Reads the pair of nonces from 66 bytes (two 33-byte serialized points).
If either pair of 33 bytes is [0u8;32]
that point is interpreted as Zero
.
Trait Implementations§
source§impl<'de, Z: ZeroChoice> BorrowDecode<'de> for Nonce<Z>
Available on crate feature bincode
only.
impl<'de, Z: ZeroChoice> BorrowDecode<'de> for Nonce<Z>
Available on crate feature
bincode
only.source§fn borrow_decode<D: BorrowDecoder<'de>>(
decoder: &mut D
) -> Result<Self, DecodeError>
fn borrow_decode<D: BorrowDecoder<'de>>( decoder: &mut D ) -> Result<Self, DecodeError>
Attempt to decode this type with the given BorrowDecode.
source§impl<Z: ZeroChoice> Decode for Nonce<Z>
Available on crate feature bincode
only.
impl<Z: ZeroChoice> Decode for Nonce<Z>
Available on crate feature
bincode
only.source§impl<'de, Z: ZeroChoice> Deserialize<'de> for Nonce<Z>
Available on crate feature serde
only.
impl<'de, Z: ZeroChoice> Deserialize<'de> for Nonce<Z>
Available on crate feature
serde
only.source§fn deserialize<Deser: Deserializer<'de>>(
deserializer: Deser
) -> Result<Nonce<Z>, Deser::Error>
fn deserialize<Deser: Deserializer<'de>>( deserializer: Deser ) -> Result<Nonce<Z>, Deser::Error>
Deserialize this value from the given Serde deserializer. Read more
source§impl<Z: ZeroChoice> FromStr for Nonce<Z>
impl<Z: ZeroChoice> FromStr for Nonce<Z>
source§impl<Z: PartialEq> PartialEq for Nonce<Z>
impl<Z: PartialEq> PartialEq for Nonce<Z>
impl<Z: Copy> Copy for Nonce<Z>
impl<Z: Eq> Eq for Nonce<Z>
impl<Z> StructuralPartialEq for Nonce<Z>
Auto Trait Implementations§
impl<Z> RefUnwindSafe for Nonce<Z>where
Z: RefUnwindSafe,
impl<Z> Send for Nonce<Z>where
Z: Send,
impl<Z> Sync for Nonce<Z>where
Z: Sync,
impl<Z> Unpin for Nonce<Z>where
Z: Unpin,
impl<Z> UnwindSafe for Nonce<Z>where
Z: UnwindSafe,
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