pub enum SecretKey {
Ed25519(Ed25519SecretKey),
Secp256k1(Secp256k1SecretKey),
}Expand description
The secret key for confidential transfer.
Variants§
Implementations§
source§impl SecretKey
impl SecretKey
sourcepub fn default_secp256k1() -> Self
pub fn default_secp256k1() -> Self
Default secp256k1 secret key
sourcepub fn default_ed25519() -> Self
pub fn default_ed25519() -> Self
Default ed25519 secret key
sourcepub fn to_secp256k1(&self) -> Result<SECP256K1Scalar>
pub fn to_secp256k1(&self) -> Result<SECP256K1Scalar>
Change to algebra secp256k1 Point
sourcepub fn to_ed25519(&self) -> Result<Ed25519Fq>
pub fn to_ed25519(&self) -> Result<Ed25519Fq>
Change to algebra Ristretto Point
sourcepub fn to_bls_scalars(&self) -> Result<[BLSScalar; 2]>
pub fn to_bls_scalars(&self) -> Result<[BLSScalar; 2]>
Return the BLS12-381 scalar representation of the secret key.
sourcepub fn into_keypair(self) -> KeyPair
pub fn into_keypair(self) -> KeyPair
Convert into a keypair.
sourcepub fn from_secp256k1_with_address(bytes: &[u8]) -> Result<Self>
pub fn from_secp256k1_with_address(bytes: &[u8]) -> Result<Self>
Convert from raw bytes used secp256k1 and use it with address.
Trait Implementations§
source§impl<'de> Deserialize<'de> for SecretKey
impl<'de> Deserialize<'de> for SecretKey
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl NoahFromToBytes for SecretKey
impl NoahFromToBytes for SecretKey
source§impl Ord for SecretKey
impl Ord for SecretKey
source§impl PartialEq<SecretKey> for SecretKey
impl PartialEq<SecretKey> for SecretKey
source§impl PartialOrd<SecretKey> for SecretKey
impl PartialOrd<SecretKey> 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 RefUnwindSafe for SecretKey
impl Send for SecretKey
impl Sync for SecretKey
impl Unpin for SecretKey
impl UnwindSafe for SecretKey
Blanket Implementations§
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more