-
Notifications
You must be signed in to change notification settings - Fork 23
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
refactor: public key compression #77
base: main
Are you sure you want to change the base?
refactor: public key compression #77
Conversation
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.
Thanks, @RajeshRk18. Just left some comments.
circuits/verify_nullifier.circom
Outdated
if (i == 1) { | ||
binary[33*i + j] = Num2Bits(8); | ||
binary[33*i + j].in <== pk_compressed[j]; | ||
} else { | ||
binary[33*i + j] = Num2Bits(8); | ||
binary[33*i + j].in <== compressors[i].compressed[j]; | ||
} |
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.
Formatting should be fixed here
circuits/verify_nullifier.circom
Outdated
|
||
for (var i = 0; i < 2; i++) { | ||
for (var j = 0; j < k; j++) { | ||
c_sha256.coordinates[i][j] <== g[i][j]; | ||
c_sha256.coordinates[2+i][j] <== pk[i][j]; |
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.
Is it expected as removed line?
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.
Yes, pk is passed as input right before in compressed form
circuits/verify_nullifier.circom
Outdated
@@ -144,7 +151,7 @@ template check_ec_equations(n, k, message_length) { | |||
signal input c[k]; | |||
signal input s[k]; | |||
signal input plume_message[message_length]; | |||
signal input pk[2][k]; | |||
signal input pk_compressed[33]; |
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.
Why is it fixed magic value 33?
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.
compressed point is 33bytes
circuits/verify_nullifier.circom
Outdated
signal input preimage_bit_length; | ||
signal output out[256]; | ||
|
||
// compress coordinates | ||
component compressors[6]; |
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.
Why did you change it and why is it magic variable?
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.
we only need 5 compressors as pk is already compressed
@RajeshRk18 please rebase with current main branch so PR has only commits related to this issue. |
3a07645
to
59ad77c
Compare
This reverts commit 8274ab7.
6bef811
to
aa30849
Compare
Fixes #14