Documentation
¶
Index ¶
- type GF2nElement
- func (z *GF2nElement) Add(x, y *GF2nElement) *GF2nElement
- func (z *GF2nElement) Equal(x *GF2nElement) bool
- func (z *GF2nElement) Field() *GF2nField
- func (z *GF2nElement) Mul(x, y *GF2nElement) *GF2nElement
- func (z *GF2nElement) Pow(n uint64) *GF2nElement
- func (z *GF2nElement) SetFromElement(x *GF2nElement) *GF2nElement
- func (z *GF2nElement) SetFromValues(v uint64, field *GF2nField) *GF2nElement
- func (z *GF2nElement) Sub(x, y *GF2nElement) *GF2nElement
- func (z *GF2nElement) Value() uint64
- type GF2nField
- type GF2nPoly
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GF2nElement ¶
type GF2nElement struct {
// contains filtered or unexported fields
}
func (*GF2nElement) Add ¶
func (z *GF2nElement) Add(x, y *GF2nElement) *GF2nElement
Add will add two field elements and return their sum
func (*GF2nElement) Equal ¶
func (z *GF2nElement) Equal(x *GF2nElement) bool
return whether two elements are equal
func (*GF2nElement) Field ¶
func (z *GF2nElement) Field() *GF2nField
func (*GF2nElement) Mul ¶
func (z *GF2nElement) Mul(x, y *GF2nElement) *GF2nElement
Multiply two field elements and return their product
func (*GF2nElement) Pow ¶
func (z *GF2nElement) Pow(n uint64) *GF2nElement
Return the power of a field element to a power
func (*GF2nElement) SetFromElement ¶
func (z *GF2nElement) SetFromElement(x *GF2nElement) *GF2nElement
func (*GF2nElement) SetFromValues ¶
func (z *GF2nElement) SetFromValues(v uint64, field *GF2nField) *GF2nElement
func (*GF2nElement) Sub ¶
func (z *GF2nElement) Sub(x, y *GF2nElement) *GF2nElement
Substract a field element from another element and return their difference
func (*GF2nElement) Value ¶
func (z *GF2nElement) Value() uint64
type GF2nField ¶
type GF2nField struct {
// contains filtered or unexported fields
}
arithmetic over GF(2^n) n must be less than 64 x^n + irre must be a irreducible polynomial over GF(2^n) where irre is a polynomial over GF(2) of degree less than n
func NewGF2nField ¶
generate a binary extension field we do not check whether x^n + irre is irreducible
func (*GF2nField) IrrePolyWithoutHighest ¶
return irreducible polynomial wo/ the highest order term
func (*GF2nField) NewGF2nElement ¶
func (f *GF2nField) NewGF2nElement(v uint64) *GF2nElement
func (*GF2nField) NewGF2nPoly ¶
func (f *GF2nField) NewGF2nPoly(coeff []*GF2nElement) *GF2nPoly
type GF2nPoly ¶
type GF2nPoly struct {
Coeff []*GF2nElement
Field *GF2nField
}
func (*GF2nPoly) Eval ¶
func (f *GF2nPoly) Eval(x *GF2nElement) *GF2nElement
Click to show internal directories.
Click to hide internal directories.