Struct decaf377_rdsa::SigningKey
source · pub struct SigningKey<D: Domain> { /* private fields */ }
Expand description
A decaf377-rdsa
signing key.
Implementations§
source§impl<D: Domain> SigningKey<D>
impl<D: Domain> SigningKey<D>
source§impl SigningKey<SpendAuth>
impl SigningKey<SpendAuth>
sourcepub fn randomize(&self, randomizer: &Fr) -> SigningKey<SpendAuth>
pub fn randomize(&self, randomizer: &Fr) -> SigningKey<SpendAuth>
Randomize this public key with the given randomizer
.
source§impl<D: Domain> SigningKey<D>
impl<D: Domain> SigningKey<D>
sourcepub fn new<R: RngCore + CryptoRng>(rng: R) -> SigningKey<D>
pub fn new<R: RngCore + CryptoRng>(rng: R) -> SigningKey<D>
Create a new signing key from the supplied rng
.
sourcepub fn new_from_field(sk: Fr) -> SigningKey<D>
pub fn new_from_field(sk: Fr) -> SigningKey<D>
Use the supplied field element as the signing key directly.
§Warning
This function exists to allow custom key derivation; it’s the caller’s responsibility to ensure that the input was generated securely.
sourcepub fn sign<R: RngCore + CryptoRng>(&self, rng: R, msg: &[u8]) -> Signature<D>
pub fn sign<R: RngCore + CryptoRng>(&self, rng: R, msg: &[u8]) -> Signature<D>
Create a signature for domain D
on msg
using this SigningKey
.
sourcepub fn sign_deterministic(&self, msg: &[u8]) -> Signature<D>
pub fn sign_deterministic(&self, msg: &[u8]) -> Signature<D>
Create a signature for domain D
on msg
using this SigningKey
.
Prefer sign
, unless you know you need deterministic signatures.
Trait Implementations§
source§impl<D: Clone + Domain> Clone for SigningKey<D>
impl<D: Clone + Domain> Clone for SigningKey<D>
source§fn clone(&self) -> SigningKey<D>
fn clone(&self) -> SigningKey<D>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SigningKey<Binding>
impl Debug for SigningKey<Binding>
source§impl Debug for SigningKey<SpendAuth>
impl Debug for SigningKey<SpendAuth>
source§impl<'de, D> Deserialize<'de> for SigningKey<D>where
D: Domain,
impl<'de, D> Deserialize<'de> for SigningKey<D>where
D: Domain,
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<'a, D: Domain> From<&'a SigningKey<D>> for VerificationKey<D>
impl<'a, D: Domain> From<&'a SigningKey<D>> for VerificationKey<D>
source§fn from(sk: &'a SigningKey<D>) -> VerificationKey<D>
fn from(sk: &'a SigningKey<D>) -> VerificationKey<D>
Converts to this type from the input type.
source§impl<D: Domain> From<Fp<MontBackend<FrConfig, 4>, 4>> for SigningKey<D>
impl<D: Domain> From<Fp<MontBackend<FrConfig, 4>, 4>> for SigningKey<D>
source§impl<'a, D: Domain> From<SigningKey<D>> for VerificationKey<D>
impl<'a, D: Domain> From<SigningKey<D>> for VerificationKey<D>
source§fn from(sk: SigningKey<D>) -> VerificationKey<D>
fn from(sk: SigningKey<D>) -> VerificationKey<D>
Converts to this type from the input type.
source§impl<D> Serialize for SigningKey<D>where
D: Domain,
impl<D> Serialize for SigningKey<D>where
D: Domain,
impl<D: Copy + Domain> Copy for SigningKey<D>
Auto Trait Implementations§
impl<D> Freeze for SigningKey<D>
impl<D> RefUnwindSafe for SigningKey<D>where
D: RefUnwindSafe,
impl<D> Send for SigningKey<D>where
D: Send,
impl<D> Sync for SigningKey<D>where
D: Sync,
impl<D> Unpin for SigningKey<D>where
D: Unpin,
impl<D> UnwindSafe for SigningKey<D>where
D: UnwindSafe,
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