Skip to content

Commit

Permalink
fix: Use Uint32Array when calculating prime to match circom2 (iden3#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
okwme authored Oct 8, 2023
1 parent 3d9cfe9 commit 2695bd7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build/main.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ class WitnessCalculatorCircom2 {
this.n32 = this.instance.exports.getFieldNumLen32();

this.instance.exports.getRawPrime();
const arr = new Array(this.n32);
const arr = new Uint32Array(this.n32);
for (let i=0; i<this.n32; i++) {
arr[this.n32-1-i] = this.instance.exports.readSharedRWMemory(i);
}
Expand Down
2 changes: 1 addition & 1 deletion js/witness_calculator.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ class WitnessCalculatorCircom2 {
this.n32 = this.instance.exports.getFieldNumLen32();

this.instance.exports.getRawPrime();
const arr = new Array(this.n32);
const arr = new Uint32Array(this.n32);
for (let i=0; i<this.n32; i++) {
arr[this.n32-1-i] = this.instance.exports.readSharedRWMemory(i);
}
Expand Down

0 comments on commit 2695bd7

Please sign in to comment.