birkhoffinterpolation

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//ErrEqualOrLargerThreshold is returned if threshold is equal or larger than the length of Bk parameters
	ErrEqualOrLargerThreshold = errors.New("equal or larger threshold")
	//ErrNoValidBks is returned if there's no valid bk
	ErrNoValidBks = errors.New("no valid bks")
	//ErrInvalidBks is returned if it exists a pair of invalid bks
	ErrInvalidBks = errors.New("invalid bks")
	//ErrNoExistBk is returned if there does not exist bk
	ErrNoExistBk          = errors.New("no exist bk")
	ErrInconsistentPubKey = errors.New("inconsistent public key")
)
View Source
var File_github_com_getamis_alice_crypto_birkhoffinterpolation_bk_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type BkParameter

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

func NewBkParameter

func NewBkParameter(x *big.Int, rank uint32) *BkParameter

func (*BkParameter) GetLinearEquationCoefficient

func (p *BkParameter) GetLinearEquationCoefficient(fieldOrder *big.Int, degreePoly uint32) []*big.Int

func (*BkParameter) GetRank

func (p *BkParameter) GetRank() uint32

func (*BkParameter) GetX

func (p *BkParameter) GetX() *big.Int

func (*BkParameter) String

func (p *BkParameter) String() string

func (*BkParameter) ToMessage

func (p *BkParameter) ToMessage() *BkParameterMessage

type BkParameterMessage

type BkParameterMessage struct {
	X    []byte `protobuf:"bytes,1,opt,name=x,proto3" json:"x,omitempty"`
	Rank uint32 `protobuf:"varint,2,opt,name=rank,proto3" json:"rank,omitempty"`
	// contains filtered or unexported fields
}

func (*BkParameterMessage) Descriptor deprecated

func (*BkParameterMessage) Descriptor() ([]byte, []int)

Deprecated: Use BkParameterMessage.ProtoReflect.Descriptor instead.

func (*BkParameterMessage) GetRank

func (x *BkParameterMessage) GetRank() uint32

func (*BkParameterMessage) GetX

func (x *BkParameterMessage) GetX() []byte

func (*BkParameterMessage) ProtoMessage

func (*BkParameterMessage) ProtoMessage()

func (*BkParameterMessage) ProtoReflect added in v1.0.2

func (x *BkParameterMessage) ProtoReflect() protoreflect.Message

func (*BkParameterMessage) Reset

func (x *BkParameterMessage) Reset()

func (*BkParameterMessage) String

func (x *BkParameterMessage) String() string

func (*BkParameterMessage) ToBk

func (p *BkParameterMessage) ToBk(fieldOrder *big.Int) (*BkParameter, error)

type BkParameters

type BkParameters []*BkParameter

func (BkParameters) CheckValid

func (bks BkParameters) CheckValid(threshold uint32, fieldOrder *big.Int) error

If there exists one bks such that we can recover the secret key, then this check will pass.

func (BkParameters) ComputeBkCoefficient

func (bks BkParameters) ComputeBkCoefficient(threshold uint32, fieldOrder *big.Int) ([]*big.Int, error)

ComputeBkCoefficient returns the bk coefficients from parameters

func (BkParameters) GetAddShareCoefficient added in v1.0.2

func (bks BkParameters) GetAddShareCoefficient(ownBk, newBk *BkParameter, fieldOrder *big.Int, threshold uint32) (*big.Int, error)

GetAddShareCoefficient computes [sum_{k=newRank}^{t-1} k!/(k-newRank)!(x_new)^(k-newRank)*b_{ki}]*s_i, newRank is the rank of newBk, x_new is x-coordinate of newBk, and b_{ki} is the (k,i)-component of the pseudoinverse of Birkhoff matrix associated bks.

func (BkParameters) Len

func (bks BkParameters) Len() int

func (BkParameters) Less

func (bks BkParameters) Less(i, j int) bool

Compare rank and then x Let bk := (rank, x). Then if (rank1, x1) > (rank2,x2) iff rank1<rank2 or ( rank1=rank2 and x1>x2)

func (BkParameters) Swap

func (bks BkParameters) Swap(i, j int)

func (BkParameters) ValidatePublicKey added in v1.0.2

func (bks BkParameters) ValidatePublicKey(sgs []*pt.ECPoint, threshold uint32, pubkey *pt.ECPoint) error

Jump to

Keyboard shortcuts

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