You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
714 B

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