arnaucube
arnaucube/snarkjsPublic Self-hosted repository
snarkjs/src/constants.js
src/constants.jsRaw
 1const bigInt = require("big-integer");
 2
 3const F1Field = require("./f1field");
 4const F2Field = require("./f1field");
 5
 6const C = {
 7
 8    // Module of the field
 9    q : bigInt("21888242871839275222246405745257275088696311157297823662689037894645226208583"),
10
11    // Order of the group
12    r : bigInt("21888242871839275222246405745257275088548364400416034343698204186575808495617"),
13
14    g1 : [ bigInt(1), bigInt(2) ],
15    g2 :
16        [
17            [
18                bigInt("10857046999023057135944570762232829481370756359578518086990519993285655852781"),
19                bigInt("11559732032986387107991004021392285783925812861821192530917403151452391805634")
20            ],
21            [
22                bigInt("8495653923123431417604973247489272438418190587263600148770280649306958101930"),
23                bigInt("4082367875863433681332203403145435568316851327593401208105741076214120093531")
24            ]
25        ]
26
27};
28
29const F1 = new F1Field(C.q);
30const F2 = new F2Field(C.q);
31
32C.two_inv= F1.inverse(bigInt(2));
33
34C.coef_b = bigInt(3);
35C.twist = [bigInt(9) , bigInt(1)];
36// C.twist_coeff_b = F2.mulEscalar(  F2.inverse(C.twist), C.coef_b  );
37
38
39module.exports = C;