Skip to content

Commit

Permalink
Renaming and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ConstanceBeguier committed Jun 22, 2023
1 parent 13cbf6e commit c2c8eb1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/circuit/gadget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ pub(in crate::circuit) fn derive_nullifier<
psi: &AssignedCell<pallas::Base, pallas::Base>,
cm: &Point<pallas::Affine, EccChip>,
nk: AssignedCell<pallas::Base, pallas::Base>,
is_split_note: AssignedCell<pallas::Base, pallas::Base>,
split_flag: AssignedCell<pallas::Base, pallas::Base>,
) -> Result<X<pallas::Affine, EccChip>, plonk::Error> {
// hash = poseidon_hash(nk, rho)
let hash = {
Expand Down Expand Up @@ -221,11 +221,12 @@ pub(in crate::circuit) fn derive_nullifier<
)?;
let split_note_nf = nullifier_l.add(layouter.namespace(|| "split_note_nf"), &nf)?;

// Select the desired nullifier according to split_flag
Ok(Point::from_inner(
ecc_chip,
mux_chip.mux(
layouter.namespace(|| "mux on nf"),
&is_split_note,
&split_flag,
nf.inner(),
split_note_nf.inner(),
)?,
Expand Down
4 changes: 2 additions & 2 deletions src/note/nullifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ impl Nullifier {
let l = pallas::Point::hash_to_curve("z.cash:Orchard")(b"L");

let nullifier = k * mod_r_p(nk.prf_nf(rho) + psi) + cm.0;
let nullifier_for_split_note = nullifier + l;
let split_note_nullifier = nullifier + l;

let selected_nullifier =
pallas::Point::conditional_select(&nullifier, &nullifier_for_split_note, is_split_note);
pallas::Point::conditional_select(&nullifier, &split_note_nullifier, is_split_note);

Nullifier(extract_p(&(selected_nullifier)))
}
Expand Down

0 comments on commit c2c8eb1

Please sign in to comment.