Skip to content

Commit

Permalink
refactor(zkprogram.ts): simplify serialization of publicInputFields a…
Browse files Browse the repository at this point in the history
…nd publicInputAux by merging non-pure and pure input branch cases into one.
  • Loading branch information
ymekuria committed Nov 20, 2024
1 parent d9588a9 commit 6ea6545
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/lib/proof-system/zkprogram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,16 +403,10 @@ function ZkProgram<
.toAuxiliary(publicInput)
.some((aux) => aux.length !== 0);

let publicInputFields, publicInputAux;
if (nonPureInputExists) {
// serialize publicInput into pure provable field elements and auxiliary data
({ publicInputFields, publicInputAux } = toFieldAndAuxConsts(
publicInputType,
publicInput
));
} else {
publicInputFields = toFieldConsts(publicInputType, publicInput);
}
let { publicInputFields, publicInputAux } = toFieldAndAuxConsts(
publicInputType,
publicInput
);

let previousProofs = MlArray.to(getPreviousProofsForProver(args));

Expand Down

0 comments on commit 6ea6545

Please sign in to comment.