Module 1-Inputs.Impl

Snarky instance to use.

include Snarky_backendless.Snark_intf.Run_basic
val dump : unit -> string
module R1CS_constraint_system : sig ... end

The rank-1 constraint system used by this instance. See Backend_intf.S.R1CS_constraint_system.

type field

The finite field over which the R1CS operates.

type field_var

The variable type over which the R1CS operates.

module Bigint : sig ... end
module Typ : Snarky_backendless.Snark_intf.Typ_intf with type field := Internal_Basic.field and type field_var := Internal_Basic.field_var and type _ checked_unit := unit Internal_Basic.Checked.t and type ('var, 'value, 'aux) typ' = ( 'var, 'value, 'aux ) Internal_Basic.Typ.typ' and type ('var, 'value) typ = ( 'var, 'value ) Internal_Basic.Typ.typ and type 'a prover_value = 'a Internal_Basic.Typ.prover_value

Mappings from OCaml types to R1CS variables and constraints.

module Boolean : Snarky_backendless.Snark_intf.Boolean_intf with type var = Field.t Snarky_backendless.Snark_intf.Boolean0.t and type field_var := field_var and type 'a checked := 'a and type ('var, 'value) typ := ( 'var, 'value ) Typ.t

Representation of booleans within a field.

module Field : sig ... end
module As_prover : sig ... end

The functions in this module may only be run as the prover; trying to run them outside of functions that refer to As_prover.t will result in a runtime error.

module Proof_inputs : sig ... end
module Bitstring_checked : sig ... end
module Handle : sig ... end
val unhandled : response
module Handler : sig ... end
val assert_ : Constraint.t -> unit
val assert_all : Constraint.t list -> unit
val assert_r1cs : Field.t -> Field.t -> Field.t -> unit
val assert_square : Field.t -> Field.t -> unit
val as_prover : ( unit -> unit ) As_prover.t -> unit
val next_auxiliary : unit -> int
val request_witness : ( 'var, 'value ) Typ.t -> ( unit -> 'value Snarky_backendless.Request.t ) As_prover.t -> 'var
val perform : ( unit -> unit Snarky_backendless.Request.t ) As_prover.t -> unit
val request : ?such_that:( 'var -> unit ) -> ( 'var, 'value ) Typ.t -> 'value Snarky_backendless.Request.t -> 'var

TODO: Come up with a better name for this in relation to the above

val exists : ?request:( unit -> 'value Snarky_backendless.Request.t ) As_prover.t -> ?compute:( unit -> 'value ) As_prover.t -> ( 'var, 'value ) Typ.t -> 'var
val exists_handle : ?request:( unit -> 'value Snarky_backendless.Request.t ) As_prover.t -> ?compute:( unit -> 'value ) As_prover.t -> ( 'var, 'value ) Typ.t -> ( 'var, 'value ) Handle.t
val handle : ( unit -> 'a ) -> Handler.t -> 'a
val handle_as_prover : ( unit -> 'a ) -> ( unit -> Handler.t As_prover.t ) -> 'a
val if_ : Boolean.var -> typ:( 'var, _ ) Typ.t -> then_:'var -> else_:'var -> 'var

if_ b ~then_ ~else_ returns then_ if b is true, or else_ otherwise.

WARNING: The Typ.t's read field must be able to construct values from a series of field zeros.

val with_label : string -> ( unit -> 'a ) -> 'a
val make_checked : ( unit -> 'a ) -> 'a Internal_Basic.Checked.t
val constraint_system : input_typ:( 'input_var, 'input_value ) Typ.t -> return_typ:( 'a, _ ) Typ.t -> ( 'input_var -> unit -> 'a ) -> R1CS_constraint_system.t
val generate_witness : input_typ:( 'input_var, 'input_value ) Typ.t -> return_typ:( 'a, _ ) Typ.t -> ( 'input_var -> unit -> 'a ) -> 'input_value -> Proof_inputs.t
type ('input_var, 'return_var, 'result) manual_callbacks = {
run_circuit : 'a. ( 'input_var -> unit -> 'a ) -> 'a;
finish_computation : 'return_var -> 'result;
}
val constraint_system_manual : input_typ:( 'input_var, 'input_value ) Typ.t -> return_typ:( 'return_var, 'return_value ) Typ.t -> ( 'input_var, 'return_var, R1CS_constraint_system.t ) manual_callbacks

Callback version of constraint_system.

val generate_witness_manual : ?handlers:( request -> response ) list -> input_typ:( 'input_var, 'input_value ) Typ.t -> return_typ:( 'return_var, 'return_value ) Typ.t -> 'input_value -> ( 'input_var, 'return_var, Proof_inputs.t * 'return_value ) manual_callbacks

Callback version of generate_witness.

val as_prover_manual : int -> ( field array option -> Field.t array ) Core_kernel.Staged.t
module Async_generic (Promise : Base.Monad.S) : sig ... end
val generate_public_input : ( 'input_var, 'input_value ) Typ.t -> 'input_value -> Field.Constant.Vector.t

Generate the public input vector for a given statement.

val generate_witness_conv : f:( Proof_inputs.t -> 'r_value -> 'out ) -> input_typ:( 'input_var, 'input_value ) Typ.t -> return_typ:( 'r_var, 'r_value ) Typ.t -> ( 'input_var -> unit -> 'r_var ) -> 'input_value -> 'out
val run_unchecked : ( unit -> 'a ) -> 'a
val run_and_check : ( unit -> ( unit -> 'a ) As_prover.t ) -> 'a Core_kernel.Or_error.t
val run_and_check_exn : ( unit -> ( unit -> 'a ) As_prover.t ) -> 'a
module Run_and_check_deferred (M : sig ... end) : sig ... end
val check_exn : ( unit -> 'a ) -> unit
val check : ( unit -> 'a ) -> unit Core_kernel.Or_error.t
val constraint_count : ?weight:( Constraint.t -> int ) -> ?log:( ?start:bool -> string -> int -> unit ) -> ( unit -> 'a ) -> int
val set_constraint_logger : ( ?at_label_boundary:([ `Start | `End ] * string) -> Constraint.t option -> unit ) -> unit
val clear_constraint_logger : unit -> unit
val in_prover : unit -> bool
val in_checked_computation : unit -> bool
val constant : ( 'var, 'value ) Typ.t -> 'value -> 'var

Return a constraint system constant representing the given value.

val run_checked : 'a Internal_Basic.Checked.t -> 'a
module Enumerable (M : sig ... end) : Snarky_backendless.Enumerable_intf.Run with type ('a, 'b) typ := ( 'a, 'b ) Typ.t and type bool_var := Boolean.var and type var = field_var and type t := M.t