circomlib/test/point2bits.js
test/point2bits.jsRaw
1const path = require("path");
2const tester = require("circom").tester;
3
4const babyJub = require("../src/babyjub.js");
5
6
7describe("Point 2 bits test", function() {
8 let circuit;
9 this.timeout(100000);
10 before( async() => {
11 circuit = await tester(path.join(__dirname, "circuits", "pointbits_loopback.circom"));
12 });
13 it("Should do the both convertions for 8Base", async () => {
14 const w = await circuit.calculateWitness({ in: babyJub.Base8});
15
16 await circuit.checkConstraints(w);
17 });
18 it("Should do the both convertions for Zero point", async () => {
19 const w = await circuit.calculateWitness({ in: [0, 1]});
20
21 await circuit.checkConstraints(w);
22 });
23});