From b755dc4a590e86dc6b9f4b7d7b84cb6d71304f02 Mon Sep 17 00:00:00 2001 From: Stephen <81497928+eigmax@users.noreply.github.com> Date: Sun, 9 Jul 2023 09:08:13 +0800 Subject: [PATCH 1/3] Update pil2circom.js --- src/pil2circom.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pil2circom.js b/src/pil2circom.js index 0ef6abe6..a91b91ee 100644 --- a/src/pil2circom.js +++ b/src/pil2circom.js @@ -48,7 +48,7 @@ function setDimensions(code) { case 'add': newDim = Math.max(getDim(code[i].src[0]), getDim(code[i].src[1])); break; case 'sub': newDim = Math.max(getDim(code[i].src[0]), getDim(code[i].src[1])); break; case 'mul': newDim = Math.max(getDim(code[i].src[0]), getDim(code[i].src[1])); break; - case 'muladd': newDim = Math.max(getDim(code[i].src[0]), getDim(code[i].src[1]), getDim(code[i].src[1])); break; + case 'muladd': newDim = Math.max(getDim(code[i].src[0]), getDim(code[i].src[1]), getDim(code[i].src[2])); break; case 'copy': newDim = getDim(code[i].src[0]); break; default: throw new Error("Invalid op:"+ code[i].op); } From 78f20d221433626c8a12ed8f944c96fb03c1b8f5 Mon Sep 17 00:00:00 2001 From: eigmax Date: Sun, 9 Jul 2023 23:12:51 +0800 Subject: [PATCH 2/3] chore: add muladd --- src/starkinfo_cp_prover.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/starkinfo_cp_prover.js b/src/starkinfo_cp_prover.js index 92e606b9..ff1fae49 100644 --- a/src/starkinfo_cp_prover.js +++ b/src/starkinfo_cp_prover.js @@ -194,7 +194,7 @@ function getExpDim(pil, exp) { case "mul": return getExpDim(pil, exp.values[0]) + getExpDim(pil, exp.values[1]) case "muladd": - return Math.max(getExpDim(pil, exp.values[0]) + getExpDim(pil, exp.values[1]), getExpDim(pil, exp.values[2])); + return Math.max(getExpDim(pil, exp.values[0]), getExpDim(pil, exp.values[1]), getExpDim(pil, exp.values[2])); case "cm": return 1; case "const": return 1; case "exp": return getExpDim(pil, pil.expressions[exp.id]); From efdd4914def28a50ef1c25da91f3203cb8d51a04 Mon Sep 17 00:00:00 2001 From: eigmax Date: Mon, 10 Jul 2023 00:22:01 +0800 Subject: [PATCH 3/3] chore: add muladd --- src/starkinfo_cp_prover.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/starkinfo_cp_prover.js b/src/starkinfo_cp_prover.js index ff1fae49..92e606b9 100644 --- a/src/starkinfo_cp_prover.js +++ b/src/starkinfo_cp_prover.js @@ -194,7 +194,7 @@ function getExpDim(pil, exp) { case "mul": return getExpDim(pil, exp.values[0]) + getExpDim(pil, exp.values[1]) case "muladd": - return Math.max(getExpDim(pil, exp.values[0]), getExpDim(pil, exp.values[1]), getExpDim(pil, exp.values[2])); + return Math.max(getExpDim(pil, exp.values[0]) + getExpDim(pil, exp.values[1]), getExpDim(pil, exp.values[2])); case "cm": return 1; case "const": return 1; case "exp": return getExpDim(pil, pil.expressions[exp.id]);