diff --git a/builds/target_1024b/json_extract_value_1024b.circom b/builds/target_1024b/json_extract_value_1024b.circom deleted file mode 100644 index fffbc10..0000000 --- a/builds/target_1024b/json_extract_value_1024b.circom +++ /dev/null @@ -1,5 +0,0 @@ -pragma circom 2.1.9; - -include "../../circuits/json/nivc/extractor.circom"; - -component main { public [step_in] } = MaskExtractFinal(1024, 50); \ No newline at end of file diff --git a/builds/target_1024b/json_extraction_1024b.circom b/builds/target_1024b/json_extraction_1024b.circom new file mode 100644 index 0000000..c6e4be2 --- /dev/null +++ b/builds/target_1024b/json_extraction_1024b.circom @@ -0,0 +1,5 @@ +pragma circom 2.1.9; + +include "../../circuits/json/extraction.circom"; + +component main { public [step_in] } = JSONExtraction(1024); \ No newline at end of file diff --git a/builds/target_1024b/json_mask_array_index_1024b.circom b/builds/target_1024b/json_mask_array_index_1024b.circom deleted file mode 100644 index d2793c8..0000000 --- a/builds/target_1024b/json_mask_array_index_1024b.circom +++ /dev/null @@ -1,5 +0,0 @@ -pragma circom 2.1.9; - -include "../../circuits/json/nivc/masker.circom"; - -component main { public [step_in] } = JsonMaskArrayIndexNIVC(1024, 10); \ No newline at end of file diff --git a/builds/target_1024b/json_mask_object_1024b.circom b/builds/target_1024b/json_mask_object_1024b.circom deleted file mode 100644 index e91d812..0000000 --- a/builds/target_1024b/json_mask_object_1024b.circom +++ /dev/null @@ -1,5 +0,0 @@ -pragma circom 2.1.9; - -include "../../circuits/json/nivc/masker.circom"; - -component main { public [step_in] } = JsonMaskObjectNIVC(1024, 10, 10); diff --git a/circuits/json/parser/hash_parser.circom b/circuits/json/extraction.circom similarity index 98% rename from circuits/json/parser/hash_parser.circom rename to circuits/json/extraction.circom index acb746a..918f3dc 100644 --- a/circuits/json/parser/hash_parser.circom +++ b/circuits/json/extraction.circom @@ -1,9 +1,9 @@ pragma circom 2.1.9; -include "../../utils/bits.circom"; +include "../utils/bits.circom"; include "hash_machine.circom"; -template ParserHasher(DATA_BYTES, MAX_STACK_HEIGHT) { +template JSONExtraction(DATA_BYTES, MAX_STACK_HEIGHT) { signal input data[DATA_BYTES]; signal input polynomial_input; signal input sequence_digest; diff --git a/circuits/json/parser/hash_machine.circom b/circuits/json/hash_machine.circom similarity index 99% rename from circuits/json/parser/hash_machine.circom rename to circuits/json/hash_machine.circom index 7eb4e83..86a2a4c 100644 --- a/circuits/json/parser/hash_machine.circom +++ b/circuits/json/hash_machine.circom @@ -23,10 +23,10 @@ Tests for this module are located in the files: `circuits/test/parser/*.test.ts pragma circom 2.1.9; -include "../../utils/array.circom"; -include "../../utils/bits.circom"; -include "../../utils/operators.circom"; -include "../../utils/hash.circom"; +include "../utils/array.circom"; +include "../utils/bits.circom"; +include "../utils/operators.circom"; +include "../utils/hash.circom"; include "language.circom"; /* diff --git a/circuits/json/parser/language.circom b/circuits/json/language.circom similarity index 100% rename from circuits/json/parser/language.circom rename to circuits/json/language.circom diff --git a/circuits/json/parser/machine.circom b/circuits/json/machine.circom similarity index 99% rename from circuits/json/parser/machine.circom rename to circuits/json/machine.circom index ff82988..5fa147a 100644 --- a/circuits/json/parser/machine.circom +++ b/circuits/json/machine.circom @@ -23,8 +23,8 @@ Tests for this module are located in the files: `circuits/test/parser/*.test.ts pragma circom 2.1.9; -include "../../utils/array.circom"; -include "../../utils/operators.circom"; +include "../utils/array.circom"; +include "../utils/operators.circom"; include "language.circom"; /* diff --git a/circuits/json/parser/parser.circom b/circuits/json/parser.circom similarity index 100% rename from circuits/json/parser/parser.circom rename to circuits/json/parser.circom diff --git a/circuits/test/json/hash_parser.test.ts b/circuits/test/json/hash_parser.test.ts index db52945..8a6d5e8 100644 --- a/circuits/test/json/hash_parser.test.ts +++ b/circuits/test/json/hash_parser.test.ts @@ -10,8 +10,8 @@ describe("Hash Parser", () => { const MAX_STACK_HEIGHT = 3; hash_parser = await circomkit.WitnessTester(`Parser`, { - file: "json/parser/hash_parser", - template: "ParserHasher", + file: "json/extraction", + template: "JSONExtraction", params: [input.length, MAX_STACK_HEIGHT], }); console.log("#constraints:", await hash_parser.getConstraintCount()); @@ -54,8 +54,8 @@ describe("Hash Parser", () => { const MAX_STACK_HEIGHT = 3; hash_parser = await circomkit.WitnessTester(`Parser`, { - file: "json/parser/hash_parser", - template: "ParserHasher", + file: "json/extraction", + template: "JSONExtraction", params: [input.length, MAX_STACK_HEIGHT], }); console.log("#constraints:", await hash_parser.getConstraintCount()); @@ -97,8 +97,8 @@ describe("Hash Parser", () => { let filename = "value_array_object"; let [input, keyUnicode, output] = readJSONInputFile(`${filename}.json`, []); hash_parser = await circomkit.WitnessTester(`Parser`, { - file: "json/parser/hash_parser", - template: "ParserHasher", + file: "json/extraction", + template: "JSONExtraction", params: [input.length, 5], }); console.log("#constraints:", await hash_parser.getConstraintCount()); @@ -129,8 +129,8 @@ describe("Hash Parser", () => { let filename = "spotify"; let [input, keyUnicode, output] = readJSONInputFile(`${filename}.json`, []); hash_parser = await circomkit.WitnessTester(`Parser`, { - file: "json/parser/hash_parser", - template: "ParserHasher", + file: "json/extraction", + template: "JSONExtraction", params: [input.length, 5], }); console.log("#constraints:", await hash_parser.getConstraintCount()); diff --git a/circuits/test/json/parser.test.ts b/circuits/test/json/parser.test.ts index 557548f..7965425 100644 --- a/circuits/test/json/parser.test.ts +++ b/circuits/test/json/parser.test.ts @@ -8,7 +8,7 @@ describe("json-parser", () => { let [input, keyUnicode, output] = readJSONInputFile(`${filename}.json`, [0]); circuit = await circomkit.WitnessTester(`Parser`, { - file: "json/parser/parser", + file: "json/parser", template: "Parser", params: [input.length, 2], }); @@ -24,7 +24,7 @@ describe("json-parser", () => { let [input, keyUnicode, output] = readJSONInputFile(`${filename}.json`, ["a"]); circuit = await circomkit.WitnessTester(`Parser`, { - file: "json/parser/parser", + file: "json/parser", template: "Parser", params: [input.length, 3], }); diff --git a/circuits/test/json/parsing_types.test.ts b/circuits/test/json/parsing_types.test.ts index 4dfb9d3..8e4a3eb 100644 --- a/circuits/test/json/parsing_types.test.ts +++ b/circuits/test/json/parsing_types.test.ts @@ -19,7 +19,7 @@ describe("StateUpdate", () => { before(async () => { circuit = await circomkit.WitnessTester(`StateUpdate`, { - file: "json/parser/machine", + file: "json/machine", template: "StateUpdate", params: [4], }); diff --git a/circuits/test/json/stack.test.ts b/circuits/test/json/stack.test.ts index 95a738b..fc3d5b6 100644 --- a/circuits/test/json/stack.test.ts +++ b/circuits/test/json/stack.test.ts @@ -1,11 +1,11 @@ import { circomkit, WitnessTester, generateDescription } from "../common"; -import { Delimiters, WhiteSpace, Numbers, Escape, INITIAL_IN, INITIAL_OUT } from '.'; +import { Delimiters, INITIAL_IN, INITIAL_OUT } from '.'; describe("GetTopOfStack", () => { let circuit: WitnessTester<["stack"], ["value", "pointer"]>; before(async () => { circuit = await circomkit.WitnessTester(`GetTopOfStack`, { - file: "json/parser/machine", + file: "json/machine", template: "GetTopOfStack", params: [4], }); @@ -34,7 +34,7 @@ describe("StateUpdate :: RewriteStack", () => { >; before(async () => { circuit = await circomkit.WitnessTester(`GetTopOfStack`, { - file: "json/parser/machine", + file: "json/machine", template: "StateUpdate", params: [4], }); diff --git a/circuits/test/json/values.test.ts b/circuits/test/json/values.test.ts index ac18ac3..31fadcd 100644 --- a/circuits/test/json/values.test.ts +++ b/circuits/test/json/values.test.ts @@ -8,7 +8,7 @@ describe("StateUpdate :: Values", () => { >; before(async () => { circuit = await circomkit.WitnessTester(`GetTopOfStack`, { - file: "json/parser/machine", + file: "json/machine", template: "StateUpdate", params: [4], }); diff --git a/src/main.rs b/src/main.rs index b5ecf0e..2425a11 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,9 +11,7 @@ struct CircuitFiles { const BASE_CIRCUIT_NAMES: &[&str] = &[ "plaintext_authentication", "http_verification", - "json_mask_object", - "json_mask_array_index", - "json_extract_value", + "json_extraction", ]; fn read_file(path: &Path) -> Result> {