2018-11-27 18:03:57 +03:00
|
|
|
const path = require("path");
|
2019-12-14 22:32:45 +03:00
|
|
|
const tester = require("circom").tester;
|
2018-11-27 18:03:57 +03:00
|
|
|
|
|
|
|
const babyJub = require("../src/babyjub.js");
|
|
|
|
|
|
|
|
|
|
|
|
describe("Point 2 bits test", function() {
|
|
|
|
let circuit;
|
|
|
|
this.timeout(100000);
|
|
|
|
before( async() => {
|
2019-12-14 22:32:45 +03:00
|
|
|
circuit = await tester(path.join(__dirname, "circuits", "pointbits_loopback.circom"));
|
2018-11-27 18:03:57 +03:00
|
|
|
});
|
|
|
|
it("Should do the both convertions for 8Base", async () => {
|
2019-12-14 22:32:45 +03:00
|
|
|
const w = await circuit.calculateWitness({ in: babyJub.Base8});
|
2018-11-27 18:03:57 +03:00
|
|
|
|
2019-12-14 22:32:45 +03:00
|
|
|
// TODO
|
|
|
|
// assert(circuit.checkWitness(w));
|
2018-11-27 18:03:57 +03:00
|
|
|
});
|
|
|
|
it("Should do the both convertions for Zero point", async () => {
|
2019-12-14 22:32:45 +03:00
|
|
|
const w = await circuit.calculateWitness({ in: [0, 1]});
|
2018-11-27 18:03:57 +03:00
|
|
|
|
2019-12-14 22:32:45 +03:00
|
|
|
// TODO
|
|
|
|
// assert(circuit.checkWitness(w));
|
2018-11-27 18:03:57 +03:00
|
|
|
});
|
|
|
|
});
|