package tezos-plompiler

  1. Overview
  2. Docs

Module LibResult.NumSource

Sourcetype scalar = scalar
Sourcetype 'a repr = 'a repr
Sourcetype 'a t = 'a t
Sourceval assert_custom : ?qc:Csir.Scalar.t -> ?ql:Csir.Scalar.t -> ?qr:Csir.Scalar.t -> ?qo:Csir.Scalar.t -> ?qm:Csir.Scalar.t -> scalar repr -> scalar repr -> scalar repr -> unit repr t
Sourceval add_constant : ?ql:Csir.Scalar.t -> Csir.Scalar.t -> scalar repr -> scalar repr t
Sourceval pow5 : scalar repr -> scalar repr t
Sourceval is_zero : scalar repr -> bool repr t
Sourceval is_not_zero : scalar repr -> bool repr t
Sourceval assert_nonzero : scalar repr -> unit repr t
Sourceval square : scalar repr -> scalar repr t
Sourceval pow : scalar repr -> bool repr list -> scalar repr t
Sourceval add_n : ?qc:Csir.Scalar.t -> (Csir.Scalar.t * scalar repr) list -> scalar repr t
Sourceval add_list : scalar list repr -> scalar repr t
Sourceval mul_list : scalar list repr -> scalar repr t
Sourceval mul_by_constant : Csir.Scalar.t -> scalar repr -> scalar repr t
Sourceval scalar_of_bytes : bool list repr -> scalar repr t
Sourceval is_eq_const : scalar repr -> Csir.Scalar.t -> bool repr t
Sourceval assert_eq_const : scalar repr -> Csir.Scalar.t -> unit repr t
Sourceval is_upper_bounded : bound:Z.t -> scalar repr -> bool repr t

is_upper_bounded ~bound x returns whether the scalar x is strictly lower than bound when x is interpreted as an integer from 0 to p-1 (being p the scalar field order). This circuit is total (and more expensive than our version below).

Sourceval is_upper_bounded_unsafe : ?nb_bits:int -> bound:Z.t -> scalar repr -> bool repr t

Same as is_upper_bounded but cheaper and partial. is_upper_bounded_unsafe ~bound l is unsatisfiable if l cannot be represented in binary with Z.numbits bound bits.

Sourceval geq : (scalar repr * Z.t) -> (scalar repr * Z.t) -> bool repr t

geq (a, bound_a) (b, bound_b) returns the boolean wire representing a >= b. Pre-condition: a ∈ 0, bound_a) ∧ b ∈ [0, bound_b)

OCaml

Innovation. Community. Security.