mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 23:54:22 +01:00
test_onion.py: drop separate padding method
This commit is contained in:
@@ -76,15 +76,12 @@ class Onion(object):
|
|||||||
|
|
||||||
self.get_secrets()
|
self.get_secrets()
|
||||||
|
|
||||||
def padding(self):
|
|
||||||
ctx = Cipher(self.enckey, self.pad_iv, 1, ciphername='aes-128-ctr')
|
|
||||||
self.pad = ctx.ciphering(self.ZEROES)
|
|
||||||
|
|
||||||
def decrypt(self):
|
def decrypt(self):
|
||||||
self.padding()
|
ctx = Cipher(self.enckey, self.pad_iv, 1, ciphername='aes-128-ctr')
|
||||||
|
pad = ctx.ciphering(self.ZEROES)
|
||||||
|
|
||||||
ctx = Cipher(self.enckey, self.iv, 0, ciphername='aes-128-ctr')
|
ctx = Cipher(self.enckey, self.iv, 0, ciphername='aes-128-ctr')
|
||||||
self.fwd = self.pad + ctx.ciphering(self.onion[:self.fwd_end])
|
self.fwd = pad + ctx.ciphering(self.onion[:self.fwd_end])
|
||||||
self.msg = ctx.ciphering(self.onion[self.fwd_end:self.msg_end])
|
self.msg = ctx.ciphering(self.onion[self.fwd_end:self.msg_end])
|
||||||
|
|
||||||
def tweak_sha(self, sha, d):
|
def tweak_sha(self, sha, d):
|
||||||
|
|||||||
Reference in New Issue
Block a user