-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathbuiltin.mpcl
57 lines (45 loc) · 1.65 KB
/
builtin.mpcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// -*- go -*-
//
// Copyright (c) 2020-2021 Markku Rossi
//
// All rights reserved.
//
// Package builtin defines MPCL builtin functions and types. This
// package is always imported and the functions and types can be used
// in all programs.
package builtin
// bool is a boolean value true or false.
type bool bool
// byte is an alias for unsigned 8-bit integer numbers.
type byte = uint8
// rune is an alias for int32.
type rune = int32
// intSize is a Size-bit signed integer number. The signed integer
// numbers can be instantiated in any bit sizes.
type intSize int
// uintSize is a Size-bit unsigned integer number. The unsigned
// integer numbers can be instantiated in any bit sizes.
type uintSize uint
// stringSize defines Size-bit long string.
type stringSize string
func copy(dst, src []Type) int32 {}
// The floorPow2 built-in function returns the power of 2 number that
// is smaller than or equal to the argument value.
func floorPow2(v int) int {}
// 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 len(v Type) int32 {}
// 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 native(name string) []Type {}
// The size built-in function returns the size of the argument value
// in bits. The argument value can be of any type.
func size(v Type) int32 {}