mirror of
https://github.com/arnaucube/circom.git
synced 2026-02-06 18:56:40 +01:00
functions added
This commit is contained in:
@@ -1 +0,0 @@
|
||||
{"in":[1,2]}
|
||||
12
test/circuits/function1.circom
Normal file
12
test/circuits/function1.circom
Normal file
@@ -0,0 +1,12 @@
|
||||
function func1(a,b) {
|
||||
return a+b;
|
||||
}
|
||||
|
||||
template Main() {
|
||||
signal input in;
|
||||
signal output out;
|
||||
|
||||
out <== func1(in, 3);
|
||||
}
|
||||
|
||||
component main = Main();
|
||||
13
test/circuits/function2.circom
Normal file
13
test/circuits/function2.circom
Normal file
@@ -0,0 +1,13 @@
|
||||
function fnConst(a,b) {
|
||||
return a+b;
|
||||
}
|
||||
|
||||
template Main() {
|
||||
signal input in;
|
||||
signal output out;
|
||||
|
||||
var a = fnConst(1,2);
|
||||
out <== in +a;
|
||||
}
|
||||
|
||||
component main = Main();
|
||||
@@ -1,5 +0,0 @@
|
||||
[
|
||||
"1"
|
||||
,"0"
|
||||
,"0"
|
||||
]
|
||||
Reference in New Issue
Block a user