@ -0,0 +1,24 @@ |
|||
{ |
|||
"folders": [ |
|||
{ |
|||
"path": ".", |
|||
} |
|||
], |
|||
"settings": { |
|||
"SublimeAnarchyDebug": { |
|||
"debug": { |
|||
"executable": "${project_path}/test/circuits/add", |
|||
"params": [ |
|||
"addin.json", |
|||
"out.bin", |
|||
], |
|||
"path": [ |
|||
], |
|||
"environment": [ |
|||
], |
|||
"working_dir": "${project_path}" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
@ -0,0 +1,878 @@ |
|||
{ |
|||
"auto_complete": |
|||
{ |
|||
"selected_items": |
|||
[ |
|||
[ |
|||
"ins", |
|||
"instantiateConstant" |
|||
], |
|||
[ |
|||
"c", |
|||
"circuit" |
|||
], |
|||
[ |
|||
"type", |
|||
"typeof" |
|||
], |
|||
[ |
|||
"b", |
|||
"bName" |
|||
], |
|||
[ |
|||
"e", |
|||
"eOut" |
|||
], |
|||
[ |
|||
"sym", |
|||
"symbols" |
|||
], |
|||
[ |
|||
"res", |
|||
"resStr" |
|||
], |
|||
[ |
|||
"base", |
|||
"baseName" |
|||
], |
|||
[ |
|||
"a", |
|||
"async" |
|||
], |
|||
[ |
|||
"out", |
|||
"outFile" |
|||
], |
|||
[ |
|||
"addS", |
|||
"addSymbolArray" |
|||
], |
|||
[ |
|||
"of", |
|||
"offset" |
|||
], |
|||
[ |
|||
"si", |
|||
"signal" |
|||
], |
|||
[ |
|||
"s", |
|||
"signals" |
|||
], |
|||
[ |
|||
"dir", |
|||
"dirName" |
|||
], |
|||
[ |
|||
"main", |
|||
"mainComponent" |
|||
], |
|||
[ |
|||
"ci", |
|||
"circomFile" |
|||
], |
|||
[ |
|||
"pc", |
|||
"pcV1" |
|||
], |
|||
[ |
|||
"re", |
|||
"require" |
|||
], |
|||
[ |
|||
"buildC", |
|||
"buildCircuit" |
|||
], |
|||
[ |
|||
"Ti", |
|||
"Ticker" |
|||
], |
|||
[ |
|||
"Ma", |
|||
"MaxBandwith" |
|||
], |
|||
[ |
|||
"Bl", |
|||
"BlackList" |
|||
], |
|||
[ |
|||
"Max", |
|||
"MaxConnections" |
|||
], |
|||
[ |
|||
"uint", |
|||
"uint64" |
|||
], |
|||
[ |
|||
"he", |
|||
"helloLen" |
|||
], |
|||
[ |
|||
"Pr", |
|||
"Printf" |
|||
], |
|||
[ |
|||
"n", |
|||
"nil" |
|||
], |
|||
[ |
|||
"ne", |
|||
"newBuff" |
|||
], |
|||
[ |
|||
"new", |
|||
"newBuff" |
|||
], |
|||
[ |
|||
"H", |
|||
"HiddenDomain" |
|||
], |
|||
[ |
|||
"Hidden", |
|||
"hiddenDomain" |
|||
], |
|||
[ |
|||
"ex", |
|||
"extensionLen" |
|||
], |
|||
[ |
|||
"sess", |
|||
"sessionLen" |
|||
], |
|||
[ |
|||
"ses", |
|||
"sessionId" |
|||
], |
|||
[ |
|||
"exte", |
|||
"extensionLen" |
|||
], |
|||
[ |
|||
"se", |
|||
"sessionLen" |
|||
], |
|||
[ |
|||
"by", |
|||
"byte" |
|||
], |
|||
[ |
|||
"clie", |
|||
"clientKS" |
|||
], |
|||
[ |
|||
"de", |
|||
"decrypter" |
|||
], |
|||
[ |
|||
"buf", |
|||
"buftype" |
|||
], |
|||
[ |
|||
"set", |
|||
"setSignal" |
|||
], |
|||
[ |
|||
"ha", |
|||
"handle_error" |
|||
], |
|||
[ |
|||
"in", |
|||
"infilename" |
|||
], |
|||
[ |
|||
"wri", |
|||
"writeOut" |
|||
], |
|||
[ |
|||
"str", |
|||
"string" |
|||
], |
|||
[ |
|||
"it", |
|||
"itFunc" |
|||
], |
|||
[ |
|||
"iter", |
|||
"iterateArr" |
|||
], |
|||
[ |
|||
"idx", |
|||
"idxInput" |
|||
], |
|||
[ |
|||
"NS", |
|||
"NSignals" |
|||
], |
|||
[ |
|||
"en", |
|||
"entryPos" |
|||
], |
|||
[ |
|||
"h", |
|||
"hIdx" |
|||
], |
|||
[ |
|||
"nS", |
|||
"NSignals" |
|||
], |
|||
[ |
|||
"inc", |
|||
"include" |
|||
], |
|||
[ |
|||
"bui", |
|||
"buildOutArray" |
|||
], |
|||
[ |
|||
"N", |
|||
"NVars" |
|||
], |
|||
[ |
|||
"pC", |
|||
"pCurrent" |
|||
], |
|||
[ |
|||
"acc", |
|||
"account2" |
|||
], |
|||
[ |
|||
"tim", |
|||
"timestamp" |
|||
], |
|||
[ |
|||
"not", |
|||
"notAvTxs" |
|||
], |
|||
[ |
|||
"con", |
|||
"continue" |
|||
], |
|||
[ |
|||
"on", |
|||
"onChainTxs" |
|||
], |
|||
[ |
|||
"ge", |
|||
"getOperatorFee" |
|||
], |
|||
[ |
|||
"use", |
|||
"userFee" |
|||
], |
|||
[ |
|||
"no", |
|||
"normalizedFee" |
|||
], |
|||
[ |
|||
"fi", |
|||
"firstNonce" |
|||
], |
|||
[ |
|||
"am", |
|||
"amountF" |
|||
], |
|||
[ |
|||
"cal", |
|||
"calcSlots" |
|||
], |
|||
[ |
|||
"tx", |
|||
"txPool" |
|||
], |
|||
[ |
|||
"non", |
|||
"nonExecutableSlots" |
|||
], |
|||
[ |
|||
"max", |
|||
"maxSlots" |
|||
], |
|||
[ |
|||
"slo", |
|||
"slotKeys" |
|||
], |
|||
[ |
|||
"Tx", |
|||
"TXPool" |
|||
], |
|||
[ |
|||
"cla", |
|||
"_classifyTxs" |
|||
], |
|||
[ |
|||
"remo", |
|||
"removed" |
|||
], |
|||
[ |
|||
"u", |
|||
"updateSlotsPending" |
|||
], |
|||
[ |
|||
"txs", |
|||
"txsByCoin" |
|||
], |
|||
[ |
|||
"forged", |
|||
"forgedTxs" |
|||
], |
|||
[ |
|||
"removed", |
|||
"removedCoins" |
|||
], |
|||
[ |
|||
"bestN", |
|||
"bestNTx" |
|||
], |
|||
[ |
|||
"av", |
|||
"avTxs" |
|||
], |
|||
[ |
|||
"ad", |
|||
"adjustedFee" |
|||
], |
|||
[ |
|||
"M", |
|||
"MaxCoins" |
|||
], |
|||
[ |
|||
"norm", |
|||
"normalizedFee" |
|||
], |
|||
[ |
|||
"us", |
|||
"userFeeF" |
|||
], |
|||
[ |
|||
"from", |
|||
"idxFrom" |
|||
], |
|||
[ |
|||
"eq", |
|||
"equal" |
|||
], |
|||
[ |
|||
"fee", |
|||
"feePlanCoins" |
|||
], |
|||
[ |
|||
"as", |
|||
"async" |
|||
], |
|||
[ |
|||
"ke", |
|||
"key" |
|||
], |
|||
[ |
|||
"pro", |
|||
"promises" |
|||
], |
|||
[ |
|||
"DB", |
|||
"DB_Master" |
|||
], |
|||
[ |
|||
"va", |
|||
"value" |
|||
], |
|||
[ |
|||
"add", |
|||
"addSizes" |
|||
], |
|||
[ |
|||
"labe", |
|||
"labelSize" |
|||
], |
|||
[ |
|||
"las", |
|||
"last_column" |
|||
], |
|||
[ |
|||
"stat", |
|||
"statements" |
|||
], |
|||
[ |
|||
"firs", |
|||
"first_column" |
|||
], |
|||
[ |
|||
"f", |
|||
"first_line" |
|||
], |
|||
[ |
|||
"tmp", |
|||
"tmpNames" |
|||
], |
|||
[ |
|||
"su", |
|||
"suggestedName" |
|||
], |
|||
[ |
|||
"fn", |
|||
"fnvHash" |
|||
], |
|||
[ |
|||
"def", |
|||
"definedHashTables" |
|||
], |
|||
[ |
|||
"le", |
|||
"length" |
|||
], |
|||
[ |
|||
"la", |
|||
"labelName" |
|||
], |
|||
[ |
|||
"size", |
|||
"sizes" |
|||
], |
|||
[ |
|||
"code", |
|||
"codeFooter" |
|||
], |
|||
[ |
|||
"sc", |
|||
"scopes" |
|||
], |
|||
[ |
|||
"rN", |
|||
"rName" |
|||
], |
|||
[ |
|||
"genGet", |
|||
"genGetSignal" |
|||
], |
|||
[ |
|||
"label", |
|||
"labelName" |
|||
], |
|||
[ |
|||
"instan", |
|||
"instantiateRef" |
|||
], |
|||
[ |
|||
"v", |
|||
"vOffset" |
|||
], |
|||
[ |
|||
"BIGIN", |
|||
"BIGINT" |
|||
], |
|||
[ |
|||
"st", |
|||
"stack" |
|||
], |
|||
[ |
|||
"SI", |
|||
"SIZES" |
|||
], |
|||
[ |
|||
"newS", |
|||
"newStackVar" |
|||
], |
|||
[ |
|||
"sco", |
|||
"scopes" |
|||
], |
|||
[ |
|||
"cons", |
|||
"constant" |
|||
], |
|||
[ |
|||
"val", |
|||
"value" |
|||
], |
|||
[ |
|||
"com", |
|||
"components" |
|||
], |
|||
[ |
|||
"calc", |
|||
"calcAcc" |
|||
], |
|||
[ |
|||
"ca", |
|||
"calcStr" |
|||
], |
|||
[ |
|||
"to", |
|||
"toJSNumber" |
|||
], |
|||
[ |
|||
"get", |
|||
"getTmpName" |
|||
], |
|||
[ |
|||
"cS", |
|||
"cSourceDone" |
|||
], |
|||
[ |
|||
"r1", |
|||
"r1csDone" |
|||
], |
|||
[ |
|||
"B", |
|||
"Buffer" |
|||
] |
|||
] |
|||
}, |
|||
"buffers": |
|||
[ |
|||
], |
|||
"build_system": "", |
|||
"build_system_choices": |
|||
[ |
|||
], |
|||
"build_varint": "", |
|||
"command_palette": |
|||
{ |
|||
"height": 0.0, |
|||
"last_filter": "", |
|||
"selected_items": |
|||
[ |
|||
[ |
|||
"in", |
|||
"Package Control: Install Package" |
|||
], |
|||
[ |
|||
"ins", |
|||
"Package Control: Install Package" |
|||
], |
|||
[ |
|||
"", |
|||
"Arithmetic" |
|||
], |
|||
[ |
|||
"Package Control: ", |
|||
"Package Control: Disable Package" |
|||
], |
|||
[ |
|||
"install", |
|||
"Package Control: Install Package" |
|||
] |
|||
], |
|||
"width": 0.0 |
|||
}, |
|||
"console": |
|||
{ |
|||
"height": 210.0, |
|||
"history": |
|||
[ |
|||
] |
|||
}, |
|||
"distraction_free": |
|||
{ |
|||
"menu_visible": true, |
|||
"show_minimap": false, |
|||
"show_open_files": false, |
|||
"show_tabs": false, |
|||
"side_bar_visible": false, |
|||
"status_bar_visible": false |
|||
}, |
|||
"file_history": |
|||
[ |
|||
"/Users/jbaylina/git/iden3/circom/cli.js", |
|||
"/Users/jbaylina/git/iden3/circom/src/c_build.js", |
|||
"/Users/jbaylina/git/iden3/circom/src/c_gen.js", |
|||
"/Users/jbaylina/git/iden3/circom/test/circuits/add.circom", |
|||
"/Users/jbaylina/git/iden3/circom/src/c_tester.js", |
|||
"/Users/jbaylina/git/iden3/circom/test/basiccases.js", |
|||
"/Users/jbaylina/git/iden3/circom/test/inout.js", |
|||
"/Users/jbaylina/git/iden3/circom/c/main.cpp", |
|||
"/Users/jbaylina/git/iden3/circom/src/utils.js", |
|||
"/Users/jbaylina/git/iden3/circom/src/zqfield.js", |
|||
"/Users/jbaylina/git/iden3/circom/src/compiler.js", |
|||
"/Users/jbaylina/git/iden3/circom/c/calcwit.h", |
|||
"/Users/jbaylina/git/iden3/circom/c/zqfield.cpp", |
|||
"/Users/jbaylina/git/iden3/circom/c/circom.h", |
|||
"/Users/jbaylina/git/iden3/circom/test/circuits/add.cpp", |
|||
"/Users/jbaylina/git/iden3/circom/c/zqfield.h", |
|||
"/Users/jbaylina/git/iden3/circom/c/calcwit.cpp", |
|||
"/Users/jbaylina/git/iden3/circom/src/ctx.js", |
|||
"/Users/jbaylina/git/iden3/circom/index.js", |
|||
"/Users/jbaylina/git/iden3/circom/test/circuits/inout.cpp", |
|||
"/Users/jbaylina/git/iden3/circom/src/tester.js", |
|||
"/Users/jbaylina/git/iden3/rollup/doc/rollup_tx.txt", |
|||
"/Users/jbaylina/git/personal/tls-tris/_dev/GOROOT/darwin_amd64/src/crypto/tls/conn.go", |
|||
"/Users/jbaylina/git/personal/tls-tris/_dev/GOROOT/darwin_amd64/src/crypto/tls/handshake_client.go", |
|||
"/Users/jbaylina/git/personal/tls-tris/_dev/GOROOT/darwin_amd64/src/crypto/tls/alert.go", |
|||
"/Users/jbaylina/git/personal/tls-tris/13.go", |
|||
"/Users/jbaylina/git/personal/tls-tris/tls_test.go", |
|||
"/Users/jbaylina/git/personal/tls-tris/conn.go", |
|||
"/Users/jbaylina/git/personal/tls-tris/_dev/GOROOT/darwin_amd64/src/crypto/x509/verify.go", |
|||
"/Users/jbaylina/git/personal/tls-tris/handshake_client.go", |
|||
"/Users/jbaylina/git/personal/testimg/dosfilter.go", |
|||
"/Users/jbaylina/git/personal/testimg/main.go", |
|||
"/Users/jbaylina/git/personal/hiddenproxy/hiddenproxy/main.go", |
|||
"/Users/jbaylina/git/personal/tls-tris/cipher_suites.go", |
|||
"/Users/jbaylina/git/personal/hiddenproxy.old/proxy.go", |
|||
"/Users/jbaylina/git/personal/hiddenproxy/hiddenproxy/proxy.go", |
|||
"/Users/jbaylina/git/personal/hiddenproxy/client-test/client-test", |
|||
"/Users/jbaylina/git/personal/hiddenproxy/client-test/main.go", |
|||
"/Users/jbaylina/git/personal/tls-tris/key_agreement.go", |
|||
"/Users/jbaylina/git/personal/tls-tris/common.go", |
|||
"/Users/jbaylina/git/personal/testesni/testesni.go", |
|||
"/Users/jbaylina/git/personal/hiddenproxy/main.go", |
|||
"/Users/jbaylina/git/personal/testesni2/testesni2.go", |
|||
"/Users/jbaylina/git/personal/hiddenproxy/proxy.go", |
|||
"/Users/jbaylina/git/personal/hiddenproxy/testenc/main.go", |
|||
"/Users/jbaylina/git/personal/tls-tris/_dev/GOROOT/darwin_amd64/src/crypto/blake2b/blake2b_amd64.go", |
|||
"/Users/jbaylina/git/personal/tls-tris/_dev/GOROOT/darwin_amd64/src/crypto/blake2b/blake2b.go", |
|||
"/Users/jbaylina/git/personal/tls-tris/esni.go", |
|||
"/Users/jbaylina/git/personal/tls-tris/_dev/tris-testclient/esni_query.go", |
|||
"/Users/jbaylina/git/personal/tls-tris/_dev/tris-testclient/client.go", |
|||
"/Users/jbaylina/git/personal/tls-tris/_dev/tris-localserver/server.go", |
|||
"/Users/jbaylina/git/personal/tls-tris/_dev/GOROOT/darwin_amd64/src/crypto/tls/esni.go", |
|||
"/Users/jbaylina/git/personal/tls-tris/_dev/GOROOT/darwin_amd64/src/crypto/tls/common.go", |
|||
"/Users/jbaylina/git/iden3/circom/src/exec.js", |
|||
"/Users/jbaylina/git/personal/tls-tris/_dev/GOROOT/darwin_amd64/src/net/tcpsock_plan9.go", |
|||
"/Users/jbaylina/git/personal/tls-tris/tls.go", |
|||
"/Users/jbaylina/git/personal/tls-tris/hiddenproxy.go", |
|||
"/Users/jbaylina/git/personal/tls-tris/_dev/GOROOT/darwin_amd64/src/net/tcpsock.go", |
|||
"/Users/jbaylina/git/personal/tls-tris/_dev/GOROOT/darwin_amd64/src/net/tcpsock_posix.go", |
|||
"/Users/jbaylina/git/personal/tls-tris/_dev/GOROOT/darwin_amd64/src/net/ipsock_plan9.go", |
|||
"/Users/jbaylina/git/iden3/circom/src/gen_c.js", |
|||
"/Users/jbaylina/git/iden3/circom/test/circuits/inout.circom", |
|||
"/Users/jbaylina/git/iden3/circom/c/utils.cpp", |
|||
"/Users/jbaylina/git/iden3/circom/c/utils.h", |
|||
"/Users/jbaylina/git/iden3/circom/c/mainjson.cpp", |
|||
"/Users/jbaylina/git/iden3/circom/c/mainjson", |
|||
"/Users/jbaylina/git/iden3/circom/doc/r1cs_bin_format.md", |
|||
"/Users/jbaylina/git/iden3/circom/c/circom.cpp", |
|||
"/Users/jbaylina/git/iden3/circomlib/src/eddsa.js", |
|||
"/Users/jbaylina/git/iden3/rollup/js/utils.js", |
|||
"/Users/jbaylina/git/iden3/rollup/js/rollupaccount.js", |
|||
"/Users/jbaylina/git/iden3/rollup/js/txpool.js", |
|||
"/Users/jbaylina/git/iden3/rollup/test/txpool.js", |
|||
"/Users/jbaylina/git/iden3/rollup/js/tmpstate.js", |
|||
"/Users/jbaylina/git/iden3/rollup/js/rollupdb.js", |
|||
"/Users/jbaylina/git/iden3/rollup/circuits/balancesupdater.circom", |
|||
"/Users/jbaylina/git/iden3/rollup/test/feeselector.js", |
|||
"/Users/jbaylina/git/iden3/rollup/test/circuits/rollup_test.circom", |
|||
"/Users/jbaylina/git/iden3/rollup/js/batchbuilder.js", |
|||
"/Users/jbaylina/git/iden3/rollup/test/rollup_circuit.js", |
|||
"/Users/jbaylina/git/iden3/rollup/circuits/rollup.circom", |
|||
"/Users/jbaylina/git/iden3/rollup/circuits/rolluptx.circom", |
|||
"/Users/jbaylina/git/iden3/rollup/circuits/feeselector.circom", |
|||
"/Users/jbaylina/git/iden3/rollup/circuits/feeplandecoder.circom", |
|||
"/Users/jbaylina/git/iden3/rollup/test.txt", |
|||
"/Users/jbaylina/git/iden3/rollup/package.json", |
|||
"/Users/jbaylina/git/iden3/rollup/circuits/rolluptxstates.circom", |
|||
"/Users/jbaylina/git/iden3/rollup/js/constants.js", |
|||
"/Users/jbaylina/git/iden3/rollup/.gitignore", |
|||
"/Users/jbaylina/git/iden3/rollup/test/helpers/checkbatch.js", |
|||
"/Users/jbaylina/git/iden3/circomlib/package.json", |
|||
"/Users/jbaylina/git/iden3/snarkjs/src/bn128.js", |
|||
"/Users/jbaylina/git/iden3/circomlib/test/smtverifier.js", |
|||
"/Users/jbaylina/git/iden3/circomlib/test/smtverifier_adria.js", |
|||
"/Users/jbaylina/git/iden3/circomlib/src/smt_memdb.js", |
|||
"/Users/jbaylina/git/iden3/rollup/js/smttmpdb.js", |
|||
"/Users/jbaylina/git/iden3/rollup/js/blockbuilder.js", |
|||
"/Users/jbaylina/git/iden3/circom/src/buildc.js", |
|||
"/Users/jbaylina/git/iden3/circom/package.json", |
|||
"/Users/jbaylina/git/iden3/circom/test/cases.js", |
|||
"/Users/jbaylina/git/iden3/circom/src/lcalgebra.js", |
|||
"/Users/jbaylina/git/iden3/rollup/circuits/decodetx.circom", |
|||
"/Users/jbaylina/git/personal/semaphore/semaphorejs/snark/test.circom", |
|||
"/Users/jbaylina/git/iden3/circom/src/gencode.js", |
|||
"/Users/jbaylina/git/iden3/circom/src/buildwasm.js", |
|||
"/Users/jbaylina/git/iden3/rollup/circuits/statepacker.circom", |
|||
"/Users/jbaylina/git/personal/semaphore/semaphorejs/snark/circuit.json", |
|||
"/Users/jbaylina/git/iden3/circomlib/test/eddsaposeidon.js", |
|||
"/Users/jbaylina/git/iden3/rollup/.eslintrc.js", |
|||
"/Users/jbaylina/git/iden3/rollup/.eslintrc", |
|||
"/Users/jbaylina/git/iden3/circomlib/index.js", |
|||
"/Users/jbaylina/git/iden3/snarkjs/src/calculateWitness.js", |
|||
"/Users/jbaylina/git/iden3/circomlib/src/smt.js", |
|||
"/Users/jbaylina/git/iden3/snarkjs/src/bigint.js", |
|||
"/Users/jbaylina/git/iden3/rollup/circuits/requiredtxverifier.circom", |
|||
"/Users/jbaylina/git/codereview/rattack/deploy_withdraw.js", |
|||
"/Users/jbaylina/git/iden3/circomlib/src/poseidon.js", |
|||
"/Users/jbaylina/git/iden3/rollup/test/rollupaccount.js", |
|||
"/Users/jbaylina/git/iden3/rollup/test/circuits/input.json", |
|||
"/Users/jbaylina/git/iden3/rollup/js/tmpdb.js", |
|||
"/Users/jbaylina/git/iden3/circomlib/circuits/eddsaposeidon.circom", |
|||
"/Users/jbaylina/git/iden3/rollup/circuits/decodefloat.circom", |
|||
"/Users/jbaylina/git/iden3/circomlib/circuits/escalarmulany.circom", |
|||
"/Users/jbaylina/git/iden3/circomlib/circuits/escalarmulfix.circom", |
|||
"/Users/jbaylina/git/iden3/rollup/test/decodefloat.js", |
|||
"/Users/jbaylina/git/iden3/circomlib/test/sha256.js", |
|||
"/Users/jbaylina/git/iden3/circomlib/test/circuits/sha256_test448.circom", |
|||
"/Users/jbaylina/git/iden3/circomlib/test/circuits/sha256_test512.circom" |
|||
], |
|||
"find": |
|||
{ |
|||
"height": 40.0 |
|||
}, |
|||
"find_in_files": |
|||
{ |
|||
"height": 313.0, |
|||
"where_history": |
|||
[ |
|||
] |
|||
}, |
|||
"find_state": |
|||
{ |
|||
"case_sensitive": true, |
|||
"find_history": |
|||
[ |
|||
"genSignalAssignConstrain", |
|||
"mpz_impo", |
|||
"instantiateConstant", |
|||
"genVariable", |
|||
"instantiateConstant", |
|||
"error", |
|||
"used", |
|||
"instantiateRef", |
|||
"newRef", |
|||
"used", |
|||
"main", |
|||
"components", |
|||
"execDeclareSignal", |
|||
".e", |
|||
"execSignalAssign", |
|||
"execSignalAssignConstrain", |
|||
"buildWit2Sig", |
|||
"__P__", |
|||
"genConstraint", |
|||
"checkConstraint", |
|||
"genConstraint", |
|||
"genConstrain", |
|||
"setS", |
|||
"asse", |
|||
"genConstrain", |
|||
"codeHeader", |
|||
"ht_InOut", |
|||
"addSizes", |
|||
"codes_sizes", |
|||
"definedSizes", |
|||
"getTmpName", |
|||
"getTmpNames", |
|||
"getTmp", |
|||
"getTmpName", |
|||
"utils", |
|||
"buildWit2Sig", |
|||
"buildMapIsInput", |
|||
"globalNames", |
|||
"buildInit", |
|||
"ctx", |
|||
"buildInit", |
|||
"genHe" |
|||
], |
|||
"highlight": true, |
|||
"in_selection": false, |
|||
"preserve_case": false, |
|||
"regex": false, |
|||
"replace_history": |
|||
[ |
|||
], |
|||
"reverse": false, |
|||
"show_context": true, |
|||
"use_buffer2": true, |
|||
"whole_word": false, |
|||
"wrap": true |
|||
}, |
|||
"groups": |
|||
[ |
|||
{ |
|||
"sheets": |
|||
[ |
|||
] |
|||
} |
|||
], |
|||
"incremental_find": |
|||
{ |
|||
"height": 28.0 |
|||
}, |
|||
"input": |
|||
{ |
|||
"height": 107.0 |
|||
}, |
|||
"layout": |
|||
{ |
|||
"cells": |
|||
[ |
|||
[ |
|||
0, |
|||
0, |
|||
1, |
|||
1 |
|||
] |
|||
], |
|||
"cols": |
|||
[ |
|||
0.0, |
|||
1.0 |
|||
], |
|||
"rows": |
|||
[ |
|||
0.0, |
|||
1.0 |
|||
] |
|||
}, |
|||
"menu_visible": true, |
|||
"output.SublimeLinter": |
|||
{ |
|||
"height": 0.0 |
|||
}, |
|||
"output.SublimeLinter Messages": |
|||
{ |
|||
"height": 246.0 |
|||
}, |
|||
"output.find_results": |
|||
{ |
|||
"height": 0.0 |
|||
}, |
|||
"pinned_build_system": "", |
|||
"project": "Project.sublime-project", |
|||
"replace": |
|||
{ |
|||
"height": 52.0 |
|||
}, |
|||
"save_all_on_build": true, |
|||
"select_file": |
|||
{ |
|||
"height": 0.0, |
|||
"last_filter": "", |
|||
"selected_items": |
|||
[ |
|||
[ |
|||
"", |
|||
"iden3/circom/src/exec.js" |
|||
] |
|||
], |
|||
"width": 0.0 |
|||
}, |
|||
"select_project": |
|||
{ |
|||
"height": 0.0, |
|||
"last_filter": "", |
|||
"selected_items": |
|||
[ |
|||
], |
|||
"width": 0.0 |
|||
}, |
|||
"select_symbol": |
|||
{ |
|||
"height": 0.0, |
|||
"last_filter": "", |
|||
"selected_items": |
|||
[ |
|||
], |
|||
"width": 0.0 |
|||
}, |
|||
"selected_group": 0, |
|||
"settings": |
|||
{ |
|||
}, |
|||
"show_minimap": true, |
|||
"show_open_files": false, |
|||
"show_tabs": true, |
|||
"side_bar_visible": true, |
|||
"side_bar_width": 300.0, |
|||
"status_bar_visible": true, |
|||
"template_settings": |
|||
{ |
|||
} |
|||
} |
@ -0,0 +1,30 @@ |
|||
#include "zqfield.h"
|
|||
|
|||
ZqField::ZqField(PBigInt ap) { |
|||
mpz_init_set(p, *ap); |
|||
mpz_init_set_ui(zero, 0); |
|||
mpz_init_set_ui(one, 1); |
|||
} |
|||
|
|||
|
|||
void ZqField::add(PBigInt r, PBigInt a, PBigInt b) { |
|||
mpz_add(*r,*a,*b); |
|||
mpz_fdiv_r(*r, *r, p); |
|||
} |
|||
|
|||
void ZqField::lt(PBigInt r, PBigInt a, PBigInt b) { |
|||
int c = mpz_cmp(*a, *b); |
|||
if (c<0) { |
|||
mpz_set(*r, one); |
|||
} else { |
|||
mpz_set(*r, zero); |
|||
} |
|||
} |
|||
|
|||
int ZqField::isTrue(PBigInt a) { |
|||
return mpz_sgn(*a); |
|||
} |
|||
|
|||
void ZqField::copy(PBigInt a, PBigInt b) { |
|||
return mpz_set(*a, *b); |
|||
} |
@ -0,0 +1,20 @@ |
|||
#ifndef ZQFIELD_H |
|||
#define ZQFIELD_H |
|||
|
|||
#include "circom.h" |
|||
|
|||
class ZqField { |
|||
|
|||
public: |
|||
BigInt p; |
|||
BigInt one; |
|||
BigInt zero; |
|||
ZqField(PBigInt ap); |
|||
|
|||
void copy(PBigInt a, PBigInt b); |
|||
void add(PBigInt r,PBigInt a, PBigInt b); |
|||
void lt(PBigInt r, PBigInt a, PBigInt b); |
|||
int isTrue(PBigInt a); |
|||
}; |
|||
|
|||
#endif // ZQFIELD_H |
@ -0,0 +1,17 @@ |
|||
const bigInt = require("big-integer"); |
|||
|
|||
module.exports = class ZqField { |
|||
constructor(p) { |
|||
this.p = p; |
|||
} |
|||
|
|||
add(a, b) { |
|||
return a.add(b).mod(this.p); |
|||
} |
|||
|
|||
lt(a, b) { |
|||
return a.lt(b) ? bigInt(1) : bigInt(0); |
|||
} |
|||
|
|||
}; |
|||
|
@ -0,0 +1,62 @@ |
|||
const path = require("path"); |
|||
|
|||
const bigInt = require("big-integer"); |
|||
const c_tester = require("../index.js").c_tester; |
|||
|
|||
const __P__ = new bigInt("21888242871839275222246405745257275088548364400416034343698204186575808495617"); |
|||
|
|||
|
|||
async function doTest(circuit, testVectors) { |
|||
const cir = await c_tester(path.join(__dirname, "circuits", circuit)); |
|||
|
|||
for (let i=0; i<testVectors.length; i++) { |
|||
const w = await cir.calculateWitness(testVectors[i][0]); |
|||
await cir.assertOut(w, testVectors[i][1] ); |
|||
} |
|||
|
|||
await cir.release(); |
|||
} |
|||
|
|||
describe("basic cases", function () { |
|||
this.timeout(100000); |
|||
it("add", async () => { |
|||
await doTest( |
|||
"add.circom", |
|||
[ |
|||
[{in: [0,0]}, {out: 0}], |
|||
[{in: [0,1]}, {out: 1}], |
|||
[{in: [1,2]}, {out: 3}], |
|||
[{in: [__P__.minus(1),1]}, {out: 0}], |
|||
] |
|||
); |
|||
}); |
|||
it("add constant", async () => { |
|||
await doTest( |
|||
"addconst1.circom", |
|||
[ |
|||
[{in: 0}, {out: 15}], |
|||
[{in: 10}, {out: 25}], |
|||
[{in: __P__.minus(2)}, {out: 13}], |
|||
] |
|||
); |
|||
}); |
|||
it("for unrolled", async () => { |
|||
await doTest( |
|||
"forunrolled.circom", |
|||
[ |
|||
[{in: 0}, {out: [0,1,2]}], |
|||
[{in: 10}, {out: [10, 11, 12]}], |
|||
[{in: __P__.minus(2)}, {out: [__P__.minus(2), __P__.minus(1), 0]}], |
|||
] |
|||
); |
|||
}); |
|||
it("for rolled", async () => { |
|||
await doTest( |
|||
"forrolled.circom", |
|||
[ |
|||
[{in: 0}, {out: 0}], |
|||
[{in: 10}, {out: 10}], |
|||
] |
|||
); |
|||
}); |
|||
}); |
@ -0,0 +1,9 @@ |
|||
|
|||
template Add() { |
|||
signal input in[2]; |
|||
signal output out; |
|||
|
|||
out <== in[0] + in[1]; |
|||
} |
|||
|
|||
component main = Add(); |
@ -0,0 +1,16 @@ |
|||
|
|||
|
|||
template AddConst(c) { |
|||
signal input in; |
|||
signal output out; |
|||
var a = 2; |
|||
var b = 3; |
|||
a=a+b; |
|||
a=a+4; |
|||
a=a+c; |
|||
|
|||
out <== 5 + a + in; |
|||
} |
|||
|
|||
// It should out <== in + 1+2+3+4+5 = in + 15 |
|||
component main = AddConst(1); |
@ -0,0 +1 @@ |
|||
{"in":[1,2]} |
@ -0,0 +1,14 @@ |
|||
template ForRolled() { |
|||
signal input in; |
|||
signal output out; |
|||
|
|||
var acc = 0; |
|||
|
|||
for (var i=0; i<in; i = i+1) { |
|||
acc = acc + 1; |
|||
} |
|||
|
|||
out <== acc; |
|||
} |
|||
|
|||
component main = ForRolled(); |
@ -0,0 +1,10 @@ |
|||
template ForUnrolled(n) { |
|||
signal input in; |
|||
signal output out[n]; |
|||
|
|||
for (var i=0; i<n; i = i+1) { |
|||
out[i] <== in + i; |
|||
} |
|||
} |
|||
|
|||
component main = ForUnrolled(3); |
@ -1 +1 @@ |
|||
{ "in1": 1, "in2": [2,3], "in3":[[4,5],[6,7],[8,9]] } |
|||
{"in": 0} |
@ -0,0 +1,5 @@ |
|||
[ |
|||
"1" |
|||
,"0" |
|||
,"0" |
|||
] |