Ejemplo n.º 1
0
    def _get_entropy(self, size):
        random.seed()
        m = proto.Entropy()
        d = ''
        while len(d) < size:
            d += tools.generate_seed(tools.STRENGTH_HIGH, '')

        m.entropy = d[:size]
        self.set_main_state()
        return m
Ejemplo n.º 2
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()
Ejemplo n.º 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()
Ejemplo n.º 4
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
Ejemplo n.º 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