From 159ac7a87e4f9172d0771437a4c3663960c5774d Mon Sep 17 00:00:00 2001 From: uzlonewolf Date: Tue, 14 Nov 2023 20:55:15 -0800 Subject: [PATCH] Clean up crypto iv generation --- tinytuya/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tinytuya/core.py b/tinytuya/core.py index 8d496999..eba45b8d 100644 --- a/tinytuya/core.py +++ b/tinytuya/core.py @@ -251,7 +251,7 @@ def __init__(self, key): @classmethod def get_encryption_iv( cls, iv ): - if not self.CRYPTOLIB_HAS_GCM: + if not cls.CRYPTOLIB_HAS_GCM: raise NotImplementedError( 'Crypto library does not support GCM' ) if iv is True: if log.isEnabledFor( logging.DEBUG ): @@ -262,7 +262,7 @@ def get_encryption_iv( cls, iv ): @classmethod def get_decryption_iv( cls, iv, data ): - if not self.CRYPTOLIB_HAS_GCM: + if not cls.CRYPTOLIB_HAS_GCM: raise NotImplementedError( 'Crypto library does not support GCM' ) if iv is True: iv = data[:12]