#include #include #include #include "circom.hpp" #include "calcwit.hpp" void Example_0_create(uint soffset,uint coffset,Circom_CalcWit* ctx,std::string componentName,uint componentFather); void Example_0_run(uint ctx_index,Circom_CalcWit* ctx); Circom_TemplateFunction _functionTable[1] = { Example_0_run }; Circom_TemplateFunction _functionTableParallel[1] = { NULL }; uint get_main_input_signal_start() {return 3;} uint get_main_input_signal_no() {return 3;} uint get_total_signal_no() {return 6;} uint get_number_of_components() {return 1;} uint get_size_of_input_hashmap() {return 256;} uint get_size_of_witness() {return 5;} uint get_size_of_constants() {return 2;} uint get_size_of_io_map() {return 0;} void release_memory_component(Circom_CalcWit* ctx, uint pos) {{ if (pos != 0){{ if(ctx->componentMemory[pos].subcomponents) delete []ctx->componentMemory[pos].subcomponents; if(ctx->componentMemory[pos].subcomponentsParallel) delete []ctx->componentMemory[pos].subcomponentsParallel; if(ctx->componentMemory[pos].outputIsSet) delete []ctx->componentMemory[pos].outputIsSet; if(ctx->componentMemory[pos].mutexes) delete []ctx->componentMemory[pos].mutexes; if(ctx->componentMemory[pos].cvs) delete []ctx->componentMemory[pos].cvs; if(ctx->componentMemory[pos].sbct) delete []ctx->componentMemory[pos].sbct; }} }} // function declarations // template declarations void Example_0_create(uint soffset,uint coffset,Circom_CalcWit* ctx,std::string componentName,uint componentFather){ ctx->componentMemory[coffset].templateId = 0; ctx->componentMemory[coffset].templateName = "Example"; ctx->componentMemory[coffset].signalStart = soffset; ctx->componentMemory[coffset].inputCounter = 3; ctx->componentMemory[coffset].componentName = componentName; ctx->componentMemory[coffset].idFather = componentFather; ctx->componentMemory[coffset].subcomponents = new uint[0]; } void Example_0_run(uint ctx_index,Circom_CalcWit* ctx){ FrElement* signalValues = ctx->signalValues; u64 mySignalStart = ctx->componentMemory[ctx_index].signalStart; std::string myTemplateName = ctx->componentMemory[ctx_index].templateName; std::string myComponentName = ctx->componentMemory[ctx_index].componentName; u64 myFather = ctx->componentMemory[ctx_index].idFather; u64 myId = ctx_index; u32* mySubcomponents = ctx->componentMemory[ctx_index].subcomponents; bool* mySubcomponentsParallel = ctx->componentMemory[ctx_index].subcomponentsParallel; FrElement* circuitConstants = ctx->circuitConstants; std::string* listOfTemplateMessages = ctx->listOfTemplateMessages; FrElement expaux[3]; FrElement lvar[0]; uint sub_component_aux; uint index_multiple_eq; { PFrElement aux_dest = &signalValues[mySignalStart + 0]; // load src Fr_add(&expaux[0],&signalValues[mySignalStart + 2],&signalValues[mySignalStart + 4]); // line circom 12 // end load src Fr_copy(aux_dest,&expaux[0]); } { PFrElement aux_dest = &signalValues[mySignalStart + 1]; // load src Fr_add(&expaux[0],&signalValues[mySignalStart + 2],&signalValues[mySignalStart + 3]); // line circom 13 // end load src Fr_copy(aux_dest,&expaux[0]); } for (uint i = 0; i < 0; i++){ uint index_subc = ctx->componentMemory[ctx_index].subcomponents[i]; if (index_subc != 0)release_memory_component(ctx,index_subc); } } void run(Circom_CalcWit* ctx){ Example_0_create(1,0,ctx,"main",0); Example_0_run(0,ctx); }