Skip to content
This repository was archived by the owner on Jan 13, 2023. It is now read-only.

Commit f1aee1b

Browse files
committed
[UNSTABLE][#61] s/Curl/Kerl/g
Note: Unit tests have NOT been updated yet! Manual testing needed :3
1 parent d6b1437 commit f1aee1b

File tree

5 files changed

+15
-11
lines changed

5 files changed

+15
-11
lines changed

iota/crypto/signing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ def advance(self):
296296
def _create_sponge(self, index):
297297
# type: (int) -> Kerl
298298
"""
299-
Prepares the Curl sponge for the generator.
299+
Prepares the hash sponge for the generator.
300300
"""
301301
seed = self.seed.as_trits() # type: MutableSequence[int]
302302

@@ -316,8 +316,8 @@ def _create_sponge(self, index):
316316
sponge.absorb(seed)
317317

318318
# Squeeze all of the trits out of the sponge and re-absorb them.
319-
# Note that Curl transforms several times per operation, so this
320-
# sequence is not as redundant as it looks at first glance.
319+
# Note that the sponge transforms several times per operation, so
320+
# this sequence is not as redundant as it looks at first glance.
321321
sponge.squeeze(seed)
322322
sponge.reset()
323323
sponge.absorb(seed)

iota/multisig/crypto/addresses.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
from typing import List, Optional
66

7-
from iota.crypto import Curl, HASH_LENGTH
7+
from iota.crypto import HASH_LENGTH
8+
from iota.crypto.kerl import Kerl
89
from iota.crypto.types import Digest
910
from iota.multisig.types import MultisigAddress
1011

@@ -39,7 +40,7 @@ def __init__(self):
3940
only generate a single address.
4041
"""
4142

42-
self._sponge = Curl()
43+
self._sponge = Kerl()
4344

4445
def add_digest(self, digest):
4546
# type: (Digest) -> None

iota/transaction/base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
Optional, Sequence, Text
88

99
from iota.codecs import TrytesDecodeError
10-
from iota.crypto import Curl, HASH_LENGTH
10+
from iota.crypto import HASH_LENGTH
11+
from iota.crypto.kerl import Kerl
1112
from iota.json import JsonSerializable
1213
from iota.transaction.types import BundleHash, Fragment, TransactionHash, \
1314
TransactionTrytes
@@ -42,7 +43,7 @@ def from_tryte_string(cls, trytes, hash_=None):
4243
if not hash_:
4344
hash_trits = [0] * HASH_LENGTH # type: MutableSequence[int]
4445

45-
sponge = Curl()
46+
sponge = Kerl()
4647
sponge.absorb(tryte_string.as_trits())
4748
sponge.squeeze(hash_trits)
4849

iota/transaction/creation.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
from six import PY2
99

10-
from iota.crypto import Curl, HASH_LENGTH
10+
from iota.crypto import HASH_LENGTH
11+
from iota.crypto.kerl import Kerl
1112
from iota.crypto.signing import KeyGenerator
1213
from iota.crypto.types import PrivateKey
1314
from iota.exceptions import with_context
@@ -310,7 +311,7 @@ def finalize(self):
310311
)
311312

312313
# Generate bundle hash.
313-
sponge = Curl()
314+
sponge = Kerl()
314315
last_index = len(self) - 1
315316

316317
for (i, txn) in enumerate(self): # type: Tuple[int, ProposedTransaction]

iota/types.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
text_type
1414

1515
from iota import TRITS_PER_TRYTE, TrytesCodec
16-
from iota.crypto import Curl, HASH_LENGTH
16+
from iota.crypto import HASH_LENGTH
17+
from iota.crypto.kerl import Kerl
1718
from iota.exceptions import with_context
1819
from iota.json import JsonSerializable
1920

@@ -790,7 +791,7 @@ def _generate_checksum(self):
790791
"""
791792
checksum_trits = [] # type: MutableSequence[int]
792793

793-
sponge = Curl()
794+
sponge = Kerl()
794795
sponge.absorb(self.address.as_trits())
795796
sponge.squeeze(checksum_trits)
796797

0 commit comments

Comments
 (0)