mirror of
https://github.com/arnaucube/circom.git
synced 2026-02-07 11:16:42 +01:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d5aa14cdc | ||
|
|
5dc54bb7d2 |
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "circom",
|
"name": "circom",
|
||||||
"version": "0.5.26",
|
"version": "0.5.27",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "circom",
|
"name": "circom",
|
||||||
"version": "0.5.26",
|
"version": "0.5.27",
|
||||||
"description": "Language to generate logic circuits",
|
"description": "Language to generate logic circuits",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"directories": {
|
"directories": {
|
||||||
|
|||||||
@@ -346,17 +346,24 @@ async function reduceConstrains(ctx) {
|
|||||||
} else {
|
} else {
|
||||||
nextPossibleConstraints = {};
|
nextPossibleConstraints = {};
|
||||||
}
|
}
|
||||||
removedSignals = new BigArray();
|
removedSignals = {};
|
||||||
nRemoved = 0;
|
nRemoved = 0;
|
||||||
lIdx = new BigArray();
|
lIdx = {};
|
||||||
for (let i=0;i<possibleConstraints.length;i++) {
|
for (let i=0;i<possibleConstraints.length;i++) {
|
||||||
if ((ctx.verbose)&&(i%10000 == 0)) {
|
if ((ctx.verbose)&&(i%10000 == 0)) {
|
||||||
await Promise.resolve();
|
await Promise.resolve();
|
||||||
console.log(`reducing constraints: ${i}/${possibleConstraints.length} reduced: ${nRemoved}`);
|
console.log(`reducing constraints: ${i}/${possibleConstraints.length} reduced: ${nRemoved}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const c = ctx.constraints[possibleConstraints[i]];
|
const c = ctx.constraints[possibleConstraints[i]];
|
||||||
if (!c) continue;
|
if (!c) continue;
|
||||||
|
|
||||||
|
// Limit of number of lelements removed per step
|
||||||
|
if (nRemoved>100000) {
|
||||||
|
nextPossibleConstraints[possibleConstraints[i]] = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Swap a and b if b has more variables.
|
// Swap a and b if b has more variables.
|
||||||
if (Object.keys(c.b).length > Object.keys(c.a).length) {
|
if (Object.keys(c.b).length > Object.keys(c.a).length) {
|
||||||
const aux = c.a;
|
const aux = c.a;
|
||||||
@@ -434,7 +441,7 @@ async function reduceConstrains(ctx) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const removedSignalsList = removedSignals.getKeys();
|
const removedSignalsList = Object.keys(removedSignals);
|
||||||
|
|
||||||
for (let i=0; i<removedSignalsList.length; i++) {
|
for (let i=0; i<removedSignalsList.length; i++) {
|
||||||
if ((ctx.verbose )&&(i%100000 == 0)) console.log(`removing signals: ${i}/${removedSignalsList.length}`);
|
if ((ctx.verbose )&&(i%100000 == 0)) console.log(`removing signals: ${i}/${removedSignalsList.length}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user