def __next__(self):
        # type: () -> TryteString
        """
        Returns the next signature fragment.
        """
        key_trytes = next(self._key_chunks)  # type: TryteString
        self._iteration += 1

        # If the key is long enough, loop back around to the start.
        normalized_chunk = (
            self._normalized_hash[self._iteration % len(self._normalized_hash)]
        )

        signature_fragment = key_trytes.as_trits()

        # Build the signature, one hash at a time.
        for i in range(key_trytes.count_chunks(Hash.LEN)):
            hash_start = i * HASH_LENGTH
            hash_end = hash_start + HASH_LENGTH

            buffer = signature_fragment[hash_start:hash_end]  # type: List[int]

            for _ in range(13 - normalized_chunk[i]):
                self._sponge.reset()
                self._sponge.absorb(buffer)
                self._sponge.squeeze(buffer)

            signature_fragment[hash_start:hash_end] = buffer

        return TryteString.from_trits(signature_fragment)
def __next__ ( self ) : key_trytes = next ( self . _key_chunks ) self . _iteration += 1 normalized_chunk = ( self . _normalized_hash [ self . _iteration % len ( self . _normalized_hash ) ] ) signature_fragment = key_trytes . as_trits ( ) for i in range ( key_trytes . count_chunks ( Hash . LEN ) ) : hash_start = i * HASH_LENGTH hash_end = hash_start + HASH_LENGTH buffer = signature_fragment [ hash_start : hash_end ] for _ in range ( 13 - normalized_chunk [ i ] ) : self . _sponge . reset ( ) self . _sponge . absorb ( buffer ) self . _sponge . squeeze ( buffer ) signature_fragment [ hash_start : hash_end ] = buffer return TryteString . from_trits ( signature_fragment )
Returns the next signature fragment.