Documentation
¶
Index ¶
- func SampleSecret(rho []byte) (*Vec, *Vec)
- type Matrix
- type Poly
- func (p *Poly) Add(other *Poly) *Poly
- func (p *Poly) Decompose() (*Poly, *Poly)
- func (p *Poly) Equal(other *Poly) bool
- func (p *Poly) InvNTT() *Poly
- func (p *Poly) MulNTT(other *Poly) *Poly
- func (p *Poly) NTT() *Poly
- func (p *Poly) Neg() *Poly
- func (p *Poly) Norm() int64
- func (p *Poly) Pack() []byte
- func (p *Poly) PackLeGamma1() []byte
- func (p *Poly) PackLeqEta() []byte
- func (p *Poly) RNorm() int64
- func (p *Poly) SchoolbookMul(other *Poly) (*Poly, *Poly)
- func (p *Poly) String() string
- func (p *Poly) Sub(other *Poly) *Poly
- type Vec
- func (v *Vec) Add(other *Vec) *Vec
- func (v *Vec) Decompose() (*Vec, *Vec)
- func (v *Vec) DotNTT(other *Vec) *Poly
- func (v *Vec) Equal(other *Vec) bool
- func (v *Vec) IntArray() *uint32
- func (v *Vec) InvNTT() *Vec
- func (v *Vec) NTT() *Vec
- func (v *Vec) Norm() int64
- func (v *Vec) Pack() []byte
- func (v *Vec) PackLeGamma1() []byte
- func (v *Vec) PackLeqEta() []byte
- func (v *Vec) RNorm() int64
- func (v *Vec) ScalarMulNTT(sc *Poly) *Vec
- func (v *Vec) SchoolbookDot(other *Vec) (*Poly, *Poly)
- func (v *Vec) SchoolbookDotDebug(other *Vec) (*Poly, *Poly)
- func (v *Vec) SchoolbookScalarMul(sc *Poly) *Vec
- func (v *Vec) SchoolbookScalarMulDebug(sc *Poly) (*Vec, *Vec)
- func (v *Vec) String() string
- func (v *Vec) Sub(other *Vec) *Vec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SampleSecret ¶
Types ¶
type Matrix ¶
type Matrix struct {
Cs [][]*Poly
}
func SampleMatrix ¶
func (*Matrix) SchoolbookMul ¶
SchoolbookMul performs matrix-vector multiplication with InvNTT
type Poly ¶
type Poly struct {
Cs [256]int64
}
Poly represents an element of the polynomial ring Z_q[x]/<x^256+1>.
func SampleLeqEta ¶
func UnpackPoly ¶
unpackPoly unpacks a byte array into a Poly structure
func UnpackPolyLeqEta ¶
unpackPolyLeqEta unpacks a byte array into a Poly structure considering ETA
func (*Poly) PackLeGamma1 ¶
packLeGamma1 packs the coefficients with gamma1 constraint. TODO didnt check
func (*Poly) PackLeqEta ¶
packLeqEta packs the coefficients with eta constraint. TODO didnt check
func (*Poly) SchoolbookMul ¶
SchoolbookMul performs polynomial multiplication.
type Vec ¶
type Vec struct {
Ps []*Poly
}
Vec represents a vector of Polys
func UnpackVecLeGamma1 ¶
unpackVecLeGamma1 unpacks a byte slice into a Vec of length l, assuming each Poly is packed with elements bounded by Gamma1.
func UnpackVecLeqEta ¶
unpackVecLeqEta unpacks a byte slice into a Vec of length l, assuming each Poly is packed with elements bounded by Eta.
func (*Vec) PackLeGamma1 ¶
PackLeGamma1 packs the Vec with elements bounded by Gamma1
func (*Vec) PackLeqEta ¶
PackLeqEta packs the Vec with elements bounded by Eta
func (*Vec) ScalarMulNTT ¶
ScalarMulNTT multiplies each Poly in the Vec by a scalar in the NTT domain
func (*Vec) SchoolbookDot ¶
SchoolbookDot computes the dot product of two Vecs using Schoolbook multiplication
func (*Vec) SchoolbookDotDebug ¶
SchoolbookDotDebug computes the dot product with debugging??? TODO
func (*Vec) SchoolbookScalarMul ¶
SchoolbookScalarMul multiplies each Poly by a scalar using Schoolbook multiplication
func (*Vec) SchoolbookScalarMulDebug ¶
SchoolbookScalarMulDebug is a debug version of SchoolbookScalarMul