2018-08-09 08:16:34 +02:00
|
|
|
|
|
|
|
|
2018-08-12 20:37:43 +02:00
|
|
|
class F2Field {
|
|
|
|
constructor(p) {
|
|
|
|
this.p = n;
|
2018-08-09 08:16:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
add(a, b) {
|
|
|
|
const maxGrade = Math.max(a.length, b.length);
|
|
|
|
const res = new Array(maxGrade);
|
|
|
|
for (let i=0; i<maxGrade; i++) {
|
|
|
|
res[i] = this.F.add(a[i], b[i]);
|
|
|
|
}
|
|
|
|
return this._reduce(res);
|
|
|
|
}
|
|
|
|
|
|
|
|
sub(a, b) {
|
|
|
|
// TODO
|
|
|
|
throw new Error("Not Implementted");
|
|
|
|
}
|
|
|
|
|
2018-08-09 15:31:16 +02:00
|
|
|
neg(a) {
|
|
|
|
// TODO
|
|
|
|
throw new Error("Not Implementted");
|
|
|
|
}
|
|
|
|
|
2018-08-09 08:16:34 +02:00
|
|
|
mul(a, b) {
|
|
|
|
// TODO
|
|
|
|
throw new Error("Not Implementted");
|
|
|
|
}
|
|
|
|
|
|
|
|
inverse(a, b) {
|
|
|
|
// TODO
|
|
|
|
throw new Error("Not Implementted");
|
|
|
|
}
|
|
|
|
|
|
|
|
div(a, b) {
|
|
|
|
// TODO
|
|
|
|
throw new Error("Not Implementted");
|
|
|
|
}
|
|
|
|
|
2018-08-09 15:31:16 +02:00
|
|
|
isZero(a) {
|
|
|
|
// TODO
|
|
|
|
throw new Error("Not Implementted");
|
|
|
|
}
|
|
|
|
|
|
|
|
random() {
|
|
|
|
// TODO
|
|
|
|
throw new Error("Not Implementted");
|
|
|
|
}
|
|
|
|
|
2018-08-09 08:16:34 +02:00
|
|
|
}
|
|
|
|
|
2018-08-12 20:37:43 +02:00
|
|
|
module.exports = F2Field;
|