pub fn eval_3_iso(p3: Point, p: Point) -> Point {
    // xx:=x*(x*x3-1)^2/(x-x3)^2;
    // yy:=y*(x*x3-1)*(x^2*x3-3*x*x3^2+x+x3)/(x-x3)^3;

    let (x3, _) = p3;
    let (x, y) = p;

    let t1 = fp2sqr(x);
    let t1 = fp2mul(t1, x3);
    let t2 = fp2sqr(x3);
    let t2 = fp2mul(x, t2);
    let t3 = fp2add(t2, t2);
    let t2 = fp2add(t2, t3);
    let t1 = fp2sub(t1, t2);
    let t1 = fp2add(t1, x);
    let t1 = fp2add(t1, x3);
    let t2 = fp2sub(x, x3);
    let t2 = fp2inv(t2);
    let t3 = fp2sqr(t2);
    let t2 = fp2mul(t2, t3);
    let t4 = fp2mul(x, x3);
    let t4 = fp2sub(t4, fp2one());
    let t1 = fp2mul(t4, t1);
    let t1 = fp2mul(t1, t2);
    let t2 = fp2sqr(t4);
    let t2 = fp2mul(t2, t3);
    let iso_x = fp2mul(x, t2);
    let iso_y = fp2mul(y, t1);

    (iso_x, iso_y)
}
/// Input: point p and point p3 of order 3
/// Output: phi(p) where phi is the 3-isogeny corresponding to p3
point p and point p3 of order 3
Output: phi(p) where phi is the 3-isogeny corresponding to p3
point p and point p3 of order 3 Output : phi ( p ) where phi is the 3 - isogeny corresponding to p3
pub fn eval_3_iso(p3: Point, p: Point) -> Point {
    // xx:=x*(x*x3-1)^2/(x-x3)^2;
    // yy:=y*(x*x3-1)*(x^2*x3-3*x*x3^2+x+x3)/(x-x3)^3;
    let (x3, _) = p3;
    let (x, y) = p;
    let t1 = fp2sqr(x);
    let t1 = fp2mul(t1, x3);
    let t2 = fp2sqr(x3);
    let t2 = fp2mul(x, t2);
    let t3 = fp2add(t2, t2);
    let t2 = fp2add(t2, t3);
    let t1 = fp2sub(t1, t2);
    let t1 = fp2add(t1, x);
    let t1 = fp2add(t1, x3);
    let t2 = fp2sub(x, x3);
    let t2 = fp2inv(t2);
    let t3 = fp2sqr(t2);
    let t2 = fp2mul(t2, t3);
    let t4 = fp2mul(x, x3);
    let t4 = fp2sub(t4, fp2one());
    let t1 = fp2mul(t4, t1);
    let t1 = fp2mul(t1, t2);
    let t2 = fp2sqr(t4);
    let t2 = fp2mul(t2, t3);
    let iso_x = fp2mul(x, t2);
    let iso_y = fp2mul(y, t1);
    (iso_x, iso_y)
}
pub fn eval_3_iso ( p3 : Point , p : Point ) -> Point { // xx:=x*(x*x3-1)^2/(x-x3)^2; // yy:=y*(x*x3-1)*(x^2*x3-3*x*x3^2+x+x3)/(x-x3)^3; let ( x3 , _ ) = p3 ; let ( x , y ) = p ; let t1 = fp2sqr ( x ) ; let t1 = fp2mul ( t1 , x3 ) ; let t2 = fp2sqr ( x3 ) ; let t2 = fp2mul ( x , t2 ) ; let t3 = fp2add ( t2 , t2 ) ; let t2 = fp2add ( t2 , t3 ) ; let t1 = fp2sub ( t1 , t2 ) ; let t1 = fp2add ( t1 , x ) ; let t1 = fp2add ( t1 , x3 ) ; let t2 = fp2sub ( x , x3 ) ; let t2 = fp2inv ( t2 ) ; let t3 = fp2sqr ( t2 ) ; let t2 = fp2mul ( t2 , t3 ) ; let t4 = fp2mul ( x , x3 ) ; let t4 = fp2sub ( t4 , fp2one ( ) ) ; let t1 = fp2mul ( t4 , t1 ) ; let t1 = fp2mul ( t1 , t2 ) ; let t2 = fp2sqr ( t4 ) ; let t2 = fp2mul ( t2 , t3 ) ; let iso_x = fp2mul ( x , t2 ) ; let iso_y = fp2mul ( y , t1 ) ; ( iso_x , iso_y ) }
Input: point p and point p3 of order 3
Output: phi(p) where phi is the 3-isogeny corresponding to p3
Input : point p and point p3 of order 3 Output : phi ( p ) where phi is the 3 - isogeny corresponding to p3
p3
Point
p
Point
p3
Point
p
Point