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-18.1.tar.gz
sha256=aa2f5bc99cc4ca2217c52a1af2a2cdfd3b383208cb859ca2e79ca0903396ca1d
sha512=d68bb3eb615e3dcccc845fddfc9901c95b3c6dc8e105e39522ce97637b1308a7fa7aa1d271351d5933febd7476b2819e1694f31198f1f0919681f1f9cc97cb3a

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

Module LibCircuit.BytesSource

Representation of bytes.

Sourcetype bl = bool list

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

Sourceval input_bytes : le:bool -> bytes -> bl Input.t

input_bytes ~le bs returns the representation of bs that Plompiler expects as input.

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

constant ~le bs returns a value holding the bytes bs. le can be used to set the endianness.

Sourceval constant_uint32 : le:bool -> Stdint.uint32 -> bl 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 : bl repr -> int

length b returns the length of b in bits.

Sourceval concat : bl repr array -> bl repr

concat bs returns the concatenation of the bitlists in bs.

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

add b1 b2 computes the addition of b1 and b2.

Sourceval xor : bl repr -> bl repr -> bl repr t

xor b1 b2 computes the bitwise xor between b1 and b2.

Sourceval not : bl repr -> bl repr t

not b computes the bitwise negation of b.

Sourceval band : bl repr -> bl repr -> bl repr t

band b1 b2 computes the bitwise conjunction between b1 and b2.

Sourceval rotate_left : bl repr -> int -> bl 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 rotate_right : bl repr -> int -> bl repr t

rotate_right bl n shifts the bits right by n positions. Similar to rotate_left, but to the right.

Sourceval shift_left : bl repr -> int -> bl 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}

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

shift_right bl n shifts all bits right by n positions. Similar to shift_left, but to the right.

Sourcemodule Internal : sig ... end
OCaml

Innovation. Community. Security.