Skip to content

Commit

Permalink
still need to pad for hap
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco committed Jan 26, 2024
1 parent 4e7e375 commit 860a767
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyatv/support/chacha20.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def encrypt(
if nonce is None:
nonce = self.out_nonce
self._out_counter += 1
if len(nonce) < NONCE_LENGTH:
elif len(nonce) < NONCE_LENGTH:
nonce = b"\x00" * (NONCE_LENGTH - len(nonce)) + nonce
return self._enc_out.encrypt(nonce, data, aad)

Expand All @@ -59,6 +59,6 @@ def decrypt(
if nonce is None:
nonce = self.in_nonce
self._in_counter += 1
if len(nonce) < NONCE_LENGTH:
elif len(nonce) < NONCE_LENGTH:
nonce = b"\x00" * (NONCE_LENGTH - len(nonce)) + nonce
return self._enc_in.decrypt(nonce, data, aad)

0 comments on commit 860a767

Please sign in to comment.