share

package
v0.0.0-...-89ef835 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: ISC Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CacheFileRoot string = "prio-roots-cache"
View Source
var IntGen *big.Int

A generator g of a subgroup of Z*_p.

View Source
var IntGen2Order uint

The generator g generates a subgroup of order 2^IntGen2Order in Z*_p.

View Source
var IntModulus *big.Int

A modulus p.

Functions

func GetRoots

func GetRoots(n int) []*big.Int

func GetRootsInv

func GetRootsInv(n int) []*big.Int

func Share

func Share(mod *big.Int, nPieces int, secret *big.Int) []*big.Int

Split hte value secret into nPieces shares modulo mod.

Types

type GenPRG

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

A client uses a GenPRG to split values into shares (one share per server) using a PRG to compress the shares.

func NewGenPRG

func NewGenPRG(nServers int, leaderIdx int) *GenPRG

Create a new GenPRG object for producing compressed secret-shared values.

func (*GenPRG) Hints

func (g *GenPRG) Hints(serverIdx int) *PRGHints

Generate the hints that serverIdx can use to recover the shares.

func (*GenPRG) Share

func (g *GenPRG) Share(mod *big.Int, value *big.Int) []*big.Int

Split value into shares using modulus mod.

func (*GenPRG) ShareRand

func (g *GenPRG) ShareRand(mod *big.Int) *big.Int

Split a random value into shares using modulus mod.

type PRGHints

type PRGHints struct {
	Key   utils.PRGKey
	Delta []*big.Int
}

Compressed representation of secret-shared data.

type ReplayPRG

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

A server uses a ReplayPRG to recover the shared values that the client sent it (in the form of a PRGHints struct).

func NewReplayPRG

func NewReplayPRG(serverIdx int, leaderIdx int) *ReplayPRG

Produce a new ReplayPRG object for the given server/leader combo.

func (*ReplayPRG) Get

func (p *ReplayPRG) Get(mod *big.Int) *big.Int

Recover a secret-shared value that is shared in a field that uses modulus mod.

func (*ReplayPRG) Import

func (p *ReplayPRG) Import(hints *PRGHints)

Import the compressed secret-shared values from hints.

func (*ReplayPRG) IsLeader

func (p *ReplayPRG) IsLeader() bool

Jump to

Keyboard shortcuts

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