Documentation
¶
Index ¶
- Constants
- func Canonical(x uint32) int32
- func Freeze(p *Poly)
- func FromMont(x uint32) uint32
- func InvNTT(p *Poly) error
- func Le2QModQ(x uint32) uint32
- func ModQ(x uint32) uint32
- func NTT(p *Poly) error
- func PointwiseAccMontgomery(out *Poly, a, b []*Poly)
- func PointwiseAccMontgomeryVec(out *Poly, a, b *Vec) error
- func ReduceLe2Q(x uint32) uint32
- func SamplePolyEta(p *Poly, seed []byte, nonce uint16, eta int) error
- func SamplePolyUniform(p *Poly, seed []byte, nonce uint16) error
- func ToMont(x uint32) uint32
- type Poly
- type Vec
- func (v *Vec) Add(a, b *Vec) error
- func (v *Vec) At(i int) (*Poly, error)
- func (v *Vec) CopyFrom(src *Vec) error
- func (v *Vec) InfinityNorm() int32
- func (v *Vec) InvNTT() error
- func (v *Vec) Len() int
- func (v *Vec) NTT() error
- func (v *Vec) Polys() []*Poly
- func (v *Vec) Sub(a, b *Vec) error
- func (v *Vec) Zero()
Constants ¶
const ( // Degree of ML-DSA polynomials. N = 256 // Q is the prime modulus used by ML-DSA. Q = 8380417 // Mont is R mod q with R = 2^32. Mont = 4193792 )
Variables ¶
This section is empty.
Functions ¶
func PointwiseAccMontgomery ¶
PointwiseAccMontgomery computes sum_{i}(a_i * b_i) and stores in out.
func PointwiseAccMontgomeryVec ¶
PointwiseAccMontgomery computes the Montgomery inner product of a and b and writes the result to out.
func SamplePolyEta ¶
SamplePolyEta fills p with coefficients sampled from the centered binomial distribution with parameter eta.
func SamplePolyUniform ¶
SamplePolyUniform samples coefficients uniformly at random modulo q using SHAKE256(seed || nonce).
Types ¶
type Poly ¶
Poly represents an ML-DSA polynomial with coefficients modulo q.
func (*Poly) PointwiseMontgomery ¶
PointwiseMontgomery sets p = a * b (coefficient-wise) assuming Montgomery domain inputs.
type Vec ¶
type Vec struct {
// contains filtered or unexported fields
}
Vec represents a fixed-length vector of polynomials.
func NewVec ¶
NewVec constructs a polynomial vector with the specified length. Each entry is initialised to an empty (zero) polynomial.
func (*Vec) CopyFrom ¶
CopyFrom copies coefficients from src into v. Both vectors must have the same length.
func (*Vec) InfinityNorm ¶
InfinityNorm computes the maximum absolute coefficient (in canonical representation).