pub struct EdDSAPrivateKey(/* private fields */);Expand description
A private key for the EdDSA signature scheme.
Implementations§
Source§impl EdDSAPrivateKey
impl EdDSAPrivateKey
Sourcepub fn from_bytes(bytes: [u8; 32]) -> EdDSAPrivateKey
pub fn from_bytes(bytes: [u8; 32]) -> EdDSAPrivateKey
Create a private key from a 32-byte array.
Sourcepub fn random<R>(rng: &mut R) -> EdDSAPrivateKey
pub fn random<R>(rng: &mut R) -> EdDSAPrivateKey
Generate a random private key using the given RNG.
Sourcepub fn public(&self) -> EdDSAPublicKey
pub fn public(&self) -> EdDSAPublicKey
Derive the public key corresponding to this private key.
Sourcepub fn sign(&self, message: Fp<MontBackend<FrConfig, 4>, 4>) -> EdDSASignature
pub fn sign(&self, message: Fp<MontBackend<FrConfig, 4>, 4>) -> EdDSASignature
Sign a message (a BaseField element) with the given secret key (a ScalarField element).
The message should be hashed to a BaseField element if it is not encodable as one before signing.
Trait Implementations§
Source§impl Clone for EdDSAPrivateKey
impl Clone for EdDSAPrivateKey
Source§fn clone(&self) -> EdDSAPrivateKey
fn clone(&self) -> EdDSAPrivateKey
Returns a duplicate 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 Drop for EdDSAPrivateKey
impl Drop for EdDSAPrivateKey
Auto Trait Implementations§
impl Freeze for EdDSAPrivateKey
impl RefUnwindSafe for EdDSAPrivateKey
impl Send for EdDSAPrivateKey
impl Sync for EdDSAPrivateKey
impl Unpin for EdDSAPrivateKey
impl UnsafeUnpin for EdDSAPrivateKey
impl UnwindSafe for EdDSAPrivateKey
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more