This repository has been archived by the owner on Oct 28, 2024. It is now read-only.
forked from barryWhiteHat/semaphore
-
Notifications
You must be signed in to change notification settings - Fork 57
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
swasilyev
reviewed
Nov 14, 2018
|
||
void IsNonZero::generate_r1cs_constraints() | ||
{ | ||
generate_boolean_r1cs_constraint<FieldT>(pb, m_Y); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be redundant:
if x != 0, x * (1 - y) = 0 implies y = 1
if x = 0, x * (1/x) = y implies y = 0
Suggested change
generate_boolean_r1cs_constraint<FieldT>(pb, m_Y); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The boolean constraint is needed for Y
because M
is specified as a witness and not validated on its own - if Y is forced to be 0 or 1, then the only valid value for M
is 1/X
Removed GPL code test_jubjub, eddsa.tcc, pedersen_commitment and curve.cpp
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This implements the following new gadgets:
Removes the following coordinates systems from jubjub.py:
I've also added a C++ implementation of
Point
, and made thefrom_y
operation consistent between the C++ and Python implementations by detecting the sign of the X coordinate and inverting it if necessary. This was necessary because the different implementations of modulo square root returns differently signed values.This also merges in code from: #81 with the following gadgets:
I am working on tests.