Struct secp256k1zkp::key::SecretKey
source · 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§
source§impl SecretKey
impl SecretKey
sourcepub 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
source§impl SecretKey
impl SecretKey
sourcepub 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
sourcepub 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
Trait Implementations§
source§impl<'de> Deserialize<'de> for SecretKey
impl<'de> Deserialize<'de> for SecretKey
source§fn deserialize<D>(d: D) -> Result<SecretKey, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(d: D) -> Result<SecretKey, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for SecretKey
impl Ord for SecretKey
source§impl PartialEq for SecretKey
impl PartialEq for SecretKey
source§impl PartialOrd for SecretKey
impl PartialOrd for SecretKey
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 moreimpl Eq for SecretKey
Auto Trait Implementations§
impl Freeze for SecretKey
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