Skip to content

Commit

Permalink
resolve suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Neotamandua committed Nov 2, 2023
1 parent ad0a881 commit c321d65
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
8 changes: 2 additions & 6 deletions src/keys/public.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@
//
// Copyright (c) DUSK NETWORK. All rights reserved.

use dusk_schnorr::NotePublicKey;

use crate::{permutation, StealthAddress};
use crate::{permutation, SecretKey, StealthAddress};

use dusk_jubjub::{JubJubAffine, JubJubExtended, JubJubScalar};

use super::secret::SecretKey;

#[cfg(feature = "rkyv-impl")]
use rkyv::{Archive, Deserialize, Serialize};

Expand Down Expand Up @@ -58,7 +54,7 @@ impl PublicKey {
let rA = G * rA;

let pk_r = rA + self.B;
let pk_r = NotePublicKey::from(pk_r);
let pk_r = pk_r.into();

StealthAddress { R, pk_r }
}
Expand Down
4 changes: 1 addition & 3 deletions src/keys/secret.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
//
// Copyright (c) DUSK NETWORK. All rights reserved.

use super::public::PublicKey;
use super::stealth::StealthAddress;
use crate::{permutation, ViewKey};
use crate::{permutation, PublicKey, StealthAddress, ViewKey};
use dusk_jubjub::JubJubScalar;
use dusk_schnorr::NoteSecretKey;

Expand Down
3 changes: 2 additions & 1 deletion src/permutation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
use dusk_jubjub::{JubJubExtended, JubJubScalar};
use dusk_poseidon::sponge::truncated;

/// Hashes a JubJub's ExtendedPoint into a JubJub's Scalar
/// Hashes a JubJub's ExtendedPoint into a JubJub's Scalar using the poseidon
/// hash function
pub fn hash(p: &JubJubExtended) -> JubJubScalar {
truncated::hash(&p.to_hash_inputs())
}
5 changes: 2 additions & 3 deletions src/transaction/transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@

use alloc::vec::Vec;

use crate::StealthAddress;
use dusk_bls12_381::BlsScalar;
use dusk_poseidon::cipher::PoseidonCipher;
#[cfg(feature = "rkyv-impl")]
use rkyv::{Archive, Deserialize, Serialize};

use super::ModuleId;

use crate::crossover::Crossover;
use crate::message::Message;
use crate::note::Note;
use crate::transaction::ModuleId;
use crate::StealthAddress;

/// The depth of the transfer tree.
pub const TRANSFER_TREE_DEPTH: usize = 17;
Expand Down

0 comments on commit c321d65

Please sign in to comment.