Struct schnorr_fun::binonce::NonceKeyPair
source · pub struct NonceKeyPair {
pub public: Nonce<NonZero>,
pub secret: [Scalar; 2],
}
Expand description
A pair of secret nonces along with the public portion.
A nonce key pair can be created manually with from_secrets
Fields§
§public: Nonce<NonZero>
The public nonce
secret: [Scalar; 2]
The secret nonce
Implementations§
source§impl NonceKeyPair
impl NonceKeyPair
sourcepub fn from_secrets(secret: [Scalar; 2]) -> Self
pub fn from_secrets(secret: [Scalar; 2]) -> Self
Load nonces from two secret scalars
sourcepub fn from_bytes(bytes: [u8; 64]) -> Option<Self>
pub fn from_bytes(bytes: [u8; 64]) -> Option<Self>
Deserializes a nonce key pair from 64-bytes (two 32-byte serialized scalars).
sourcepub fn to_bytes(&self) -> [u8; 64]
pub fn to_bytes(&self) -> [u8; 64]
Serializes a nonce key pair to 64-bytes (two 32-bytes serialized scalars).
sourcepub fn secret(&self) -> &[Scalar; 2]
pub fn secret(&self) -> &[Scalar; 2]
Get the secret portion of the nonce key pair (don’t share this!)
Trait Implementations§
source§impl<'de> BorrowDecode<'de> for NonceKeyPair
Available on crate feature bincode
only.
impl<'de> BorrowDecode<'de> for NonceKeyPair
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 Clone for NonceKeyPair
impl Clone for NonceKeyPair
source§fn clone(&self) -> NonceKeyPair
fn clone(&self) -> NonceKeyPair
Returns a copy 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 NonceKeyPair
impl Debug for NonceKeyPair
source§impl Decode for NonceKeyPair
Available on crate feature bincode
only.
impl Decode for NonceKeyPair
Available on crate feature
bincode
only.source§impl<'de> Deserialize<'de> for NonceKeyPair
Available on crate feature serde
only.
impl<'de> Deserialize<'de> for NonceKeyPair
Available on crate feature
serde
only.source§fn deserialize<Deser: Deserializer<'de>>(
deserializer: Deser
) -> Result<NonceKeyPair, Deser::Error>
fn deserialize<Deser: Deserializer<'de>>( deserializer: Deser ) -> Result<NonceKeyPair, Deser::Error>
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for NonceKeyPair
impl Display for NonceKeyPair
source§impl Encode for NonceKeyPair
Available on crate feature bincode
only.
impl Encode for NonceKeyPair
Available on crate feature
bincode
only.source§impl FromStr for NonceKeyPair
impl FromStr for NonceKeyPair
source§impl PartialEq for NonceKeyPair
impl PartialEq for NonceKeyPair
source§fn eq(&self, other: &NonceKeyPair) -> bool
fn eq(&self, other: &NonceKeyPair) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for NonceKeyPair
Available on crate feature serde
only.
impl Serialize for NonceKeyPair
Available on crate feature
serde
only.impl StructuralPartialEq for NonceKeyPair
Auto Trait Implementations§
impl RefUnwindSafe for NonceKeyPair
impl Send for NonceKeyPair
impl Sync for NonceKeyPair
impl Unpin for NonceKeyPair
impl UnwindSafe for NonceKeyPair
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