Documentation ¶
Index ¶
- Constants
- func Add(a []*big.Int, b []*big.Int) []*big.Int
- func Evaluate(polynomialCoefficients []*big.Int, specifiedValue *big.Int) *big.Int
- func GetPolynomialByPoints(points map[int]*big.Int) []*big.Int
- func Multiply(a []*big.Int, b []*big.Int) []*big.Int
- func RandomGenerate(degree int, secret []byte) ([]*big.Int, error)
- func Scale(a []*big.Int, k *big.Int) []*big.Int
Constants ¶
View Source
const (
// A big prime which is used for Galois Field computing
PrimeStr = "24815323469403931728221172233738523533528335161133543380459461440894543366372904768334987263999999999999999999663"
)
Variables ¶
This section is empty.
Functions ¶
func Evaluate ¶
Given the specified value, get the compution result of the polynomial 给出指定x值,计算出指定多项式f(x)的值
func GetPolynomialByPoints ¶
利用Lagrange Polynomial Interpolation Formula,通过给定坐标点集合来计算多项式 func GetPolynomialByPoints(points map[int]int) []float64 {
func RandomGenerate ¶
make a random polynomials F(x) of Degree [degree], and the const(X-Intercept) is [intercept] 给定最高次方和x截距,生成一个系数随机的多项式
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.