[][src]Struct ed25519_compact::SecretKey

pub struct SecretKey(_);

A secret key.

Implementations

impl SecretKey[src]

pub const BYTES: usize[src]

Number of bytes in a secret key.

pub fn new(sk: [u8; 64]) -> Self[src]

Creates a secret key from raw bytes.

pub fn from_slice(sk: &[u8]) -> Result<Self, Error>[src]

Creates a secret key from a slice.

pub fn public_key(&self) -> PublicKey[src]

Returns the public counterpart of a secret key.

impl SecretKey[src]

pub fn sign(&self, message: impl AsRef<[u8]>, noise: Option<Noise>) -> Signature[src]

Computes a signature for the message message using the secret key. The noise parameter is optional, but recommended in order to mitigate fault attacks.

Trait Implementations

impl Clone for SecretKey[src]

impl Copy for SecretKey[src]

impl Deref for SecretKey[src]

type Target = [u8; 64]

The resulting type after dereferencing.

fn deref(&self) -> &Self::Target[src]

Returns a secret key as bytes.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.