arnaucube
arnaucube/snarkjsPublic Self-hosted repository
snarkjs/src/f12field.js
src/f12field.jsRaw
 1
 2
 3
 4class F12Field {
 5    constructor(p) {
 6        this.p = n;
 7    }
 8
 9    add(a, b) {
10        const maxGrade = Math.max(a.length, b.length);
11        const res = new Array(maxGrade);
12        for (let i=0; i<maxGrade; i++) {
13            res[i] = this.F.add(a[i], b[i]);
14        }
15        return this._reduce(res);
16    }
17
18    sub(a, b) {
19        // TODO
20        throw new Error("Not Implementted");
21    }
22
23    neg(a) {
24        // TODO
25        throw new Error("Not Implementted");
26    }
27
28    mul(a, b) {
29        // TODO
30        throw new Error("Not Implementted");
31    }
32
33    inverse(a, b) {
34        // TODO
35        throw new Error("Not Implementted");
36    }
37
38    div(a, b) {
39        // TODO
40        throw new Error("Not Implementted");
41    }
42
43    isZero(a) {
44        // TODO
45        throw new Error("Not Implementted");
46    }
47
48    mul_by_024(a, ell0, ellVW, ellVV) {
49        // TODO
50        throw new Error("Not Implementted");
51    }
52
53}
54
55module.exports = F2Field;