arnaucube
arnaucube/circomlib-testvectorsPublic Self-hosted repository
circomlib-testvectors/test/poseidon.test.js
test/poseidon.test.jsRaw
 1const chai = require("chai");
 2
 3const poseidon = require("circomlib").poseidon;
 4
 5const assert = chai.assert;
 6
 7function testvector(method, inputs) {
 8    console.log(method);
 9    console.log("input:", inputs);
10    console.log("output:", method(inputs));
11}
12
13describe("Poseidon javascript testvectors", function () {
14    this.timeout(100000);
15    before( async () => {
16    });
17    it("Poseidon t=6", async () => {
18        testvector(poseidon, [1]);
19        testvector(poseidon, [1,2]);
20        testvector(poseidon, [1,2,0,0,0]);
21        testvector(poseidon, [1,2,0,0,0,0]);
22        testvector(poseidon, [3,4,0,0,0,]);
23        testvector(poseidon, [3,4,0,0,0,0]);
24        testvector(poseidon, [1,2,3,4,5,6]);
25    });
26
27});