package octez-libs

  1. Overview
  2. Docs
A package that contains multiple base libraries used by the Octez suite

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-octez-v20.1.tag.bz2
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65

doc/octez-libs.plompiler/Plompiler/LibResult/Bytes/index.html

Module LibResult.BytesSource

Representation of bytes.

Little-endian representation of bytes. First element of the list is the Least Significant Bit.

Sourcetype 'a input = 'a Input.t

Input for a Plompiler program.

Sourcetype scalar = scalar

Element of the native scalar field.

Sourcetype 'a repr = 'a repr

Representation of values.

Sourcetype 'a t = 'a t

Plompiler program.

Sourcetype tl = bool list

Representation of elements.

Sourceval input_bytes : le:bool -> bytes -> tl input

input_bytes ~le b returns the representation of b that Plompiler expects as input. le can be used to set the endianness.

Sourceval constant : le:bool -> bytes -> tl repr t

constant ~le b returns the constant b as a Plompiler value. le can be used to set the endianness.

Sourceval of_scalar : total_nb_bits:int -> scalar repr -> tl repr t

of_scalar ~total_nb_bits b converts the scalar b of size total_nb_bits in bits into the tl representation.

Sourceval to_scalar : tl repr -> scalar repr t

to_scalar b return the scalar representing the value b.

Sourceval of_bool_list : bool list repr -> tl repr t

of_bool_list b converts the list of bits in little-endian order into the tl representation.

Sourceval to_bool_list : tl repr -> bool list repr t

to_bool_list b returns the list of bits in little-endian order, representing the value b.

Sourceval xor : tl repr -> tl repr -> tl repr t

xor a b returns the exclusive disjunction of a and b.

Sourceval band : tl repr -> tl repr -> tl repr t

band a b returns the conjunction of a and b.

Sourceval not : tl repr -> tl repr t

not b returns the negation of b.

Sourceval rotate_right : tl repr -> int -> tl repr t

rotate_right b n shifts the bits right by n positions, so that each bit is less significant. The least significant bit becomes the most significant i.e. it is "rotated". rotate_right bs (length bl) = bl

Sourceval shift_right : tl repr -> int -> tl repr t

shift_right b n shifts all bits right by n positions, so that each bit is less significant. The least signigicant bit is lost and the most significant bit is set to zero. More precisely, if we interpret the b as an integer, shift_right b n = b / 2^n

Sourceval constant_uint32 : le:bool -> Stdint.uint32 -> tl repr t

constant_uint32 ~le n returns a value holding the bytes correspoding to the uint n. le can be used to set the endianness.

Sourceval length : tl repr -> int

length b returns the length of b in bits.

Sourceval concat : tl repr array -> tl repr

concat bs returns the concatenation of the bitlists in bs.

Sourceval add : ?ignore_carry:bool -> tl repr -> tl repr -> tl repr t

add b1 b2 computes the addition of b1 and b2.

Sourceval rotate_left : tl repr -> int -> tl repr t

rotate_left bl n shifts the bits left by n positions, so that each bit is more significant. The most significant bit becomes the least significant i.e. it is "rotated". rotate_left bl (length bl) = bl

Sourceval shift_left : tl repr -> int -> tl repr t

shift_left bl n shifts all bits left by n positions, so that each bit is more significant. The most signigicant bit is lost and the least significant bit is set to zero. More precisely, if we interpret the bl as an integer shift_left bl i = bl * 2^i mod 2^{length a}

OCaml

Innovation. Community. Security.