# polynomial

package
Version: v0.5.1 Latest Latest

Go to latest
Published: Sep 21, 2021 License: Apache-2.0

## Documentation ¶

### Overview ¶

Package polynomial provides polynomial methods and commitment schemes.

### Constants ¶

This section is empty.

### Variables ¶

This section is empty.

### Functions ¶

This section is empty.

### Types ¶

#### type Polynomial ¶

`type Polynomial []fr.Element`

Polynomial polynomial represented by coefficients bn254 fr field.

`func (p *Polynomial) Add(p1, p2 Polynomial) *Polynomial`

Add adds p1 to p2 This function allocates a new slice unless p == p1 or p == p2

`func (p *Polynomial) AddConstantInPlace(c *fr.Element)`

#### func (*Polynomial) Clone ¶

`func (p *Polynomial) Clone() Polynomial`

Clone returns a copy of the polynomial

#### func (*Polynomial) Degree ¶

`func (p *Polynomial) Degree() uint64`

Degree returns the degree of the polynomial, which is the length of Data.

#### func (*Polynomial) Equal ¶

`func (p *Polynomial) Equal(p1 Polynomial) bool`

Equal checks equality between two polynomials

#### func (*Polynomial) Eval ¶

`func (p *Polynomial) Eval(v *fr.Element) fr.Element`

Eval evaluates p at v returns a fr.Element

#### func (*Polynomial) ScaleInPlace ¶

`func (p *Polynomial) ScaleInPlace(c *fr.Element)`

ScaleInPlace multiplies p by v, modifying p

#### func (*Polynomial) SubConstantInPlace ¶

`func (p *Polynomial) SubConstantInPlace(c *fr.Element)`

SubConstantInPlace subs a constant to the polynomial, modifying p