|
|
@ -119,6 +119,11 @@ public: |
|
|
|
a.clear(); |
|
|
|
a.clear(); |
|
|
|
b.clear(); |
|
|
|
b.clear(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void set(const Fp &a_, const Fp &b_) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
a = a_; |
|
|
|
|
|
|
|
b = b_; |
|
|
|
|
|
|
|
} |
|
|
|
static void add(Fp2T& z, const Fp2T& x, const Fp2T& y) { Fp::op_.fp2_add(z.a.v_, x.a.v_, y.a.v_); } |
|
|
|
static void add(Fp2T& z, const Fp2T& x, const Fp2T& y) { Fp::op_.fp2_add(z.a.v_, x.a.v_, y.a.v_); } |
|
|
|
static void sub(Fp2T& z, const Fp2T& x, const Fp2T& y) { Fp::op_.fp2_sub(z.a.v_, x.a.v_, y.a.v_); } |
|
|
|
static void sub(Fp2T& z, const Fp2T& x, const Fp2T& y) { Fp::op_.fp2_sub(z.a.v_, x.a.v_, y.a.v_); } |
|
|
|
static void addPre(Fp2T& z, const Fp2T& x, const Fp2T& y) { Fp::addPre(z.a, x.a, y.a); Fp::addPre(z.b, x.b, y.b); } |
|
|
|
static void addPre(Fp2T& z, const Fp2T& x, const Fp2T& y) { Fp::addPre(z.a, x.a, y.a); Fp::addPre(z.b, x.b, y.b); } |
|
|
@ -575,6 +580,12 @@ struct Fp6T : public fp::Operator<Fp6T<Fp> > { |
|
|
|
const Fp* getFp0() const { return a.getFp0(); } |
|
|
|
const Fp* getFp0() const { return a.getFp0(); } |
|
|
|
Fp2* getFp2() { return &a; } |
|
|
|
Fp2* getFp2() { return &a; } |
|
|
|
const Fp2* getFp2() const { return &a; } |
|
|
|
const Fp2* getFp2() const { return &a; } |
|
|
|
|
|
|
|
void set(const Fp2 &a_, const Fp2 &b_, const Fp2 &c_) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
a = a_; |
|
|
|
|
|
|
|
b = b_; |
|
|
|
|
|
|
|
c = c_; |
|
|
|
|
|
|
|
} |
|
|
|
bool isZero() const |
|
|
|
bool isZero() const |
|
|
|
{ |
|
|
|
{ |
|
|
|
return a.isZero() && b.isZero() && c.isZero(); |
|
|
|
return a.isZero() && b.isZero() && c.isZero(); |
|
|
|