Pari.Elliptic_curve
type 'a t constraint 'a = 'b ty
type 'a elt = 'a elliptic_curve ty constraint 'a = 'b ty
val create :
?a1:'a ->
?a2:'a ->
?a3:'a ->
?a4:'a ->
?a6:'a ->
?dom:'a ->
unit ->
'a t option
create ?a1 ?a2 ?a3 ?a4 ?a6
defines the curve
Y^2 + a_1 XY + a_3 Y = X^3 + a_2 X^2 + a_4 X + a_6
Returns None
if the input coefficients do not define an elliptic curve over the field from the coefficients.
val get_a1 : 'a t -> 'a
val get_a2 : 'a t -> 'a
val get_a3 : 'a t -> 'a
val get_a4 : 'a t -> 'a
val get_a6 : 'a t -> 'a
val of_coordinates : x:'a -> y:'a -> 'a elt
# let g = Finite_field.generator ~order:(Integer.of_int 625) (* 5^4 *);;
val g : Finite_field.t = <abstr>
# let ell = Option.get (Elliptic_curve.create ~a4:(Finite_field.pow g (Integer.of_int 4)) ~a6:(Finite_field.pow g (Integer.of_int 6)) ());;
val ell : Finite_field.t Elliptic_curve.t = <abstr>
# Integer.(to_string (Elliptic_curve.order ell));;
- : string = "675"
val discriminant : 'a t -> 'a
val j_invariant : 'a t -> 'a
weil_pairing ell ~l p q
returns the Weil pairing of the two points of l
-torsion p
and q
on the elliptic curve ell
.
# let l = Integer.of_int 3;;
val l : Integer.t = <abstr>
# let ord = Integer.of_int 103;;
val ord : Integer.t = <abstr>
# let ell = Option.get (Elliptic_curve.create ~a3:(Finite_field.prime_field_element (Integer.of_int 1) ~p:ord) ());;
val ell : Finite_field.t Elliptic_curve.t = <abstr>
# let (p, q) = Elliptic_curve.(of_coordinates ~x:(Finite_field.prime_field_element (Integer.of_int 0) ~p:ord) ~y:(Finite_field.prime_field_element (Integer.of_int 0) ~p:ord), of_coordinates ~x:(Finite_field.prime_field_element (Integer.of_int 57) ~p:ord) ~y:(Finite_field.prime_field_element (Integer.of_int 46) ~p:ord));;
val p : Finite_field.t Elliptic_curve.elt = <abstr>
val q : Finite_field.t Elliptic_curve.elt = <abstr>
# let scalar = Elliptic_curve.weil_pairing ell ~l p q;;
val scalar : Finite_field.t = <abstr>
# Finite_field.to_string scalar (* 56 mod 103 *);;
- : string = "56"
# Finite_field.(to_string (pow scalar l));;
- : string = "1"
val l_division_polynomial : 'a t -> l:Signed.Long.t -> 'a ty Polynomial.t
# let g = Finite_field.generator ~order:(Integer.of_int 625) (* 5^4 *);;
val g : Finite_field.t = <abstr>
# let ell = Option.get (Elliptic_curve.create ~a6:(Finite_field.pow g (Integer.of_int 6)) ());;
val ell : Finite_field.t Elliptic_curve.t = <abstr>
# let pdiv7 = (Elliptic_curve.l_division_polynomial ell ~l:(Signed.Long.of_int 7));;
val pdiv7 : Finite_field.t ty Polynomial.t = <abstr>
# Polynomial.to_string pdiv7;;
- : string =
"2*x^24 + (2*x^3 + x^2 + x + 2)*x^21 + (x^3 + x^2 + 3*x + 2)*x^18 + (2*x^3 + x^2 + 3*x)*x^15 + (2*x^3 + 4*x^2 + 3)*x^12 + (4*x^3 + x^2 + 2*x)*x^9 + (3*x^3 + 3*x^2)*x^6 + (4*x^3 + 2*x^2 + 3)*x^3 + (3*x^3 + 3*x^2 + 3*x + 1)"
# Polynomial.degree pdiv7 = ((7 * 7 - 1) / 2);;
- : bool = true
val to_string : 'a t -> string
val get_coordinates : 'a t -> [> `inf | `point of 'a * 'a ]
val to_string_elt : 'a elt -> string
val ellanalyticrank : Rational.t t -> (Rational.t, [ `ROW ]) Vector.t
# let ell = Option.get (Elliptic_curve.create ~a6:(Rational.of_int 6) ());;
val ell : Rational.t Elliptic_curve.t = <abstr>
# Elliptic_curve.ellanalyticrank ell |> Vector.to_string
- : string = "[0, 3.1205690727970642238215206887060527526]"
val ell_is_integral : 'a ty -> int
val ellq_get_cm : 'a ty -> Signed.long
val ellap_cm_fast : 'a ty -> pari_ulong -> Signed.long -> Signed.long
val elliscm : 'a ty -> Signed.long
val elljissupersingular : 'a ty -> int
val ellrootno_global : 'a ty -> Signed.long
val elltors_psylow : 'a ty -> pari_ulong -> 'a ty
val ellpadicfrobenius : 'a ty -> pari_ulong -> Signed.long -> 'a ty
val ell_get_type : 'a ty -> Signed.long
val ellqp_get_prec : 'a ty -> Signed.long
val ellr_get_prec : 'a ty -> Signed.long
val ellr_get_sign : 'a ty -> Signed.long
val ellmodulareqn : Signed.long -> Signed.long -> Signed.long -> 'a ty
val ell_is_inf : 'a ty -> int