Skip to content

refactor: public key compression - #77

Open
RajeshRk18 wants to merge 16 commits into
plume-sig:mainfrom
RajeshRk18:refactor-publickey-compression
Open

RajeshRk18 wants to merge 16 commits into
plume-sig:mainfrom
RajeshRk18:refactor-publickey-compression

Conversation

@RajeshRk18

Copy link
Copy Markdown
Contributor

Fixes #14

@0xmad 0xmad changed the title Refactor publickey compression refactor: public key compression Nov 19, 2023

@0xmad 0xmad left a comment

Copy link
Copy Markdown
Collaborator

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.

Comment thread circuits/verify_nullifier.circom Outdated
Comment on lines +281 to +287
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];
}

Copy link
Copy Markdown
Collaborator

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

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];

Copy link
Copy Markdown
Collaborator

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?

Copy link
Copy Markdown
Contributor Author

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

signal input s[k];
signal input plume_message[message_length];
signal input pk[2][k];
signal input pk_compressed[33];

Copy link
Copy Markdown
Collaborator

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

compressed point is 33bytes

signal output out[256];

// compress coordinates
component compressors[6];

Copy link
Copy Markdown
Collaborator

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?

Copy link
Copy Markdown
Contributor Author

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

@0xmad

0xmad commented Nov 19, 2023

Copy link
Copy Markdown
Collaborator

@RajeshRk18 please rebase with current main branch so PR has only commits related to this issue.

@RajeshRk18
RajeshRk18 force-pushed the refactor-publickey-compression branch from 3a07645 to 59ad77c Compare November 20, 2023 01:30
@RajeshRk18
RajeshRk18 force-pushed the refactor-publickey-compression branch from 6bef811 to aa30849 Compare December 9, 2023 19:33
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.

Public key compressed twice

2 participants