Documentation ¶
Index ¶
- type Exponent
- func (p *Exponent) Add(q *Exponent) error
- func (p *Exponent) BytesAppend(existing []byte) (data []byte, err error)
- func (p *Exponent) Constant() *ristretto.Element
- func (p *Exponent) Copy() *Exponent
- func (p *Exponent) Degree() party.Size
- func (p *Exponent) Equal(other interface{}) bool
- func (p *Exponent) Evaluate(index *ristretto.Scalar) *ristretto.Element
- func (p *Exponent) EvaluateMulti(indices []party.ID) map[party.ID]*ristretto.Element
- func (p *Exponent) MarshalBinary() (data []byte, err error)
- func (p *Exponent) Reset()
- func (p *Exponent) Size() int
- func (p *Exponent) UnmarshalBinary(data []byte) error
- type Polynomial
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Exponent ¶
type Exponent struct {
// contains filtered or unexported fields
}
Exponent represents a polynomial whose coefficients are points on an elliptic curve.
func NewPolynomialExponent ¶
func NewPolynomialExponent(polynomial *Polynomial) *Exponent
NewPolynomialExponent generates a PolynomialExponent F(X) = secret•G + a1*X•G + ... + at*X^t•G, with coefficients in Z_q, and degree t.
func (*Exponent) Add ¶
Add performs coefficient-wise addition of the coefficients of p and q, and sets p to the resulting polynomial Returns an error if the length of the coefficients are different
func (*Exponent) BytesAppend ¶
func (*Exponent) Constant ¶
Constant returns the constant coefficient of the polynomial 'in the exponent'
func (*Exponent) Degree ¶
Degree returns the degree of the polynomial, the integer t such that p = F(X) = a_0•G + a_1*X•G + ... + a_t * X^t•G
func (*Exponent) EvaluateMulti ¶
EvaluateMulti evaluates a polynomial in a many given points.
func (*Exponent) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (*Exponent) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
type Polynomial ¶
type Polynomial struct {
// contains filtered or unexported fields
}
func NewPolynomial ¶
func NewPolynomial(degree party.Size, constant *ristretto.Scalar) *Polynomial
NewPolynomial generates a Polynomial f(X) = secret + a1*X + ... + at*X^t, with coefficients in Z_q, and degree t.
func (*Polynomial) Constant ¶
func (p *Polynomial) Constant() *ristretto.Scalar
func (*Polynomial) Degree ¶
func (p *Polynomial) Degree() party.Size
Degree is the highest power of the Polynomial
func (*Polynomial) Evaluate ¶
func (p *Polynomial) Evaluate(index *ristretto.Scalar) *ristretto.Scalar
Evaluate evaluates a polynomial in a given variable index We use Horner's method: https://en.wikipedia.org/wiki/Horner%27s_method
func (*Polynomial) Size ¶
func (p *Polynomial) Size() int
Size is the number of coefficients of the polynomial It is equal to Degree+1