コード例 #1
0
 @Override
 public void recycle() {
   a.recycle();
   b.recycle();
   c.recycle();
   field.recycle(this);
 }
コード例 #2
0
 @Override
 public Fq6Element<P> mod() {
   return field.getElement(a.mod(), b.mod(), c.mod());
 }
コード例 #3
0
 @Override
 public Fq6DoubleElement<P> sub(Fq6DoubleElement<P> element) {
   return field.getDoubleElement(a.sub(element.a), b.sub(element.b), c.sub(element.c));
 }
コード例 #4
0
 @Override
 public Fq6DoubleElement<P> add(Fq6DoubleElement<P> element) {
   return field.getDoubleElement(a.add(element.a), b.add(element.b), c.add(element.c));
 }
コード例 #5
0
 @Override
 public Fq6DoubleElement<P> clone() {
   return field.getDoubleElement(a.clone(), b.clone(), c.clone());
 }
コード例 #6
0
 /**
  * Algorithm 12 of "High-Speed Software Implementation of the Optimal Ate Pairing over
  * Barreto–Naehrig Curves" (Beuchat et al.), but adapted such that it computes x * gamma + y.
  * (Hence the shifted coefficients in algorithm 11).
  *
  * <p>Stack: F(q^12) = F(q^6)[w]/(w^2-gamma), F(q^6) = F(q^2)[gamma]/(gamma^3-xi) and F(q^2) =
  * F(q)[u](u^2-beta)
  *
  * @param y The element to add
  * @return A new double-precision element representing x * gamma + y
  */
 public Fq6DoubleElement<P> mulGammaAdd(Fq6DoubleElement<P> y) {
   Fq2DoubleElement<P> outa = c.mulXi().addMutable(y.a);
   Fq2DoubleElement<P> outb = a.add(y.b);
   Fq2DoubleElement<P> outc = b.add(y.c);
   return field.getDoubleElement(outa, outb, outc);
 }