Skip to content

Commit cadaa34

Browse files
committed
test_onion.py: drop repeated sha calculation
1 parent beb7020 commit cadaa34

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/test_onion.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ def get_ecdh_secrets(cls, sec, pkey_x, pkey_y):
174174

175175
enckey = cls.tweak_sha(sec, b'\x00')[:16]
176176
hmac = cls.tweak_sha(sec, b'\x01')
177-
iv = cls.tweak_sha(sec, b'\x02')[:16]
178-
pad_iv = cls.tweak_sha(sec, b'\x02')[16:]
177+
ivs = cls.tweak_sha(sec, b'\x02')
178+
iv, pad_iv = ivs[:16], ivs[16:]
179179

180180
return enckey, hmac, iv, pad_iv
181181

0 commit comments

Comments
 (0)