def increment_legacy_tag(self): """ Increments the transaction's legacy tag, used to fix insecure bundle hashes when finalizing a bundle. References: - https://github.com/iotaledger/iota.lib.py/issues/84 """ self._legacy_tag = \ Tag.from_trits(add_trits(self.legacy_tag.as_trits(), [1]))
def increment_legacy_tag(self): """ Increments the transaction's legacy tag, used to fix insecure bundle hashes when finalizing a bundle. References: - https://github.com/iotaledger/iota.lib.py/issues/84 """ self._legacy_tag =\ Tag.from_trits(add_trits(self.legacy_tag.as_trits(), [1]))
def _create_sponge(self, index: int) -> Kerl: """ Prepares the hash sponge for the generator. """ seed = self.seed_as_trits[:] sponge = Kerl() sponge.absorb(add_trits(seed, trits_from_int(index))) # Squeeze all of the trits out of the sponge and re-absorb them. # Note that the sponge transforms several times per operation, # so this sequence is not as redundant as it looks at first # glance. sponge.squeeze(seed) sponge.reset() sponge.absorb(seed) return sponge
def _create_sponge(self, index): # type: (int) -> Kerl """ Prepares the hash sponge for the generator. """ seed = self.seed_as_trits[:] sponge = Kerl() sponge.absorb(add_trits(seed, trits_from_int(index))) # Squeeze all of the trits out of the sponge and re-absorb them. # Note that the sponge transforms several times per operation, so # this sequence is not as redundant as it looks at first glance. sponge.squeeze(seed) sponge.reset() sponge.absorb(seed) return sponge
def increment_legacy_tag(self): sum = add_trits(self.legacy_tag.as_trits(), [1]) newSum = TryteString.from_trits(sum) self.legacy_tag = newSum