Documentation ¶
Index ¶
- Variables
- func BoolToInt64(b bool) int64
- func DialHTTPWithTLS(network, address string, client_idx int, acceptCerts []tls.Certificate) (*rpc.Client, error)
- func GetUtime() uint64
- func ListenAndServe(server *rpc.Server, address string)
- func ListenAndServeTLS(server *rpc.Server, address string, keyIdx int, acceptCerts []tls.Certificate, ...)
- func NextPowerOfTwo(val int) int
- func PrintTime(tag string)
- func RandInt(mod *big.Int) *big.Int
- func RandPerm(input []int) []int
- func RunForever(f func(), d time.Duration)
- func StartBlockProfiling(filename string)
- func StartMemProfiling(filename string)
- func StartProfiling(filename string)
- func StopProfiling()
- type BufPRGReader
- type DebugConn
- type PRGKey
- type PRGReader
Constants ¶
This section is empty.
Variables ¶
View Source
var LeaderCertificate tls.Certificate
View Source
var One *big.Int
View Source
var ServerBoxPrivateKeys []*[32]byte
View Source
var ServerBoxPublicKeys []*[32]byte
View Source
var ServerCertificates []tls.Certificate
View Source
var Zero *big.Int
Functions ¶
func BoolToInt64 ¶
func DialHTTPWithTLS ¶
func ListenAndServe ¶
For running RPC over TCP.
func ListenAndServeTLS ¶
func ListenAndServeTLS(server *rpc.Server, address string, keyIdx int, acceptCerts []tls.Certificate, debugNet bool)
For running RPC over TLS.
func NextPowerOfTwo ¶
func RunForever ¶
func StartBlockProfiling ¶
func StartBlockProfiling(filename string)
func StartMemProfiling ¶
func StartMemProfiling(filename string)
func StartProfiling ¶
func StartProfiling(filename string)
func StopProfiling ¶
func StopProfiling()
Types ¶
type BufPRGReader ¶
type BufPRGReader struct { Key PRGKey // contains filtered or unexported fields }
func NewBufPRG ¶
func NewBufPRG(prg *PRGReader) *BufPRGReader
type DebugConn ¶
type DebugConn struct { io.ReadWriteCloser // contains filtered or unexported fields }
type PRGReader ¶
type PRGReader struct { Key PRGKey // contains filtered or unexported fields }
We use the AES-CTR to generate pseudo-random numbers using a stream cipher. Go's native rand.Reader is extremely slow because it makes tons of system calls to generate a small number of pseudo-random bytes.
We pay the overhead of using a sync.Mutex to synchronize calls to AES-CTR, but this is relatively cheap.
Click to show internal directories.
Click to hide internal directories.