Documentation
¶
Index ¶
- Variables
- type Curve
- 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) NextProbablePrime(n int) (j *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 Kcheck
- type Knacci
- func (kn *Knacci) Factors(n int64) []*Int
- func (kn *Knacci) Next() (step int64, f []*Int)
- func (kn *Knacci) Recurrence(depth int64, check Kcheck) (f []*Int, p1, p2 int64)
- func (kn *Knacci) Reset()
- func (kn *Knacci) Solve(f1, f2, init []*Int) *Int
- func (kn *Knacci) Steps() *Int
- func (kn *Knacci) Write(wrt io.Writer) (err error)
- type KnacciECC
- type KnacciInt
- type Point
- 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) NextProbablePrime ¶ added in v1.2.32
NextProbablePrime returns the smallest prime larger than i,
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 Kcheck ¶ added in v1.2.32
Kcheck is a callback to check if a sequence element is recurring. It is the task of the calback to compute the element from the list of factors and the initial values.
type Knacci ¶ added in v1.2.32
type Knacci struct {
// contains filtered or unexported fields
}
Knacci generates a k-step Fibonacci sequence in a cyclic group C_n with elements S_i. Each S_i is a list of factors S_{i,j} (0 <= j < k). The k-nacci result v_i is computed from the initial values a_j as: v_i = Sum_{j=1}^{k}(S_{i,j}*a_j)
func ReadKnacci ¶ added in v1.2.32
ReadKnacci creates a Knacci from data in a file
func (*Knacci) Factors ¶ added in v1.2.32
Factors returns the factor list at given position. If the position is zero, the current factor list is returned.
func (*Knacci) Recurrence ¶ added in v1.2.32
Recurrence searches for a recurrence in the Fibonacci sequence. If successful, it returns the positions of the matching element (p1,p2) and the factor list at p2.
func (*Knacci) Reset ¶ added in v1.2.32
func (kn *Knacci) Reset()
Reset instance to initial conditions.
type KnacciECC ¶ added in v1.2.32
type KnacciECC struct {
*Knacci
// contains filtered or unexported fields
}
KnacciECC is a k-nacci sequence of points on an elliptic
func NewKnacciECC ¶ added in v1.2.32
KnacciECC creates a k-nacci sequence over an elliptic
func (*KnacciECC) Recurrence ¶ added in v1.2.32
Recurrence detects a recurring point. The memory only spans a limit timeframe (1e6 steps), so recurrences could possibly be missed.
type KnacciInt ¶ added in v1.2.32
type KnacciInt struct {
*Knacci
// contains filtered or unexported fields
}
KnacciInt is a k-nacci integer sequence over a cyclic group C_n.
func NewKnacciInt ¶ added in v1.2.32
NewKnacciInt instantiates a new integer-based k-nacci.
func (*KnacciInt) Recurrence ¶ added in v1.2.32
Recurrence detects a recurring value. The memory only spans a limit timeframe (1e6 steps), so recurrences could possibly be missed.
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.