arnaucube
arnaucube/circomlibPublic Self-hosted repository
circomlib/test/circuits/pointbits_loopback.circom
test/circuits/pointbits_loopback.circomRaw
 1include "../../circuit/pointbits.circom";
 2
 3
 4template Main() {
 5    signal input in[2];
 6
 7    var i
 8
 9    component p2b = Point2Bits_Strict();
10    component b2p = Bits2Point_Strict();
11
12    p2b.in[0] <== in[0];
13    p2b.in[1] <== in[1];
14
15    for (i=0; i<256; i++) {
16        b2p.in[i] <== p2b.out[i];
17    }
18
19    b2p.out[0] === in[0];
20    b2p.out[1] === in[1];
21}
22
23component main = Main();