[][src]Struct snarkos_objects::account::account_private_key::AccountPrivateKey

pub struct AccountPrivateKey<C: DPCComponents> {
    pub seed: [u8; 32],
    pub sk_sig: <C::AccountSignature as SignatureScheme>::PrivateKey,
    pub sk_prf: <C::PRF as PRF>::Seed,
    pub r_pk: <C::AccountCommitment as CommitmentScheme>::Randomness,
    pub r_pk_counter: u16,
    pub is_dummy: bool,
}

Fields

seed: [u8; 32]sk_sig: <C::AccountSignature as SignatureScheme>::PrivateKeysk_prf: <C::PRF as PRF>::Seedr_pk: <C::AccountCommitment as CommitmentScheme>::Randomnessr_pk_counter: u16is_dummy: bool

Implementations

impl<C: DPCComponents> AccountPrivateKey<C>[src]

pub fn new<R: Rng>(
    signature_parameters: &C::AccountSignature,
    commitment_parameters: &C::AccountCommitment,
    rng: &mut R
) -> Result<Self, AccountError>
[src]

Creates a new account private key.

pub fn from_seed(
    signature_parameters: &C::AccountSignature,
    commitment_parameters: &C::AccountCommitment,
    seed: &[u8; 32]
) -> Result<Self, AccountError>
[src]

Derives the account private key from a given seed and verifies it is well-formed.

pub fn from_seed_and_counter_unchecked(
    seed: &[u8; 32],
    r_pk_counter: u16
) -> Result<Self, AccountError>
[src]

Derives the account private key from a given seed and counter without verifying if it is well-formed.

pub fn is_valid(
    &self,
    signature_parameters: &C::AccountSignature,
    commitment_parameters: &C::AccountCommitment
) -> bool
[src]

Returns true if the private key is well-formed. Otherwise, returns false.

pub fn to_decryption_key(
    &self,
    signature_parameters: &C::AccountSignature,
    commitment_parameters: &C::AccountCommitment
) -> Result<<C::AccountEncryption as EncryptionScheme>::PrivateKey, AccountError>
[src]

Returns the decryption key for the account view key.

pub fn pk_sig(
    &self,
    signature_parameters: &C::AccountSignature
) -> Result<<C::AccountSignature as SignatureScheme>::PublicKey, AccountError>
[src]

Returns the signature public key for deriving the account view key.

Trait Implementations

impl<C: DPCComponents> Clone for AccountPrivateKey<C> where
    C: DPCComponents
[src]

impl<C: DPCComponents> Debug for AccountPrivateKey<C>[src]

impl<C: DPCComponents> Default for AccountPrivateKey<C> where
    C: DPCComponents
[src]

impl<C: DPCComponents> Display for AccountPrivateKey<C>[src]

impl<C: DPCComponents> Eq for AccountPrivateKey<C> where
    C: DPCComponents
[src]

impl<C: DPCComponents> FromStr for AccountPrivateKey<C>[src]

type Err = AccountError

The associated error which can be returned from parsing.

fn from_str(s: &str) -> Result<Self, Self::Err>[src]

Reads in an account private key string.

impl<C: DPCComponents> PartialEq<AccountPrivateKey<C>> for AccountPrivateKey<C> where
    C: DPCComponents
[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> From<T> for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,