tpke

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

type DefaultTpke

type DefaultTpke struct {
	// contains filtered or unexported fields
}

func NewDefaultTpke

func NewDefaultTpke(th int, skStr cleisthenes.SecretKey, pksStr cleisthenes.PublicKey) (*DefaultTpke, error)

func (*DefaultTpke) AcceptDecShare

func (t *DefaultTpke) AcceptDecShare(addr cleisthenes.Address, decShare cleisthenes.DecryptionShare)

func (*DefaultTpke) ClearDecShare

func (t *DefaultTpke) ClearDecShare()

func (*DefaultTpke) DecShare

DecShare makes decryption share using each secret key.

func (*DefaultTpke) Decrypt

func (t *DefaultTpke) Decrypt(decShares map[string]cleisthenes.DecryptionShare, ctBytes []byte) ([]byte, error)

Decrypt collects decryption share, and combine it for decryption.

func (*DefaultTpke) Encrypt

func (t *DefaultTpke) Encrypt(msg []byte) ([]byte, error)

Encrypt encrypts some byte array message.

type MockTpke

type MockTpke struct{}

func (*MockTpke) AcceptDecShare

func (t *MockTpke) AcceptDecShare(addr cleisthenes.Address, decShare cleisthenes.DecryptionShare)

func (*MockTpke) ClearDecShare

func (t *MockTpke) ClearDecShare()

func (*MockTpke) DecShare

func (t *MockTpke) DecShare(ctBytes []byte) cleisthenes.DecryptionShare

func (*MockTpke) Decrypt

func (t *MockTpke) Decrypt(enc []byte) ([]cleisthenes.Transaction, error)

func (*MockTpke) Encrypt

func (t *MockTpke) Encrypt(data interface{}) ([]byte, error)

Jump to

Keyboard shortcuts

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