From 69c6129472e2b5af118c0685dad636d5814c6a54 Mon Sep 17 00:00:00 2001 From: Waylon Jepsen Date: Fri, 1 Nov 2024 11:38:07 +0700 Subject: [PATCH] compose web_proof.circom --- circuits/aes-gctr-nivc.circom | 6 ---- circuits/extract_value.circom | 5 ---- circuits/http_body_mask.circom | 6 ---- circuits/http_lock_header.circom | 7 ----- .../http_parse_and_lock_start_line.circom | 5 ---- circuits/json_mask_array_index.circom | 5 ---- circuits/json_mask_object.circom | 5 ---- circuits/json_parse.circom | 6 ---- circuits/web_proof.circom | 30 +++++++++++++++++++ 9 files changed, 30 insertions(+), 45 deletions(-) delete mode 100644 circuits/aes-gctr-nivc.circom delete mode 100644 circuits/extract_value.circom delete mode 100644 circuits/http_body_mask.circom delete mode 100644 circuits/http_lock_header.circom delete mode 100644 circuits/http_parse_and_lock_start_line.circom delete mode 100644 circuits/json_mask_array_index.circom delete mode 100644 circuits/json_mask_object.circom delete mode 100644 circuits/json_parse.circom create mode 100644 circuits/web_proof.circom diff --git a/circuits/aes-gctr-nivc.circom b/circuits/aes-gctr-nivc.circom deleted file mode 100644 index 2ec7580..0000000 --- a/circuits/aes-gctr-nivc.circom +++ /dev/null @@ -1,6 +0,0 @@ -pragma circom 2.1.9; - -include "aes-gcm/nivc/aes-gctr-nivc.circom"; - -// the circomkit tests become unhappy when there is a main. -component main { public [step_in] } = AESGCTRFOLD(48); \ No newline at end of file diff --git a/circuits/extract_value.circom b/circuits/extract_value.circom deleted file mode 100644 index 8e3906b..0000000 --- a/circuits/extract_value.circom +++ /dev/null @@ -1,5 +0,0 @@ -pragma circom 2.1.9; - -include "json/nivc/extractor.circom"; - -component main { public [step_in] } = MaskExtractFinal(49, 32, 32); \ No newline at end of file diff --git a/circuits/http_body_mask.circom b/circuits/http_body_mask.circom deleted file mode 100644 index de2a95c..0000000 --- a/circuits/http_body_mask.circom +++ /dev/null @@ -1,6 +0,0 @@ -pragma circom 2.1.9; - -include "http/nivc/body_mask.circom"; - -component main { public [step_in] } = HTTPMaskBodyNIVC(4160, 320); - diff --git a/circuits/http_lock_header.circom b/circuits/http_lock_header.circom deleted file mode 100644 index c81aa82..0000000 --- a/circuits/http_lock_header.circom +++ /dev/null @@ -1,7 +0,0 @@ -pragma circom 2.1.9; - -include "http/nivc/lock_header.circom"; - -component main { public [step_in] } = LockHeader(48, 16, 12, 16); -// this one took about - diff --git a/circuits/http_parse_and_lock_start_line.circom b/circuits/http_parse_and_lock_start_line.circom deleted file mode 100644 index f0ba8a5..0000000 --- a/circuits/http_parse_and_lock_start_line.circom +++ /dev/null @@ -1,5 +0,0 @@ -pragma circom 2.1.9; - -include "http/nivc/parse_and_lock_start_line.circom"; - -component main { public [step_in] } = ParseAndLockStartLine(48, 16, 8, 3, 2); \ No newline at end of file diff --git a/circuits/json_mask_array_index.circom b/circuits/json_mask_array_index.circom deleted file mode 100644 index dfe2334..0000000 --- a/circuits/json_mask_array_index.circom +++ /dev/null @@ -1,5 +0,0 @@ -pragma circom 2.1.9; - -include "json/nivc/masker.circom"; - -component main { public [step_in] } = JsonMaskArrayIndexNIVC(48, 16); \ No newline at end of file diff --git a/circuits/json_mask_object.circom b/circuits/json_mask_object.circom deleted file mode 100644 index 5f49944..0000000 --- a/circuits/json_mask_object.circom +++ /dev/null @@ -1,5 +0,0 @@ -pragma circom 2.1.9; - -include "json/nivc/masker.circom"; - -component main { public [step_in] } = JsonMaskObjectNIVC(48, 16, 5); diff --git a/circuits/json_parse.circom b/circuits/json_parse.circom deleted file mode 100644 index 3204dff..0000000 --- a/circuits/json_parse.circom +++ /dev/null @@ -1,6 +0,0 @@ -pragma circom 2.1.9; - -include "json/nivc/parse.circom"; - -component main { public [step_in] } = JsonParseNIVC(48, 16); - diff --git a/circuits/web_proof.circom b/circuits/web_proof.circom new file mode 100644 index 0000000..177486b --- /dev/null +++ b/circuits/web_proof.circom @@ -0,0 +1,30 @@ +pragma circom 2.1.9; + +include "aes-gcm/nivc/aes-gctr-nivc.circom"; +include "http/nivc/parse_and_lock_start_line.circom"; +include "http/nivc/lock_header.circom"; +include "http/nivc/body_mask.circom"; +include "json/nivc/parse.circom"; +include "json/nivc/masker.circom"; +include "json/nivc/masker.circom"; +include "json/nivc/extractor.circom"; + +// AES -> HTTP Parse -> http lock header -> http body mask -> json parse -> json_mask_object/json_mask_array -> extract value +template WEPPROOF { + + component aes_gctr_nivc = AESGCTRFOLD(48); + component http_parse = ParseAndLockStartLine(48, 16, 8, 3, 2); + component http_lock_header = LockHeader(48, 16, 12, 16); + component http_body_mask = HTTPMaskBodyNIVC(48, 16); + component json_parse = JsonParseNIVC(48, 16); + // need logic to specif which json type + // object or array + component json_mask_object = JsonMaskObjectNIVC(48, 16, 4); + component json_mask_array = JsonMaskArrayIndexNIVC(48, 16); + // extract value + component extract_value = JsonParseNIVC(48, 16); +} + +// = AESGCTRFOLD(48); +component main = WEPPROOF(); +