Struct monero::cryptonote::onetime_key::SubKeyChecker
source · Expand description
Helper to check if a onetime 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§
source§impl<'a> SubKeyChecker<'a>
impl<'a> SubKeyChecker<'a>
sourcepub fn new(keys: &'a ViewPair, major: Range<u32>, minor: Range<u32>) -> Self
pub fn new(keys: &'a ViewPair, major: Range<u32>, minor: Range<u32>) -> Self
Generate the table of sub spend keys K(S) \in major x minor
from a view pair mapped to
their Sub-address indexes.
sourcepub fn check(
&self,
index: usize,
key: &PublicKey,
tx_pubkey: &PublicKey
) -> Option<&Index>
pub fn check(
&self,
index: usize,
key: &PublicKey,
tx_pubkey: &PublicKey
) -> Option<&Index>
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.
sourcepub fn check_with_key_generator(
&self,
keygen: KeyGenerator,
index: usize,
key: &PublicKey
) -> Option<&Index>
pub fn check_with_key_generator(
&self,
keygen: KeyGenerator,
index: usize,
key: &PublicKey
) -> Option<&Index>
Same as check but uses a pre-generated KeyGenerator
Trait Implementations§
source§impl<'a> Clone for SubKeyChecker<'a>
impl<'a> Clone for SubKeyChecker<'a>
source§fn clone(&self) -> SubKeyChecker<'a>
fn clone(&self) -> SubKeyChecker<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more