Skip to content

Commit

Permalink
Clean up crypto iv generation
Browse files Browse the repository at this point in the history
  • Loading branch information
uzlonewolf committed Nov 15, 2023
1 parent 286f080 commit 159ac7a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tinytuya/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ):
Expand All @@ -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]
Expand Down

0 comments on commit 159ac7a

Please sign in to comment.