polynomial

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandFieldElement

func RandFieldElement() (*ristretto255.Scalar, error)

RandFieldElement generates a uniformly random element in `Z_q`

Types

type Polynomial

type Polynomial []*ristretto255.Scalar

Polynomial is a set of `(t - 1)` coefficients over `Z_q`

func (Polynomial) Commit

func (p Polynomial) Commit() []*ristretto255.Element

Commit computes public commitments to the coefficients of `p`

func (Polynomial) Eval

Eval uses Horner's method to evaluate the linearized polynomial

`P(x) = a_0 + x (a_1 + x (a_2 + x (... + x (a_{t-2)+ x a_{t - 1}) ... )`

func (Polynomial) Rand

func (p Polynomial) Rand() (err error)

Rand generates a random polynomial of degree `(t - 1)` over `Z_q`

func (Polynomial) Zero

func (p Polynomial) Zero()

Zero the coefficients of the polynomial after use

Jump to

Keyboard shortcuts

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