Пример #1
0
  public ECFieldElement multiplyPlusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y) {
    long[] ax = this.x, bx = ((SecT113FieldElement) b).x;
    long[] xx = ((SecT113FieldElement) x).x, yx = ((SecT113FieldElement) y).x;

    long[] tt = Nat128.createExt64();
    SecT113Field.multiplyAddToExt(ax, bx, tt);
    SecT113Field.multiplyAddToExt(xx, yx, tt);

    long[] z = Nat128.create64();
    SecT113Field.reduce(tt, z);
    return new SecT113FieldElement(z);
  }
Пример #2
0
  public ECFieldElement squarePow(int pow) {
    if (pow < 1) {
      return this;
    }

    long[] z = Nat128.create64();
    SecT113Field.squareN(x, pow, z);
    return new SecT113FieldElement(z);
  }
Пример #3
0
  public boolean equals(Object other) {
    if (other == this) {
      return true;
    }

    if (!(other instanceof SecT113FieldElement)) {
      return false;
    }

    SecT113FieldElement o = (SecT113FieldElement) other;
    return Nat128.eq64(x, o.x);
  }
Пример #4
0
 public ECFieldElement multiply(ECFieldElement b) {
   long[] z = Nat128.create64();
   SecT113Field.multiply(x, ((SecT113FieldElement) b).x, z);
   return new SecT113FieldElement(z);
 }
Пример #5
0
 public ECFieldElement addOne() {
   long[] z = Nat128.create64();
   SecT113Field.addOne(x, z);
   return new SecT113FieldElement(z);
 }
Пример #6
0
 public BigInteger toBigInteger() {
   return Nat128.toBigInteger64(x);
 }
Пример #7
0
 public boolean isZero() {
   return Nat128.isZero64(x);
 }
Пример #8
0
 public boolean isOne() {
   return Nat128.isOne64(x);
 }
Пример #9
0
 public SecT113FieldElement() {
   this.x = Nat128.create64();
 }
Пример #10
0
 public ECFieldElement sqrt() {
   long[] z = Nat128.create64();
   SecT113Field.sqrt(x, z);
   return new SecT113FieldElement(z);
 }