Documentation ¶
Index ¶
- Constants
- func ComplementedMnemonics(s MnemonicSettings) <-chan *aezeed.Mnemonic
- func FindMissingWords(s MnemonicSettings, callback func(progress Result))
- func FindSwappedWords(s MnemonicSettings, callback func(progress Result))
- func FindWrongWord(s MnemonicSettings, callback func(progress Result))
- type Indexer
- type InsertIndexer
- type MnemonicSettings
- type Result
- type Trials
- type WorkerPool
Constants ¶
const (
NumberOfWorkers = 32
)
Variables ¶
This section is empty.
Functions ¶
func ComplementedMnemonics ¶
func ComplementedMnemonics(s MnemonicSettings) <-chan *aezeed.Mnemonic
ComplementedMnemonics iterates over all possible mnemonics that complete the given partial mnemonic -- unvalidated.
func FindMissingWords ¶
func FindMissingWords(s MnemonicSettings, callback func(progress Result))
func FindSwappedWords ¶
func FindSwappedWords(s MnemonicSettings, callback func(progress Result))
func FindWrongWord ¶
func FindWrongWord(s MnemonicSettings, callback func(progress Result))
FindWrongWord finds a single wrong word in the mnemonic.
Types ¶
type Indexer ¶
Indexer is an interface for iterating over the search space of an incomplete or wrong mnemonic. (Named Indexer for lack of a better word).
type InsertIndexer ¶
type InsertIndexer struct {
// contains filtered or unexported fields
}
InsertIndexer is used to keep track of multiple insertion- and word indices when complementing a mnemonic.
func NewInsertIndexer ¶
func NewInsertIndexer(s MnemonicSettings, n int) *InsertIndexer
NewInsertIndexer creates an Indexer for n amount of missing words.
func (*InsertIndexer) Apply ¶
func (i *InsertIndexer) Apply(xs []string) *aezeed.Mnemonic
Apply returns a new mnemonic with the missing words inserted at the positions according to the indexer.
func (*InsertIndexer) Done ¶
func (i *InsertIndexer) Done() bool
Done returns true if the indexer has reached the end of the search space.
func (*InsertIndexer) Increment ¶
func (i *InsertIndexer) Increment()
Increment forwards the current position by the following rules: If the last sub-indexer's current word index is less than 2047, increment it. If the last sub-indexer's current word index is 2047, and the current position is less than 23, increment the current position and reset the word index. If the last sub-indexer's current word index is 2047, and the current position is 23, increment the second to last sub-indexer according to the same rules, and reset the last sub-indexer.
type MnemonicSettings ¶
type Result ¶
type Result struct { Trials Trials Password string CipherSeed *aezeed.CipherSeed Highlight []int }
type Trials ¶
func (*Trials) Percentage ¶
type WorkerPool ¶
type WorkerPool struct { Workers []*worker Out chan *aezeed.CipherSeed // contains filtered or unexported fields }
func NewWorkerPool ¶
func NewWorkerPool(n int, password string) *WorkerPool
NewWorkerPool creates a pool of size n to distribute mnemonic seed validation.
func (*WorkerPool) Close ¶
func (pool *WorkerPool) Close()
Close shuts down pool and all of its workers.
func (*WorkerPool) Consume ¶
func (pool *WorkerPool) Consume(in <-chan *aezeed.Mnemonic)
Consume reads mnemonics from channel and distributes them round-robin to its workers.