예제 #1
0
  public boolean isValid() {
    Element t0, t1;

    if (infFlag != 0) return true;

    t0 = field.getTargetField().newElement();
    t1 = field.getTargetField().newElement();
    t0.set(x).square().add(getField().getA()).mul(x).add(getField().getB());
    t1.set(y).square();

    return t0.isEqual(t1);
  }
  public boolean isAlmostCoddh(Element a, Element b, Element c, Element d) {
    Element t0, t1;

    t0 = pairing((Point) a, (Point) d);
    t1 = pairing((Point) b, (Point) c);

    if (t0.isEqual(t1)) {
      return true;
    } else {
      t0.mul(t1);
      return t0.isOne();
    }
  }