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

pub struct SubKeyChecker<'a> {
    pub table: HashMap<PublicKey, Index>,
    pub keys: &'a ViewPair,
}

Helper to check if a One-time sub address public key is related to a view pair

Generate a table of sub keys from a view pair given a major range and a minor range. These precomputed keys are used to check if an output is owned by the root view pair.

Fields

table: HashMap<PublicKey, Index>

Table of public spend keys and their corresponding indexes

keys: &'a ViewPair

The root view pair (v, S)

Implementations

impl<'a> SubKeyChecker<'a>[src]

pub fn new(keys: &'a ViewPair, major: Range<u32>, minor: Range<u32>) -> Self[src]

Generate the table of sub spend keys K(S) \in major x minor from a view pair mapped to their Sub-address indexes

pub fn check(
    &self,
    index: usize,
    key: &PublicKey,
    tx_pubkey: &PublicKey
) -> Option<&Index>
[src]

Check if an output public key with its associated random tx public key at index i is in the table, if found then the output is own by the view pair, otherwise the output might be own by someone else, or the table migth be too small.

Trait Implementations

impl<'a> Clone for SubKeyChecker<'a>[src]

impl<'a> Debug for SubKeyChecker<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for SubKeyChecker<'a>

impl<'a> Send for SubKeyChecker<'a>

impl<'a> Sync for SubKeyChecker<'a>

impl<'a> Unpin for SubKeyChecker<'a>

impl<'a> UnwindSafe for SubKeyChecker<'a>

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.