Documentation ¶
Overview ¶
Package simplefactor is a cost function for finding prime factor pair: used to check that it is too difficult for the PSO to find the primes.
Index ¶
- type Creator
- type Fun
- func (f *Fun) About() string
- func (f *Fun) Constraint(pre TryData, hint *big.Int) (valid bool)
- func (f *Fun) CopyData(dest, src TryData)
- func (f *Fun) Cost(data TryData, cost *big.Int)
- func (f *Fun) CreateData() TryData
- func (f *Fun) DefaultParam() *big.Int
- func (f *Fun) Delete(i int) bool
- func (f *Fun) IDecode(data TryData, z *big.Int)
- func (f *Fun) MaxLen() int
- type FunTry
- type FunTryData
- type IntFunStub
- type Try
- type TryData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Creator ¶
type Creator struct {
// contains filtered or unexported fields
}
Creator is used by psokit to create instances of Fun through its interface method Create().
func NewCreator ¶
NewCreator just returns a Creator of Fun with primes p,q.
type Fun ¶
type Fun struct { //NBit is the number of bits used for the small factor Nbit int // contains filtered or unexported fields }
Fun type stores data for tests of a factor of the product pq Giving a cost of 0 if found.
func (*Fun) Constraint ¶
Constraint attempts to constrain hint possibly using a copy of pre to do this
func (*Fun) CreateData ¶
CreateData creates a empty structure for decoded try
func (*Fun) DefaultParam ¶
DefaultParam gives a default that satisfies constraints
type FunTryData ¶
type FunTryData struct {
// contains filtered or unexported fields
}
FunTryData is the decoded data structure for a try
func (*FunTryData) Decode ¶
func (d *FunTryData) Decode() string
Decode requests the function to give a meaningful interpretation of p as a Parameters subset for the function assuming p satisfies constraints
type IntFunStub ¶
type IntFunStub = futil.IntFunStub
IntFunStub gives interface to setpso
func New ¶
func New(p, q, pMin *big.Int) *IntFunStub
New creates a new function where p and q are the two prime components that make up the integer to be factorized. pMin is the smallest factor to choose