Struct stack_epic_wallet_libwallet::crypto::SecretKey
pub struct SecretKey(pub [u8; 32]);Expand description
Secret 256-bit key used as x in an ECDSA signature
Tuple Fields§
§0: [u8; 32]Implementations§
§impl SecretKey
impl SecretKey
pub fn as_mut_ptr(&mut self) -> *mut u8
pub fn as_mut_ptr(&mut self) -> *mut u8
Converts the object to a mutable raw pointer for FFI interfacing
§impl SecretKey
impl SecretKey
pub fn new<R>(secp: &Secp256k1, rng: &mut R) -> SecretKeywhere
R: Rng,
pub fn new<R>(secp: &Secp256k1, rng: &mut R) -> SecretKeywhere
R: Rng,
Creates a new random secret key
pub fn from_slice(secp: &Secp256k1, data: &[u8]) -> Result<SecretKey, Error>
pub fn from_slice(secp: &Secp256k1, data: &[u8]) -> Result<SecretKey, Error>
Converts a SECRET_KEY_SIZE-byte slice to a secret key
pub fn add_assign(
&mut self,
secp: &Secp256k1,
other: &SecretKey
) -> Result<(), Error>
pub fn add_assign( &mut self, secp: &Secp256k1, other: &SecretKey ) -> Result<(), Error>
Adds one secret key to another, modulo the curve order
pub fn mul_assign(
&mut self,
secp: &Secp256k1,
other: &SecretKey
) -> Result<(), Error>
pub fn mul_assign( &mut self, secp: &Secp256k1, other: &SecretKey ) -> Result<(), Error>
Multiplies one secret key by another, modulo the curve order
pub fn inv_assign(&mut self, secp: &Secp256k1) -> Result<(), Error>
pub fn inv_assign(&mut self, secp: &Secp256k1) -> Result<(), Error>
Inverses the secret key
pub fn neg_assign(&mut self, secp: &Secp256k1) -> Result<(), Error>
pub fn neg_assign(&mut self, secp: &Secp256k1) -> Result<(), Error>
Negates the secret key
Trait Implementations§
§impl<'de> Deserialize<'de> for SecretKey
impl<'de> Deserialize<'de> for SecretKey
§fn deserialize<D>(d: D) -> Result<SecretKey, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(d: D) -> Result<SecretKey, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Ord for SecretKey
impl Ord for SecretKey
§impl PartialOrd for SecretKey
impl PartialOrd for SecretKey
§fn partial_cmp(&self, other: &SecretKey) -> Option<Ordering>
fn partial_cmp(&self, other: &SecretKey) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read more§impl Serialize for SecretKey
impl Serialize for SecretKey
§fn serialize<S>(
&self,
s: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
s: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for SecretKey
Auto Trait Implementations§
impl RefUnwindSafe for SecretKey
impl Send for SecretKey
impl Sync for SecretKey
impl Unpin for SecretKey
impl UnwindSafe for SecretKey
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
§impl<T> CloneAny for T
impl<T> CloneAny for T
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<'a, T> DefaultFeatures<'a> for T
impl<'a, T> DefaultFeatures<'a> for T
§fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a>>
fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a>>
Clone this value, and then immediately put it into a
Box
behind a trait object of this trait.§fn self_address_mut(&mut self) -> *mut ()
fn self_address_mut(&mut self) -> *mut ()
Returns the address of
self. Read moresource§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<'a, T> NonSyncFeatures<'a> for Twhere
T: 'a + Clone,
impl<'a, T> NonSyncFeatures<'a> for Twhere
T: 'a + Clone,
§fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a>>
fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a>>
Clone this value, and then immediately put it into a
Box
behind a trait object of this trait.§fn self_address_mut(&mut self) -> *mut ()
fn self_address_mut(&mut self) -> *mut ()
Returns the address of
self. Read more§impl<T> SafeBorrow<T> for Twhere
T: ?Sized,
impl<T> SafeBorrow<T> for Twhere
T: ?Sized,
§fn borrow_replacement(ptr: &T) -> &T
fn borrow_replacement(ptr: &T) -> &T
Given
ptr, which was obtained from a prior call to Self::borrow(),
return a value with the same nominal lifetime which is guaranteed to
survive mutations to Self. Read more