Struct ockam_signature_bls::SecretKey[][src]

pub struct SecretKey(pub Scalar);

The secret key is field element 0 < x < r where r is the curve order. See Section 4.3 in https://eprint.iacr.org/2016/663.pdf

Implementations

impl SecretKey[src]

pub const BYTES: usize[src]

Number of bytes needed to represent the secret key

pub fn hash<B: AsRef<[u8]>>(data: B) -> Option<Self>[src]

Compute a secret key from a hash

pub fn random(rng: impl RngCore + CryptoRng) -> Option<Self>[src]

Compute a secret key from a CS-PRNG

pub fn to_bytes(&self) -> [u8; 32][src]

Get the byte representation of this key

pub fn from_bytes(bytes: &[u8; 32]) -> CtOption<Self>[src]

Convert a big-endian representation of the secret key.

Trait Implementations

impl Clone for SecretKey[src]

impl Debug for SecretKey[src]

impl Default for SecretKey[src]

impl<'de> Deserialize<'de> for SecretKey[src]

impl Drop for SecretKey[src]

impl Eq for SecretKey[src]

impl From<&'_ SecretKey> for PublicKey[src]

impl From<&'_ SecretKey> for PublicKeyVt[src]

impl PartialEq<SecretKey> for SecretKey[src]

impl Serialize for SecretKey[src]

impl StructuralEq for SecretKey[src]

impl StructuralPartialEq for SecretKey[src]

impl Zeroize for SecretKey[src]

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> Conv for T

impl<T> Conv for T

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> FmtForward for T

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

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

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T> TryConv for T

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.