Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
gon committed Aug 16, 2024
1 parent 1ececcc commit ecbeaed
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/nacl/bindings/crypto_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,9 @@ def crypto_box_open_afternm(
return ffi.buffer(plaintext, len(padded))[crypto_box_ZEROBYTES:]


def crypto_box_easy(message: bytes, nonce: bytes, pk: bytes, sk: bytes) -> bytes:
def crypto_box_easy(
message: bytes, nonce: bytes, pk: bytes, sk: bytes
) -> bytes:
"""
Encrypts and returns a message ``message`` using the secret key ``sk``,
public key ``pk``, and the nonce ``nonce``.
Expand Down Expand Up @@ -295,9 +297,7 @@ def crypto_box_open_easy(

plaintext = ffi.new("unsigned char[]", max(1, _mlen))

res = lib.crypto_box_open_easy(
plaintext, ciphertext, _clen, nonce, pk, sk
)
res = lib.crypto_box_open_easy(plaintext, ciphertext, _clen, nonce, pk, sk)
ensure(
res == 0,
"An error occurred trying to decrypt the message",
Expand Down

0 comments on commit ecbeaed

Please sign in to comment.