umbral

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const SECRET_BOX_KEY_SIZE = 32

Variables

This section is empty.

Functions

func DecryptDirect

func DecryptDirect(cxt *Context, capsule *Capsule, privKey *UmbralFieldElement, cipherText []byte) []byte

func DecryptFragments

func DecryptFragments(cxt *Context, capsule *Capsule, reKeyFrags []*CFrag, privKey *UmbralFieldElement, origPubKey *UmbralCurveElement, cipherText []byte) []byte

func DecryptFragmentsWithRecover added in v0.1.1

func DecryptFragmentsWithRecover(ctx *Context, capsule *Capsule, reKeyFrags []*CFrag, privKey *UmbralFieldElement, origPubKey *UmbralCurveElement, cipherText []byte) (res []byte, r interface{})

func Encrypt

func Encrypt(cxt *Context, pubKey *UmbralCurveElement, plainText []byte) ([]byte, *Capsule, *DEM)

Types

type CFrag

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

func ReEncapsulate

func ReEncapsulate(frag *KFrag, cap *Capsule) *CFrag

type Capsule

type Capsule struct {
	E *UmbralCurveElement
	V *UmbralCurveElement
	// contains filtered or unexported fields
}

type Context

type Context struct {
	U *field.CurveElement
	// contains filtered or unexported fields
}

func MakeDefaultContext

func MakeDefaultContext() *Context

func (*Context) GetGen

func (cxt *Context) GetGen() *field.CurveElement

func (*Context) GetOrder

func (cxt *Context) GetOrder() *big.Int

func (*Context) MulGen

func (cxt *Context) MulGen(x *field.ModInt) *UmbralCurveElement

func (*Context) MulU

func (cxt *Context) MulU(x *field.ModInt) *UmbralCurveElement

type DEM

type DEM struct {
	cipher.AEAD
	// contains filtered or unexported fields
}

func MakeDEM

func MakeDEM(key []byte) *DEM

type KFrag

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

func SplitReKey

func SplitReKey(cxt *Context, privA *UmbralFieldElement, pubB *UmbralCurveElement, threshold int, numSplits int) []*KFrag

type ReEncCapsule

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

type UmbralCurveElement

type UmbralCurveElement struct {
	field.CurveElement
}

func (*UmbralCurveElement) Add

func (*UmbralCurveElement) Mul

func (*UmbralCurveElement) MulInt

type UmbralFieldElement

type UmbralFieldElement struct {
	field.ZElement
}

func GenPrivateKey

func GenPrivateKey(cxt *Context) *UmbralFieldElement

func GenPrivateKeyFromBytes added in v0.1.1

func GenPrivateKeyFromBytes(cxt *Context, privKeyBytes []byte) *UmbralFieldElement

func MakePrivateKey

func MakePrivateKey(cxt *Context, mi *field.ModInt) *UmbralFieldElement

func (*UmbralFieldElement) GetPublicKey

func (key *UmbralFieldElement) GetPublicKey(cxt *Context) *UmbralCurveElement

Jump to

Keyboard shortcuts

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