test_onion: minor protocol change; use single SHA to create both IVs.

Suggested-by: Anthony Towns <aj@erisian.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2015-10-07 13:08:04 +10:30
parent 0c4eb06e26
commit beb702054b
2 changed files with 9 additions and 18 deletions

View File

@@ -175,7 +175,7 @@ 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'\x03')[:16]
pad_iv = cls.tweak_sha(sec, b'\x02')[16:]
return enckey, hmac, iv, pad_iv