arnaucube
arnaucube/circomlibPublic Self-hosted repository
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        // TODO
17        // assert(circuit.checkWitness(w));
18    });
19    it("Should do the both convertions for Zero point", async () => {
20        const w = await circuit.calculateWitness({ in: [0, 1]});
21
22        // TODO
23        // assert(circuit.checkWitness(w));
24    });
25});