Documentation ¶
Index ¶
- Variables
- type Field
- type Int
- func NewInt(v int64) *Int
- func NewIntFromBig(i *big.Int) *Int
- func NewIntFromBytes(buf []byte) *Int
- func NewIntFromHex(s string) *Int
- func NewIntFromString(s string) *Int
- func NewIntRnd(j *Int) *Int
- func NewIntRndBits(n int) *Int
- func NewIntRndPrime(j *Int) *Int
- func NewIntRndPrimeBits(n int) *Int
- func NewIntRndRange(lower, upper *Int) *Int
- func SqrtModP(n, p *Int) (*Int, error)
- func (i *Int) Abs() *Int
- func (i *Int) Add(j *Int) *Int
- func (i *Int) Bit(n int) uint
- func (i *Int) BitLen() int
- func (i *Int) Bytes() []byte
- func (i *Int) Cmp(j *Int) int
- func (i *Int) Div(j *Int) *Int
- func (i *Int) DivMod(j *Int) (*Int, *Int)
- func (i *Int) Equals(j *Int) bool
- func (i *Int) ExtendedEuclid(j *Int) [2]*Int
- func (i *Int) FixedBytes(n int) []byte
- func (i *Int) GCD(j *Int) *Int
- func (i *Int) Int64() int64
- func (i *Int) LCM(j *Int) *Int
- func (i *Int) Legendre(p *Int) int
- func (i *Int) Lsh(n uint) *Int
- func (i *Int) Mod(j *Int) *Int
- func (i *Int) ModInverse(j *Int) *Int
- func (i *Int) ModPow(n, m *Int) *Int
- func (i *Int) ModSign(j *Int) *Int
- func (i *Int) Mul(j *Int) *Int
- func (i *Int) Neg() *Int
- func (i *Int) NthRoot(n int, upper bool) *Int
- func (i *Int) Pow(n int) *Int
- func (i *Int) ProbablyPrime(n int) bool
- func (i *Int) Rsh(n uint) *Int
- func (i *Int) SetBit(n int, v uint) *Int
- func (i *Int) Sign() int
- func (i *Int) String() string
- func (i *Int) Sub(j *Int) *Int
- type Transformer
Constants ¶
This section is empty.
Variables ¶
var ( ZERO = NewInt(0) ONE = NewInt(1) TWO = NewInt(2) THREE = NewInt(3) FOUR = NewInt(4) FIVE = NewInt(5) SIX = NewInt(6) SEVEN = NewInt(7) EIGHT = NewInt(8) )
Number constants
Functions ¶
This section is empty.
Types ¶
type Field ¶
type Field []complex128
Field instances are input/output objects for transformation methods.
type Int ¶
type Int struct {
// contains filtered or unexported fields
}
Int is an integer of arbitrary size
func NewIntFromBig ¶
NewIntFromBig creates a new Int from a *big.Int.
func NewIntFromBytes ¶
NewIntFromBytes converts a binary array into an unsigned integer.
func NewIntFromHex ¶
NewIntFromHex converts a hexadecimal string into an unsigned integer.
func NewIntFromString ¶
NewIntFromString converts a string representation of an integer
func NewIntRndBits ¶
NewIntRndBits creates a new random value with a max. bitlength.
func NewIntRndPrime ¶
NewIntRndPrime generates a new random prime number between [0,j[
func NewIntRndPrimeBits ¶
NewIntRndPrimeBits generates a new random prime number with a maximum bitlength
func NewIntRndRange ¶
NewIntRndRange returns a random integer value within given range.
func SqrtModP ¶
SqrtModP computes the square root of a quadratic residue mod p It uses the Shanks-Tonelli algorithm to compute the square root see (http://en.wikipedia.org/wiki/Shanks%E2%80%93Tonelli_algorithm)
func (*Int) ExtendedEuclid ¶
ExtendedEuclid computes the factors (x,y) for (a,b) where the following equation is satisfied: x*a + b*y = gcd(a,b)
func (*Int) FixedBytes ¶
FixedBytes returns a byte array representation of the integer of a given size.
func (*Int) ModInverse ¶
ModInverse returns the multiplicative inverse of i in the ring ℤ/jℤ.
func (*Int) NthRoot ¶
NthRoot computes the n.th root of an Int. If upper is set, the result is raised to the next highest value.
func (*Int) ProbablyPrime ¶
ProbablyPrime checks if an Int is prime. The chances this is wrong are less than 2^(-n).
type Transformer ¶
type Transformer struct {
// contains filtered or unexported fields
}
Transformer type declaration (worker object for FF transformations).
func NewTransformer ¶
func NewTransformer(n int) (*Transformer, error)
NewTransformer creates a new transformer worker instance.
func (*Transformer) Freq2Time ¶
func (t *Transformer) Freq2Time(in Field) (Field, error)
Freq2Time transforms a frequency series into the time domain.
func (*Transformer) GetSize ¶
func (t *Transformer) GetSize() int
GetSize returns the field size for a transformation worker instance.