66
77from six import PY2
88
9- from iota import TRITS_PER_TRYTE , TryteString , TrytesCompatible , Hash
10- from iota .crypto import Curl , FRAGMENT_LENGTH , HASH_LENGTH
9+ from iota import Hash , TRITS_PER_TRYTE , TryteString , TrytesCompatible
10+ from iota .crypto import FRAGMENT_LENGTH , HASH_LENGTH
11+ from iota .crypto .kerl import Kerl
1112from iota .crypto .types import PrivateKey , Seed
1213from iota .exceptions import with_context
1314
@@ -293,7 +294,7 @@ def advance(self):
293294 self .current += self .step
294295
295296 def _create_sponge (self , index ):
296- # type: (int) -> Curl
297+ # type: (int) -> Kerl
297298 """
298299 Prepares the Curl sponge for the generator.
299300 """
@@ -311,7 +312,7 @@ def _create_sponge(self, index):
311312 else :
312313 break
313314
314- sponge = Curl ()
315+ sponge = Kerl ()
315316 sponge .absorb (seed )
316317
317318 # Squeeze all of the trits out of the sponge and re-absorb them.
@@ -338,7 +339,7 @@ def __init__(self, private_key, hash_):
338339 self ._key_chunks = private_key .iter_chunks (FRAGMENT_LENGTH )
339340 self ._iteration = - 1
340341 self ._normalized_hash = normalize (hash_ )
341- self ._sponge = Curl ()
342+ self ._sponge = Kerl ()
342343
343344 def __iter__ (self ):
344345 # type: () -> SignatureFragmentGenerator
@@ -409,7 +410,7 @@ def validate_signature_fragments(fragments, hash_, public_key):
409410 normalized_hash = normalize (hash_ )
410411
411412 for (i , fragment ) in enumerate (fragments ): # type: Tuple[int, TryteString]
412- outer_sponge = Curl ()
413+ outer_sponge = Kerl ()
413414
414415 # If there are more than 3 iterations, loop back around to the
415416 # start.
@@ -418,7 +419,7 @@ def validate_signature_fragments(fragments, hash_, public_key):
418419 buffer = []
419420 for (j , hash_trytes ) in enumerate (fragment .iter_chunks (Hash .LEN )): # type: Tuple[int, TryteString]
420421 buffer = hash_trytes .as_trits () # type: MutableSequence[int]
421- inner_sponge = Curl ()
422+ inner_sponge = Kerl ()
422423
423424 # Note the sign flip compared to ``SignatureFragmentGenerator``.
424425 for _ in range (13 + normalized_chunk [j ]):
@@ -432,7 +433,7 @@ def validate_signature_fragments(fragments, hash_, public_key):
432433 checksum [i * HASH_LENGTH :(i + 1 )* HASH_LENGTH ] = buffer
433434
434435 actual_public_key = [0 ] * HASH_LENGTH # type: MutableSequence[int]
435- addy_sponge = Curl ()
436+ addy_sponge = Kerl ()
436437 addy_sponge .absorb (checksum )
437438 addy_sponge .squeeze (actual_public_key )
438439
0 commit comments