forked from markkurossi/mpc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinteger.mpcl
More file actions
44 lines (37 loc) · 921 Bytes
/
Copy pathinteger.mpcl
File metadata and controls
44 lines (37 loc) · 921 Bytes
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
// -*- go -*-
//
// Copyright (c) 2020-2021 Markku Rossi
//
// All rights reserved.
//
package math
// AddUint64 adds two unsigned 64-bit integer numbers.
func AddUint64(a, b uint64) uint64 {
return native("add64.circ", a, b)
}
// SubUint64 subtracts two unsigned 64-bit integer numbers.
func SubUint64(a, b uint64) uint64 {
return native("sub64.circ", a, b)
}
// MulUint64 multiplies two unsigned 64-bit integer numbers.
func MulUint64(a, b uint64) uint64 {
return native("mul64.circ", a, b)
}
// DivUint64 divides two unsigned 64-bit integer numbers.
func DivUint64(a, b uint64) uint64 {
return native("div64.circ", a, b)
}
// MaxUint returns the maximum of the argument unsigned integer numbers.
func MaxUint(a, b uint) uint {
if a > b {
return a
}
return b
}
// MinUint returns the minimum of the argument unsigned integer numbers.
func MinUint(a, b uint) uint {
if a < b {
return a
}
return b
}