def load_seed(self, seed_words): af = AlgoFactory(self.struct.algo) seed = tools.get_seed(seed_words) print 'seed', seed print 'mnemonic', tools.get_mnemonic(seed) if seed_words != tools.get_mnemonic(seed): raise Exception("Seed words mismatch") self.struct.secexp = "%x" % af.get_secexp_from_seed(seed) self._deserialize_secexp()
def _reset_device2(self, random, pin, is_otp, is_spv): self.device.set_pin(pin) self.device.set_otp(is_otp) self.device.set_spv(is_spv) seed = tools.generate_seed(random) seed_words = tools.get_mnemonic(seed) self.device.load_seed(seed_words) print "PIN:", pin print "Seed:", seed print "Mnemonic:", seed_words print "Write down your seed and keep it secret!" return proto.Success()
def reset_seed(self, random): seed = tools.generate_seed(random) seed_words = tools.get_mnemonic(seed) self.load_seed(seed_words) return seed_words
def get_mnemonic(self): return tools.get_mnemonic(self.seed)