Documentation ¶
Index ¶
- func Lagrange(group curve.Curve, interpolationDomain []party.ID) map[party.ID]curve.Scalar
- func LagrangeFor(group curve.Curve, interpolationDomain []party.ID, subset ...party.ID) map[party.ID]curve.Scalar
- func LagrangeSingle(group curve.Curve, interpolationDomain []party.ID, j party.ID) curve.Scalar
- type Exponent
- func (p *Exponent) Constant() curve.Point
- func (p *Exponent) Degree() int
- func (*Exponent) Domain() string
- func (p *Exponent) Equal(other Exponent) bool
- func (p *Exponent) Evaluate(x curve.Scalar) curve.Point
- func (e *Exponent) MarshalBinary() ([]byte, error)
- func (e *Exponent) UnmarshalBinary(data []byte) error
- func (p *Exponent) WriteTo(w io.Writer) (int64, error)
- type Polynomial
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Lagrange ¶
Lagrange returns the Lagrange coefficients at 0 for all parties in the interpolation domain.
Types ¶
type Exponent ¶
type Exponent struct { // IsConstant indicates that the constant coefficient is the identity. // We do this so that we never need to send an encoded Identity point, and thus consider it invalid IsConstant bool // contains filtered or unexported fields }
Exponent represent a polynomial F(X) whose coefficients belong to a group 𝔾.
func EmptyExponent ¶
func NewPolynomialExponent ¶
func NewPolynomialExponent(polynomial *Polynomial) *Exponent
NewPolynomialExponent generates an Exponent polynomial F(X) = [secret + a₁•X + … + aₜ•Xᵗ]•G, with coefficients in 𝔾, and degree t.
func (*Exponent) Constant ¶
Constant returns the constant coefficient of the polynomial 'in the exponent'.
func (*Exponent) Domain ¶
Domain implements hash.WriterToWithDomain, and separates this type within hash.Hash.
func (*Exponent) MarshalBinary ¶
func (*Exponent) UnmarshalBinary ¶
type Polynomial ¶
type Polynomial struct {
// contains filtered or unexported fields
}
Polynomial represents f(X) = a₀ + a₁⋅X + … + aₜ⋅Xᵗ.
func NewPolynomial ¶
NewPolynomial generates a Polynomial f(X) = secret + a₁⋅X + … + aₜ⋅Xᵗ, with coefficients in ℤₚ, and degree t.
func (*Polynomial) Constant ¶
func (p *Polynomial) Constant() curve.Scalar
Constant returns a reference to the constant coefficient of the polynomial.
func (*Polynomial) Degree ¶
func (p *Polynomial) Degree() uint32
Degree is the highest power of the Polynomial.
func (*Polynomial) Evaluate ¶
func (p *Polynomial) Evaluate(index curve.Scalar) curve.Scalar
Evaluate evaluates a polynomial in a given variable index We use Horner's method: https://en.wikipedia.org/wiki/Horner%27s_method