From 27ce17cd74534d59ef68286a1fcae0ffb89c3f14 Mon Sep 17 00:00:00 2001 From: dni Date: Tue, 26 Jul 2022 10:10:07 +0200 Subject: [PATCH] blacked --- lnbits/wallets/macaroon/macaroon.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lnbits/wallets/macaroon/macaroon.py b/lnbits/wallets/macaroon/macaroon.py index 1c69ca0b1..091551238 100644 --- a/lnbits/wallets/macaroon/macaroon.py +++ b/lnbits/wallets/macaroon/macaroon.py @@ -73,10 +73,10 @@ class AESCipher(object): final_key += key return final_key[:output] - def decrypt(self, encrypted: str) -> str: #type: ignore + def decrypt(self, encrypted: str) -> str: # type: ignore """Decrypts a string using AES-256-CBC.""" passphrase = self.passphrase - encrypted = base64.b64decode(encrypted) #type: ignore + encrypted = base64.b64decode(encrypted) # type: ignore assert encrypted[0:8] == b"Salted__" salt = encrypted[8:16] key_iv = self.bytes_to_key(passphrase.encode(), salt, 32 + 16) @@ -84,7 +84,7 @@ class AESCipher(object): iv = key_iv[32:] aes = AES.new(key, AES.MODE_CBC, iv) try: - return self.unpad(aes.decrypt(encrypted[16:])).decode() #type: ignore + return self.unpad(aes.decrypt(encrypted[16:])).decode() # type: ignore except UnicodeDecodeError: raise ValueError("Wrong passphrase")