From cadaa348e367369b567d3be535b37a9f164cc297 Mon Sep 17 00:00:00 2001 From: Anthony Towns Date: Wed, 7 Oct 2015 13:22:44 +1000 Subject: [PATCH] test_onion.py: drop repeated sha calculation --- test/test_onion.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_onion.py b/test/test_onion.py index c631f5e08..a09983fac 100644 --- a/test/test_onion.py +++ b/test/test_onion.py @@ -174,8 +174,8 @@ class Onion(object): enckey = cls.tweak_sha(sec, b'\x00')[:16] hmac = cls.tweak_sha(sec, b'\x01') - iv = cls.tweak_sha(sec, b'\x02')[:16] - pad_iv = cls.tweak_sha(sec, b'\x02')[16:] + ivs = cls.tweak_sha(sec, b'\x02') + iv, pad_iv = ivs[:16], ivs[16:] return enckey, hmac, iv, pad_iv