Module Gf.Z

Big number based reference implementation of the field arithmetic.

include S
type t
val sexp_of_t : t -> Sexplib0.Sexp.t
include Ppx_compare_lib.Comparable.S with type t := t
val compare : t Base__Ppx_compare_lib.compare
include Ppx_compare_lib.Equal.S with type t := t
val equal : t Base__Ppx_compare_lib.equal

Constants

val modulus : t

Solinas prime 2^64 - 2^31 + 1

val zero : t
val one : t
val two : t
val of_z : Z.t -> t
val to_z : t -> Z.t

Arithmetic operations

val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t
val negate : t -> t
module Hex : sig ... end

Display as hex.

Misc

val inverse : t -> t

Invert the element

val pow : t -> Base.int -> t

Raise the element to the given integer power.

val pp : Base.Formatter.t -> t -> Base.unit
val random : Base.unit -> t

Create a random field element.