MPCL

Package builtin

Package builtin defines MPCL builtin functions and types. This package is always imported and the functions and types can be used in all programs.

Constants

This section is empty.

Variables

This section is empty.

Functions

func copy
func copy(dst, src []Type) int32
func floorPow2
func floorPow2(v int) int

The floorPow2 built-in function returns the power of 2 number that is smaller than or equal to the argument value.

func len
func len(v Type) int32

The len built-in function returns the length of the argument value, according to its type:

   Array:  the number of elements in the array
   String: the number of bytes in the string
func native
func native(name string) []Type

The native built-in function loads native circuit from the named file. The circuit must be located in the same directory as the calling MPCL script. The native built-in function supports the following circuit formats:

   .circ   Bristol circuit format
   .mpclc  compiled MPCL circuit format
func size
func size(v Type) int32

The size built-in function returns the size of the argument value in bits. The argument value can be of any type.

Types

type bool bool

bool is a boolean value true or false.

type byte = uint8

byte is an alias for unsigned 8-bit integer numbers.

type intSize int

intSize is a Size-bit signed integer number. The signed integer numbers can be instantiated in any bit sizes.

type rune = int32

rune is an alias for int32.

type stringSize string

stringSize defines Size-bit long string.

type uintSize uint

uintSize is a Size-bit unsigned integer number. The unsigned integer numbers can be instantiated in any bit sizes.