예제 #1
0
    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()
예제 #2
0
    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()
예제 #3
0
    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()
예제 #4
0
    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()
예제 #5
0
 def reset_seed(self, random):
     seed = tools.generate_seed(random)
     seed_words = tools.get_mnemonic(seed)
     self.load_seed(seed_words)
     return seed_words
예제 #6
0
 def get_mnemonic(self):
     return tools.get_mnemonic(self.seed)
예제 #7
0
 def reset_seed(self, random):
     seed = tools.generate_seed(random)
     seed_words = tools.get_mnemonic(seed)
     self.load_seed(seed_words)
     return seed_words
예제 #8
0
 def get_mnemonic(self):
     return tools.get_mnemonic(self.seed)