[][src]Struct monero::cryptonote::onetime_key::KeyGenerator

pub struct KeyGenerator {
    pub spend: PublicKey,
    pub rv: PublicKey,
}

Helper to generate One-Time Public keys (ephemeral keys) in transactions

Fields

spend: PublicKey

Spend public key S

rv: PublicKey

Intermediate key v*8*R or r*8*V used during the generation process

Methods

impl KeyGenerator[src]

pub fn from_random(
    view: PublicKey,
    spend: PublicKey,
    random: PrivateKey
) -> Self
[src]

Construct a One-time key generator from public keys and secret random, this is used to generate One-time keys for output indexes from an address when sending funds

pub fn from_key(keys: &ViewPair, random: PublicKey) -> Self[src]

Construct a One-time key generator from private keys and public random (tx pubkey), this is used to scan if some outputs contains One-time keys owned by the view pair

pub fn one_time_key(&self, index: usize) -> PublicKey[src]

Compute the One-time public key P = Hn(r*8*V || n)*G + S for the indexed output n

pub fn check(&self, index: usize, key: PublicKey) -> bool[src]

Check if key P is equal to indexed key P', if true the output is own by the address, used when scanning transaction outputs, if true the One-time key is related to the keys

pub fn get_rvn_scalar(&self, index: usize) -> PrivateKey[src]

Computes Hn(v*8*R || n) and interpret it as a scalar

Trait Implementations

impl Clone for KeyGenerator[src]

impl Debug for KeyGenerator[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, 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.