Skip to content

Commit

Permalink
Annotations for nacl.bindings.crypto_hash (#714)
Browse files Browse the repository at this point in the history
  • Loading branch information
DMRobertson committed Dec 1, 2021
1 parent 89b3a40 commit 46489f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ module = [
"nacl.bindings.crypto_aead",
"nacl.bindings.crypto_box",
"nacl.bindings.crypto_core",
"nacl.bindings.crypto_hash",
"nacl.bindings.crypto_generichash",
"nacl.encoding",
"nacl.exceptions",
Expand Down
12 changes: 6 additions & 6 deletions src/nacl/bindings/crypto_hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@


# crypto_hash_BYTES = lib.crypto_hash_bytes()
crypto_hash_BYTES = lib.crypto_hash_sha512_bytes()
crypto_hash_sha256_BYTES = lib.crypto_hash_sha256_bytes()
crypto_hash_sha512_BYTES = lib.crypto_hash_sha512_bytes()
crypto_hash_BYTES: int = lib.crypto_hash_sha512_bytes()
crypto_hash_sha256_BYTES: int = lib.crypto_hash_sha256_bytes()
crypto_hash_sha512_BYTES: int = lib.crypto_hash_sha512_bytes()


def crypto_hash(message):
def crypto_hash(message: bytes) -> bytes:
"""
Hashes and returns the message ``message``.
Expand All @@ -37,7 +37,7 @@ def crypto_hash(message):
return ffi.buffer(digest, crypto_hash_BYTES)[:]


def crypto_hash_sha256(message):
def crypto_hash_sha256(message: bytes) -> bytes:
"""
Hashes and returns the message ``message``.
Expand All @@ -50,7 +50,7 @@ def crypto_hash_sha256(message):
return ffi.buffer(digest, crypto_hash_sha256_BYTES)[:]


def crypto_hash_sha512(message):
def crypto_hash_sha512(message: bytes) -> bytes:
"""
Hashes and returns the message ``message``.
Expand Down

0 comments on commit 46489f5

Please sign in to comment.