package octez-libs

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

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.