Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sinsemilla chip with HashDomain #67

Merged
merged 20 commits into from
Jun 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
83eddd8
ecc::chip.rs: Add Point::from_coordinates_unchecked() API
therealyingtong Jun 19, 2021
af2ac76
gadget::sinsemilla.rs: Add Sinsemilla instructions.
therealyingtong Jun 19, 2021
e2859df
sinsemilla::message.rs: Add message module.
therealyingtong Jun 19, 2021
ebb7dae
sinsemilla::chip.rs: Add Sinsemilla chip.
therealyingtong Jun 19, 2021
74e617b
chip::generator_table.rs: Load Sinsemilla generator lookup table.
therealyingtong Jun 19, 2021
7cddc9b
sinsemilla::chip.rs: Implement witness_message_* APIs.
therealyingtong Jun 19, 2021
f122e48
sinsemilla::chip.rs: Configure Sinsemilla gates.
therealyingtong Jun 19, 2021
eba2172
chip::hash_to_point.rs: Implement hash_to_point instruction.
therealyingtong Jun 19, 2021
158ab86
gadget::sinsemilla.rs: Add Sinsemilla test.
therealyingtong Jun 19, 2021
2f6ca9e
generator_table.rs: Enforce z_n = 0 for the last message piece.
therealyingtong Jun 19, 2021
9072ed4
generator_table.rs: Fix bug in y_p lookup expression.
therealyingtong Jun 20, 2021
031bb0b
SinsemillaChip::configure(): Introduce closures for Y_A and x_r
therealyingtong Jun 20, 2021
9ce29d9
hash_to_point(): Introduce final_piece boolean flag
therealyingtong Jun 20, 2021
eccd72f
hash_piece(): Remove (correct) duplicate assignment of x_a.
therealyingtong Jun 20, 2021
744f3d1
SinsemillaChip::configure(): Combine and label gates.
therealyingtong Jun 20, 2021
002596f
Docfixes and cleanups.
therealyingtong Jun 20, 2021
5f5238f
Doc comment fixes
str4d Jun 20, 2021
a01c2ee
test: Print layout for Sinsemilla test circuit
str4d Jun 20, 2021
bd08808
SinsemillaChip::configure(): Merge "Initial y_q" gate with main gate
therealyingtong Jun 20, 2021
8af8447
Rename "Sinsemilla gate" constraint to "y check".
daira Jun 21, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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(
daira marked this conversation as resolved.
Show resolved Hide resolved
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