Skip to content

Commit

Permalink
Merge pull request #67 from zcash/sinsemilla-chip-config
Browse files Browse the repository at this point in the history
Sinsemilla chip with HashDomain
  • Loading branch information
str4d committed Jun 22, 2021
2 parents a64a1cb + 8af8447 commit 66340e2
Show file tree
Hide file tree
Showing 9 changed files with 1,466 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/circuit/gadget.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pub(crate) mod ecc;
pub(crate) mod poseidon;
pub(crate) mod sinsemilla;
pub(crate) mod utilities;
11 changes: 11 additions & 0 deletions src/circuit/gadget/ecc/chip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ pub struct EccPoint {
}

impl EccPoint {
/// Constructs a point from its coordinates, without checking they are on the curve.
///
/// This is an internal API that we only use where we know we have a valid curve point
/// (specifically inside Sinsemilla).
pub(in crate::circuit::gadget) fn from_coordinates_unchecked(
x: CellValue<pallas::Base>,
y: CellValue<pallas::Base>,
) -> Self {
EccPoint { x, y }
}

/// Returns the value of this curve point, if known.
pub fn point(&self) -> Option<pallas::Affine> {
match (self.x.value(), self.y.value()) {
Expand Down
Loading

0 comments on commit 66340e2

Please sign in to comment.