-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask1.circom
More file actions
37 lines (26 loc) · 711 Bytes
/
Copy pathtask1.circom
File metadata and controls
37 lines (26 loc) · 711 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
pragma circom 2.1.9;
template Multiply() {
signal input in1;
signal input in2;
signal output out;
out <== in1 * in2;
}
template CheckEquation() {
signal input a;
signal input b;
signal input N;
component a_sq = Multiply();
a_sq.in1 <== a;
a_sq.in2 <== a;
component a_4pow = Multiply();
a_4pow.in1 <== a_sq.out;
a_4pow.in2 <== a_sq.out;
component a_6pow = Multiply();
a_6pow.in1 <== a_4pow.out;
a_6pow.in2 <== a_sq.out;
component b7_a_sq_plus_b = Multiply();
b7_a_sq_plus_b.in1 <== 7 * b;
b7_a_sq_plus_b.in2 <== a_sq.out + b;
a_6pow.out + b7_a_sq_plus_b.out + 42 === N;
}
component main {public[N]}= CheckEquation();