Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Element ¶
type Element uint8
func ElementByExponentOfAlpha ¶
ElementByExponentOfAlpha returns element from exponent n of α^n
type Polynomial ¶
type Polynomial struct {
// contains filtered or unexported fields
}
Polynomial means polynomial over GF(2^8)
func NewMonomial ¶
func NewMonomial(e Element, degree int) Polynomial
func NewPolynomial ¶
func NewPolynomial(bs *bitset.BitSet) Polynomial
NewPolynomial creates Polynomial from bitset when bitset has n length, polynomial is bitset[0:8]x^n-1 + bitset[8:16]x*n-2 + ... + bitset[8(n-1):8n]
func (Polynomial) Add ¶
func (f Polynomial) Add(g Polynomial) Polynomial
Add returns sum f(x) + g(x)
func (Polynomial) IsZero ¶
func (f Polynomial) IsZero() bool
IsZero returns true if polynomial has no terms
func (Polynomial) Multiply ¶
func (f Polynomial) Multiply(g Polynomial) Polynomial
Add returns product f(x) * g(x)
func (Polynomial) Remainder ¶
func (f Polynomial) Remainder(g Polynomial) Polynomial
Remainder returns remainder of f(x) / g(x)
func (Polynomial) ToByte ¶
func (f Polynomial) ToByte() []byte
ToByte convets polynomial to byte array and sort inversely
Click to show internal directories.
Click to hide internal directories.