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

TE conditional addition gadget #44

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

TE conditional addition gadget #44

wants to merge 11 commits into from

Conversation

swasilyev
Copy link
Collaborator

@swasilyev swasilyev commented Dec 4, 2024

A reincarnation of #36
uses te::Affine vs sw::Affine to distinguish the impl

@swasilyev swasilyev requested review from davxy and drskalman December 4, 2024 18:53
@swasilyev swasilyev changed the title TE conditional edition gadget TE conditional addition gadget Dec 4, 2024
where
F: FftField,
{
// Populates the acc column starting from the supplied seed (as 0 doesn't have an affine SW representation).
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: update comment

Copy link
Collaborator

@davxy davxy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I just left a couple of questions for you.

Edit: Also, you can already switch to ark-transcript 0.0.3 published on crates.io

Comment on lines +138 to +143
let mut c1 = b * (x3 * (y1 * y2 + C::COEFF_A * x1 * x2) - (x1 * y1 + x2 * y2))
+ (F::one() - b) * (x3 - x1);

//b (y_3 (x_1 y_2 - x_2 y_1) - x_1 y_1 + x_2 y_2) + (1 - b) (y_3 - y_1) = 0
let mut c2 =
b * (y3 * (x1 * y2 - x2 * y1) - (x1 * y1 - x2 * y2)) + (F::one() - b) * (y3 - y1);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick. You might consider organizing these in the same structured manner as you did for the sw cond add.

@@ -12,28 +12,28 @@ use crate::piop::params::PiopParams;
use crate::piop::{FixedColumnsCommitted, PiopVerifier, VerifierKey};
use crate::RingProof;

pub struct RingVerifier<F, CS, Curve, T>
pub struct RingVerifier<F, CS, Jubjub, T>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you decided to rename Curve to Jubjub?

Isn't "Jubjub" the specific name of the curve whose base field is the prime field of BLS12-381?
But you library is not limited to that specific use case, e.g. in ark-ec-vrfs I'm going to use this lib for all the possible curves defined by arkworks.

Just for my understanding, is Jubjub the "de-facto" standard name used for curves defined over the prime field of another pairing friendly curve? If not, maybe is worth to be more "abstract" about the generic name

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, jubjub is a specific curve, but it's common (i think) to call a jubjub any TE curve on top a pairing-friendly curve (babyjubjub on bn254, bandersnatch, etc). So given it specializes to TE, i thought Jubjub is better because we have 2 curves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants