chat

package
v0.0.0-...-afad843 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2016 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Args []string // holds command line arguments after flag parsing
View Source
var MyNick string
View Source
var MyPrivateKey *[32]byte
View Source
var MyPublicKey string

Functions

func Client

func Client()

func ClientChannels

func ClientChannels(userTyping, msgReceiving chan string)

func Commodity

func Commodity()

The GMW commodity server

Commodity Protocol Specification:

CS == commodity server CHASH == computation hash

MESSAGE                            NATS SUBJECT

P[0] >-- (StartCommodity) ------> CS commodity.CHASH.BLOCKNUM P[0] <----------------- SEED ---< CS P[0].commodity.CHASH.BLOCKNUM

...

P[n-1] <----------------- SEED ---< CS P[n-1].commodity.CHASH.BLOCKNUM

P[0] >-- (TripleRequest) -------> CS commodity.CHASH.BLOCKNUM P[0] <------ (TripleMaterial) --< CS P[0].commodity.CHASH.BLOCKNUM

P[0] >-- (MaskTripleRequest) ---> CS commodity.CHASH.BLOCKNUM P[0] <-- (MaskTripleMaterial) --< CS P[0].commodity.CHASH.BLOCKNUM

P[0] >-- (EndCommodity) --------> CS commodity.CHASH.BLOCKNUM

func Init

func Init()

func Initialize

func Initialize()

func InitializeExternal

func InitializeExternal()

func MarshalPublicKey

func MarshalPublicKey(c *[32]byte) string

func Secretary

func Secretary()

func Tprintf

func Tprintf(term *terminal.Terminal, format string, v ...interface{})

func UnmarshalPublicKey

func UnmarshalPublicKey(s string) *[32]byte

Types

type ChannelCrypto

type ChannelCrypto struct {
	BlockCipher cipher.AEAD
	PRG         cipher.Stream
}

func (*ChannelCrypto) Decrypt

func (c *ChannelCrypto) Decrypt(ciphertext []byte) []byte

func (*ChannelCrypto) Encrypt

func (c *ChannelCrypto) Encrypt(plaintext []byte) []byte

type EndCommodity

type EndCommodity struct {
}

type FuncRequest

type FuncRequest struct {
	Party
	FunctionName string
}

type JoinRequest

type JoinRequest struct {
	Party
}

messages from clients to secretary

type LeaveRequest

type LeaveRequest struct {
	Party
}

type MaskTripleCommodity

type MaskTripleCommodity struct {
	NumTriples     int
	NumBytesTriple int
}

type Members

type Members struct {
	Parties []Party
}

type Message

type Message struct {
	Party
	Message string
}

messages from secretary to clients

type PairConn

type PairConn struct {
	Nc            *nats.Conn
	ChanMasterPRF cipher.Block
	// contains filtered or unexported fields
}

NATS connection datatypes

func (*PairConn) CryptoFromTag

func (p *PairConn) CryptoFromTag(tag string) ChannelCrypto

type Party

type Party struct {
	Nick string
	Key  string
}
var MyParty Party

type Room

type Room struct {
	Room string
}

type RoomState

type RoomState struct {
	Name    string
	Sub     *nats.Subscription
	Members []Party
	Hash    []byte
	MpcFunc string
}
var MyRoom *RoomState

type StartCommodity

type StartCommodity struct {
	Parties []Party
}

messages from clients to commodity server

type StartRequest

type StartRequest struct {
	Party
}

type TripleCommodity

type TripleCommodity struct {
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL