package tezos-base

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Type for a module representing the ℤ/nℤ ring

type t
include Tezos_crypto.S.B58_DATA with type t := t
val to_b58check : t -> string
val to_short_b58check : t -> string
val of_b58check : string -> t Tezos_error_monad.Error_monad.tzresult
val of_b58check_exn : string -> t
val of_b58check_opt : string -> t option
type Tezos_crypto.Base58.data +=
  1. | Data of t
val b58check_encoding : t Tezos_crypto.Base58.encoding
include Tezos_crypto.S.ENCODER with type t := t
val encoding : t Data_encoding.t
val rpc_arg : t Tezos_rpc.RPC_arg.t
val zero : t
val one : t
val n : Z.t
val (+) : t -> t -> t
val (*) : t -> t -> t
val (-) : t -> t -> t
val (=) : t -> t -> bool
val of_int : int -> t

Converts an integer to a ring element

val of_Z : Z.t -> t

Converts a Zarith integer to a ring element

val to_Z : t -> Z.t

Provides an integer representation between 0 and n-1 of an element

val of_bits_exn : Stdlib.String.t -> t

Converts a string of bytes to an integer modulo n, requires the string of byte to represent an integer between 0 and n-1 and checks the length of the string for sanity

val to_bits : t -> Stdlib.String.t

Converts a ring element to a byte representation

val pow : t -> Z.t -> t

Modular exponentiation

val inv : t -> t option

Returns the inverse of a in ℤ/nℤ, maybe

OCaml

Innovation. Community. Security.