aezeed: publicly export the word field in ErrUnknownMnenomicWord
In this commit, we publicly export the `word` field as it makes it easier to programmatically interact with the package when attempting to re-derive proper `cipherseed` instances. We also add a new `Index` field as well to provide additional context for programmatic manipulating of seeds.
This commit is contained in:
3 files changed
+19
-6
No files matched your search
@@ -510,10 +510,13 @@ func (m *Mnemonic) Decipher(pass []byte) ([DecipheredCipherSeedSize]byte, error)
|
||||
// Before we attempt to map the mnemonic back to the original
|
||||
// ciphertext, we'll ensure that all the word are actually a part of
|
||||
// the current default word list.
|
||||
for _, word := range m {
|
||||
for i, word := range m {
|
||||
if !strings.Contains(englishWordList, word) {
|
||||
emptySeed := [DecipheredCipherSeedSize]byte{}
|
||||
return emptySeed, ErrUnknownMnenomicWord{word}
|
||||
return emptySeed, ErrUnknownMnenomicWord{
|
||||
Word: word,
|
||||
Index: uint8(i),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user