Struct wownero::cryptonote::onetime_key::KeyGenerator
source · [−]Expand description
Helper to generate onetime public keys (ephemeral keys) used 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.
Implementations
sourceimpl KeyGenerator
impl KeyGenerator
sourcepub fn from_random(
view: PublicKey,
spend: PublicKey,
random: PrivateKey
) -> Self
pub fn from_random(
view: PublicKey,
spend: PublicKey,
random: PrivateKey
) -> Self
Construct a onetime key generator from public keys and secret random, this is used to generate onetime keys for output indexes from an address when sending funds.
sourcepub fn from_key(keys: &ViewPair, random: PublicKey) -> Self
pub fn from_key(keys: &ViewPair, random: PublicKey) -> Self
Construct a onetime key generator from private keys and public random (tx pubkey), this is used to scan if some outputs contains onetime keys owned by the view pair.
sourcepub fn one_time_key(&self, index: usize) -> PublicKey
pub fn one_time_key(&self, index: usize) -> PublicKey
Compute the onetime public key P = Hn(r*8*V || n)*G + S
for the indexed output n
.
sourcepub fn check(&self, index: usize, key: PublicKey) -> bool
pub fn check(&self, index: usize, key: PublicKey) -> bool
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 onetime key is related to the keys.
sourcepub fn get_rvn_scalar(&self, index: usize) -> PrivateKey
pub fn get_rvn_scalar(&self, index: usize) -> PrivateKey
Computes Hn(v*8*R || n)
and interpret it as a scalar.
Trait Implementations
sourceimpl Clone for KeyGenerator
impl Clone for KeyGenerator
sourcefn clone(&self) -> KeyGenerator
fn clone(&self) -> KeyGenerator
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for KeyGenerator
impl Send for KeyGenerator
impl Sync for KeyGenerator
impl Unpin for KeyGenerator
impl UnwindSafe for KeyGenerator
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more