Skip to content

fix: Use Uint32Array when calculating prime as is done in circom2#89

Merged
phated merged 1 commit intoiden3:masterfrom
okwme:fix-p
Oct 8, 2023
Merged

fix: Use Uint32Array when calculating prime as is done in circom2#89
phated merged 1 commit intoiden3:masterfrom
okwme:fix-p

Conversation

@okwme
Copy link
Contributor

@okwme okwme commented Oct 6, 2023

p was incorrectly being calculated as 21888242844879328548818664213742077600362041385367538672338993241347936223233n instead of 21888242871839275222246405745257275088548364400416034343698204186575808495617n as referenced in #87. This PR corrects the miscalculation by using an unsigned 32 byte array instead of a standard array.

@okwme okwme mentioned this pull request Oct 6, 2023

this.instance.exports.getRawPrime();
const arr = new Array(this.n32);
const arr = new Uint32Array(this.n32);
Copy link
Contributor

Choose a reason for hiding this comment

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

@phated phated changed the title fix p fix: Use Uint32Array when calculating prime as is done in circom2 Oct 8, 2023
@phated phated merged commit 2695bd7 into iden3:master Oct 8, 2023
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