From 784db469888a9b66daec8e3600db7c28d0b72e09 Mon Sep 17 00:00:00 2001 From: Waylon Jepsen Date: Fri, 1 Nov 2024 11:43:49 +0700 Subject: [PATCH] compose web_proof.circom --- circuits/web_proof.circom | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/circuits/web_proof.circom b/circuits/web_proof.circom index 177486b..ecd2c5c 100644 --- a/circuits/web_proof.circom +++ b/circuits/web_proof.circom @@ -12,17 +12,28 @@ 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 { + // template AESGCTRFOLD(INPUT_LEN) component aes_gctr_nivc = AESGCTRFOLD(48); + + // template ParseAndLockStartLine(DATA_BYTES, MAX_STACK_HEIGHT, MAX_BEGINNING_LENGTH, MAX_MIDDLE_LENGTH, MAX_FINAL_LENGTH) component http_parse = ParseAndLockStartLine(48, 16, 8, 3, 2); + + // template LockHeader(DATA_BYTES, MAX_STACK_HEIGHT, MAX_HEADER_NAME_LENGTH, MAX_HEADER_VALUE_LENGTH) component http_lock_header = LockHeader(48, 16, 12, 16); + + // template HTTPMaskBodyNIVC(DATA_BYTES, MAX_STACK_HEIGHT) component http_body_mask = HTTPMaskBodyNIVC(48, 16); + + // JsonParseNIVC(DATA_BYTES, MAX_STACK_HEIGHT) 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); + component extract_value = MaskExtractFinal(49, 32, 32); } // = AESGCTRFOLD(48);