func (v Vector) CheckBound(bound *big.Int) error {
	abs := new(big.Int)
	for _, c := range v {
		abs.Abs(c)
		if abs.Cmp(bound) > 0 {
			return fmt.Errorf("all coordinates of a vector should not be greater than bound")
		}
	}
	return nil
}
CheckBound checks whether the absolute values of all vector elements
are strictly smaller than the provided bound.
It returns error if at least one element's absolute value is >= bound.
package data
import (
	"fmt"
	"math/big"
	"github.com/fentec-project/bn256"
	"github.com/fentec-project/gofe/sample"
	"golang.org/x/crypto/salsa20"
)
type Vector []*big.Int
func NewVector(coordinates []*big.Int) Vector {
	return Vector(coordinates)
}
func NewRandomVector(len int, sampler sample.Sampler) (Vector, error) {
	vec := make([]*big.Int, len)
	var err error
	for i := 0; i < len; i++ {
		vec[i], err = sampler.Sample()
		if err != nil {
			return nil, err
		}
	}
	return NewVector(vec), nil
}
func NewRandomDetVector(len int, max *big.Int, key *[32]byte) (Vector, error) {
	if max.Cmp(big.NewInt(2)) < 0 {
		return nil, fmt.Errorf("upper bound on samples should be at least 2")
	}
	maxBits := new(big.Int).Sub(max, big.NewInt(1)).BitLen()
	maxBytes := (maxBits + 7) / 8
	over := uint((8 * maxBytes) - maxBits)
	lTimesMaxBytes := len * maxBytes
	nonce := make([]byte, 8)  
	ret := make([]*big.Int, len)
	for i := 3; true; i++ {
		in := make([]byte, i*lTimesMaxBytes)  
		out := make([]byte, i*lTimesMaxBytes)
		salsa20.XORKeyStream(out, in, nonce, key)
		j := 0
		k := 0
		for j < (i * lTimesMaxBytes) {
			out[j] = out[j] >> over
			ret[k] = new(big.Int).SetBytes(out[j:(j + maxBytes)])
			if ret[k].Cmp(max) < 0 {
				k++
			}
			if k == len {
				break
			}
			j += maxBytes
		}
		if k == len {
			break
		}
	}
	return NewVector(ret), nil
}
func NewConstantVector(len int, c *big.Int) Vector {
	vec := make([]*big.Int, len)
	for i := 0; i < len; i++ {
		vec[i] = new(big.Int).Set(c)
	}
	return vec
}
func (v Vector) Copy() Vector {
	newVec := make(Vector, len(v))
	for i, c := range v {
		newVec[i] = new(big.Int).Set(c)
	}
	return newVec
}
func (v Vector) MulScalar(x *big.Int) Vector {
	res := make(Vector, len(v))
	for i, vi := range v {
		res[i] = new(big.Int).Mul(x, vi)
	}
	return res
}
func (v Vector) Mod(modulo *big.Int) Vector {
	newCoords := make([]*big.Int, len(v))
	for i, c := range v {
		newCoords[i] = new(big.Int).Mod(c, modulo)
	}
	return NewVector(newCoords)
}