Skip to content

Commit

Permalink
Some minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ConstanceBeguier committed Dec 18, 2023
1 parent d76d231 commit ac7a90d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions halo2_gadgets/src/ecc/chip/witness_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ impl Config {
Ok((x_var, y_var))
}

fn assign_xy_constant(
fn assign_xy_from_constant(
&self,
value: (Assigned<pallas::Base>, Assigned<pallas::Base>),
offset: usize,
Expand Down Expand Up @@ -159,7 +159,7 @@ impl Config {
(value.x().into(), value.y().into())
};

self.assign_xy_constant(value, offset, region)
self.assign_xy_from_constant(value, offset, region)
.map(|(x, y)| EccPoint::from_coordinates_unchecked(x, y))
}

Expand Down
9 changes: 8 additions & 1 deletion halo2_gadgets/src/sinsemilla/primitives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ impl HashDomain {
#[allow(non_snake_case)]
pub struct CommitDomain {
/// A domain in which $\mathsf{SinsemillaHashToPoint}$ and $\mathsf{SinsemillaHash}$ can be used
pub M: HashDomain,
M: HashDomain,
R: pallas::Point,
}

Expand Down Expand Up @@ -226,6 +226,13 @@ impl CommitDomain {
.map(|p| p + Wnaf::new().scalar(r).base(self.R))
}

/// $\mathsf{SinsemillaHashToPoint}$ from [§ 5.4.1.9][concretesinsemillahash].
///
/// [concretesinsemillahash]: https://zips.z.cash/protocol/nu5.pdf#concretesinsemillahash
pub fn hash_to_point(&self, msg: impl Iterator<Item = bool>) -> CtOption<pallas::Point> {
self.M.hash_to_point(msg)
}

/// Returns `SinsemillaCommit_r(personalization, msg) = hash_point + [r]R`
/// where `SinsemillaHash(personalization, msg) = hash_point`
/// and `R` is derived from the `personalization`.
Expand Down

0 comments on commit ac7a90d

Please sign in to comment.