private org.mariadb.jdbc.internal.com.send.authentication.ed25519.math.GroupElement toRep(
      final Representation repr) {
    switch (this.repr) {
      case P2:
        switch (repr) {
          case P2:
            return p2(this.curve, this.X, this.Y, this.Z);
          default:
            throw new IllegalArgumentException();
        }
      case P3:
        switch (repr) {
          case P2:
            return p2(this.curve, this.X, this.Y, this.Z);
          case P3:
            return p3(this.curve, this.X, this.Y, this.Z, this.T);
          case CACHED:
            return cached(this.curve, this.Y.add(this.X), this.Y.subtract(this.X), this.Z,
                this.T.multiply(this.curve.get2D()));
          default:
            throw new IllegalArgumentException();
        }
      case P1P1:
        switch (repr) {
          case P2:
            return p2(this.curve, this.X.multiply(this.T), Y.multiply(this.Z),
                this.Z.multiply(this.T));
          case P3:
            return p3(this.curve, this.X.multiply(this.T), Y.multiply(this.Z),
                this.Z.multiply(this.T), this.X.multiply(this.Y));
          case P1P1:
            return p1p1(this.curve, this.X, this.Y, this.Z, this.T);
          default:
            throw new IllegalArgumentException();
        }
      case PRECOMP:
        switch (repr) {
          case PRECOMP:
            return precomp(this.curve, this.X, this.Y, this.Z);
          default:
            throw new IllegalArgumentException();
        }
      case CACHED:
        switch (repr) {
          case CACHED:
            return cached(this.curve, this.X, this.Y, this.Z, this.T);
          default:
            throw new IllegalArgumentException();
        }
      default:
        throw new UnsupportedOperationException();
    }
  }
private org . mariadb . jdbc . internal . com . send . authentication . ed25519 . math . GroupElement toRep ( final Representation repr ) { switch ( this . repr ) { case P2 : switch ( repr ) { case P2 : return p2 ( this . curve , this . X , this . Y , this . Z ) ; default : throw new IllegalArgumentException ( ) ; } case P3 : switch ( repr ) { case P2 : return p2 ( this . curve , this . X , this . Y , this . Z ) ; case P3 : return p3 ( this . curve , this . X , this . Y , this . Z , this . T ) ; case CACHED : return cached ( this . curve , this . Y . add ( this . X ) , this . Y . subtract ( this . X ) , this . Z , this . T . multiply ( this . curve . get2D ( ) ) ) ; default : throw new IllegalArgumentException ( ) ; } case P1P1 : switch ( repr ) { case P2 : return p2 ( this . curve , this . X . multiply ( this . T ) , Y . multiply ( this . Z ) , this . Z . multiply ( this . T ) ) ; case P3 : return p3 ( this . curve , this . X . multiply ( this . T ) , Y . multiply ( this . Z ) , this . Z . multiply ( this . T ) , this . X . multiply ( this . Y ) ) ; case P1P1 : return p1p1 ( this . curve , this . X , this . Y , this . Z , this . T ) ; default : throw new IllegalArgumentException ( ) ; } case PRECOMP : switch ( repr ) { case PRECOMP : return precomp ( this . curve , this . X , this . Y , this . Z ) ; default : throw new IllegalArgumentException ( ) ; } case CACHED : switch ( repr ) { case CACHED : return cached ( this . curve , this . X , this . Y , this . Z , this . T ) ; default : throw new IllegalArgumentException ( ) ; } default : throw new UnsupportedOperationException ( ) ; } }
Convert a GroupElement from one Representation to another. TODO-CR: Add additional conversion?
$r = p$
<p>
Supported conversions:
<p><ul>
<li>P3 $\rightarrow$ P2
<li>P3 $\rightarrow$ CACHED (1 multiply, 1 add, 1 subtract)
<li>P1P1 $\rightarrow$ P2 (3 multiply)
<li>P1P1 $\rightarrow$ P3 (4 multiply)

@param repr The representation to convert to.
@return A new group element in the given representation.