Module 1-Impl.Field

type t = field

The finite field over which the R1CS operates. Values may be between 0 and size.

include Core_kernel.Bin_prot.Binable.S with type t := t
val bin_size_t : t Bin_prot.Size.sizer
val bin_write_t : t Bin_prot.Write.writer
val bin_read_t : t Bin_prot.Read.reader
val __bin_read_t__ : ( int -> t ) Bin_prot.Read.reader
val bin_shape_t : Bin_prot.Shape.t
val bin_writer_t : t Bin_prot.Type_class.writer
val bin_reader_t : t Bin_prot.Type_class.reader
val bin_t : t Bin_prot.Type_class.t
include Ppx_sexp_conv_lib.Sexpable.S with type t := t
val t_of_sexp : Sexplib0__.Sexp.t -> t
val sexp_of_t : t -> Sexplib0__.Sexp.t
val hash_fold_t : Ppx_hash_lib.Std.Hash.state -> t -> Ppx_hash_lib.Std.Hash.state
val hash : t -> Ppx_hash_lib.Std.Hash.hash_value
val compare : t -> t -> int
val gen : t Core_kernel.Quickcheck.Generator.t

A generator for Quickcheck tests.

val gen_incl : t -> t -> t Core_kernel.Quickcheck.Generator.t

A generator for Quickcheck tests within specified inclusive bounds

val gen_uniform : t Core_kernel.Quickcheck.Generator.t

A uniform generator for Quickcheck tests.

val gen_uniform_incl : t -> t -> t Core_kernel.Quickcheck.Generator.t

A uniform Quickcheck generator within specified inclusive bounds

include Snarky_intf.Field.Extended with type t := t
include Snarky_intf.Field.S with type t := t
include Ppx_sexp_conv_lib.Sexpable.S with type t := t
val t_of_sexp : Sexplib0__.Sexp.t -> t
val sexp_of_t : t -> Sexplib0__.Sexp.t
include Bin_prot.Binable.S with type t := t
val bin_size_t : t Bin_prot.Size.sizer
val bin_write_t : t Bin_prot.Write.writer
val bin_read_t : t Bin_prot.Read.reader
val __bin_read_t__ : ( int -> t ) Bin_prot.Read.reader
val bin_shape_t : Bin_prot.Shape.t
val bin_writer_t : t Bin_prot.Type_class.writer
val bin_reader_t : t Bin_prot.Type_class.reader
val bin_t : t Bin_prot.Type_class.t
val of_int : int -> t
val one : t
val zero : t
val add : t -> t -> t
val sub : t -> t -> t
val mul : t -> t -> t
val inv : t -> t
val square : t -> t
val sqrt : t -> t
val is_square : t -> bool
val equal : t -> t -> bool
val size_in_bits : int
val print : t -> unit
val random : unit -> t
module Mutable : sig ... end
val (+=) : t -> t -> unit
val (-=) : t -> t -> unit
val (*=) : t -> t -> unit
module Vector : Snarky_intf.Vector.S with type elt = t
val negate : t -> t
val (+) : t -> t -> t
val (*) : t -> t -> t
val (-) : t -> t -> t
val (/) : t -> t -> t
include Core_kernel.Stringable.S with type t := t
val of_string : string -> t
val to_string : t -> string
val size : Snarky_backendless__Snark_intf.Bignum_bigint.t

The number at which values in the field wrap back around to 0.

val unpack : t -> bool list

Convert a field element into its constituent bits.

val project : bool list -> t

Convert a list of bits into a field element. This is the inverse of unpack.

val project_reference : bool list -> t

project, but slow. Exposed for benchmarks.

val parity : t -> bool

Get the least significant bit of a field element.

module Checked : Snark_intf.Field_checked_intf with type field := field and type field_var := Var.t and type scale_field := field and type 'a checked := 'a Checked.t and type boolean_var := Boolean.var
val typ : ( Var.t, t ) Typ.t

Describes how to convert between t and Var.t values.