Struct dusk_pki::SecretSpendKey
source · [−]pub struct SecretSpendKey { /* private fields */ }
Expand description
Secret pair of a
and b
defining a SecretSpendKey
Implementations
sourceimpl SecretSpendKey
impl SecretSpendKey
sourcepub fn new(a: JubJubScalar, b: JubJubScalar) -> Self
pub fn new(a: JubJubScalar, b: JubJubScalar) -> Self
This method is used to construct a new SecretSpendKey
from the given
secret pair of a
and b
.
sourcepub fn a(&self) -> &JubJubScalar
pub fn a(&self) -> &JubJubScalar
Gets a
sourcepub fn b(&self) -> &JubJubScalar
pub fn b(&self) -> &JubJubScalar
Gets b
sourcepub fn random<R: RngCore + CryptoRng>(rng: &mut R) -> Self
pub fn random<R: RngCore + CryptoRng>(rng: &mut R) -> Self
Deterministically create a new SecretSpendKey
from a random number
generator
sourcepub fn sk_r(&self, sa: &StealthAddress) -> SecretKey
pub fn sk_r(&self, sa: &StealthAddress) -> SecretKey
Generates a SecretKey
using the StealthAddress
given.
With the formula: sk_r = H(a · R) + b
sourcepub fn public_spend_key(&self) -> PublicSpendKey
pub fn public_spend_key(&self) -> PublicSpendKey
Derive the secret to deterministically construct a PublicSpendKey
Trait Implementations
sourceimpl Clone for SecretSpendKey
impl Clone for SecretSpendKey
sourcefn clone(&self) -> SecretSpendKey
fn clone(&self) -> SecretSpendKey
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl ConstantTimeEq for SecretSpendKey
impl ConstantTimeEq for SecretSpendKey
sourceimpl Debug for SecretSpendKey
impl Debug for SecretSpendKey
sourceimpl From<&SecretSpendKey> for PublicSpendKey
impl From<&SecretSpendKey> for PublicSpendKey
sourcefn from(secret: &SecretSpendKey) -> Self
fn from(secret: &SecretSpendKey) -> Self
Converts to this type from the input type.
sourceimpl From<&SecretSpendKey> for ViewKey
impl From<&SecretSpendKey> for ViewKey
sourcefn from(secret: &SecretSpendKey) -> Self
fn from(secret: &SecretSpendKey) -> Self
Converts to this type from the input type.
sourceimpl From<SecretSpendKey> for PublicSpendKey
impl From<SecretSpendKey> for PublicSpendKey
sourcefn from(secret: SecretSpendKey) -> Self
fn from(secret: SecretSpendKey) -> Self
Converts to this type from the input type.
sourceimpl From<SecretSpendKey> for ViewKey
impl From<SecretSpendKey> for ViewKey
sourcefn from(secret: SecretSpendKey) -> Self
fn from(secret: SecretSpendKey) -> Self
Converts to this type from the input type.
sourceimpl LowerHex for SecretSpendKey
impl LowerHex for SecretSpendKey
sourceimpl PartialEq<SecretSpendKey> for SecretSpendKey
impl PartialEq<SecretSpendKey> for SecretSpendKey
sourceimpl Serializable<64> for SecretSpendKey
impl Serializable<64> for SecretSpendKey
sourceimpl UpperHex for SecretSpendKey
impl UpperHex for SecretSpendKey
impl Copy for SecretSpendKey
impl Eq for SecretSpendKey
impl StructuralEq for SecretSpendKey
Auto Trait Implementations
impl RefUnwindSafe for SecretSpendKey
impl Send for SecretSpendKey
impl Sync for SecretSpendKey
impl Unpin for SecretSpendKey
impl UnwindSafe for SecretSpendKey
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T, const N: usize> DeserializableSlice<N> for T where
T: Serializable<N>,
impl<T, const N: usize> DeserializableSlice<N> for T where
T: Serializable<N>,
sourceimpl<T, const N: usize> ParseHexStr<N> for T where
T: Serializable<N>,
impl<T, const N: usize> ParseHexStr<N> for T where
T: Serializable<N>,
sourcefn from_hex_str(s: &str) -> Result<Self, Self::Error> where
Self::Error: BadLength,
Self::Error: InvalidChar,
fn from_hex_str(s: &str) -> Result<Self, Self::Error> where
Self::Error: BadLength,
Self::Error: InvalidChar,
Parse a string slice as bytes hex representation and returns `