pub struct SecretKey(/* private fields */);Expand description
A r255b3 secret key to sign messages with.
This is a scalar mod the group order of Ristretto255, sligtly more than 2²⁵².
Implementations§
Source§impl SecretKey
impl SecretKey
Sourcepub fn parse_bytes(bits: [u8; 32]) -> Result<SecretKey, Error>
pub fn parse_bytes(bits: [u8; 32]) -> Result<SecretKey, Error>
Parse a secret key from an externally provided byte array, ensuring that it is a valid key.
Use SecretKey::from_bytes for key generation.
Sourcepub fn from_bytes(value: [u8; 32]) -> SecretKey
pub fn from_bytes(value: [u8; 32]) -> SecretKey
Construct a secret key from 256 arbitrary bits,
Use SecretKey::parse_bytes if you are reading this key from storage or anything like that.
Sourcepub fn sign(&self, domain: Domain, msg: &[u8]) -> Signature
pub fn sign(&self, domain: Domain, msg: &[u8]) -> Signature
Sign a message, in a particular domain, with a derived nonce.
This is the primary signing method.
Non-application specific signatures may use empty Domain, “”.
Sourcepub fn derive_public(&self) -> PublicKey
pub fn derive_public(&self) -> PublicKey
Derive the public key from the secret key.
(Scales the base point by the secret key.)
Sourcepub fn derive_keys(&self) -> Keys
pub fn derive_keys(&self) -> Keys
Derive a complete signing key from the secret key.
Trait Implementations§
Source§impl ConstantTimeEq for SecretKey
impl ConstantTimeEq for SecretKey
impl 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