Skip to content

Commit

Permalink
improved type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
PyryL committed Dec 12, 2023
1 parent 4565eed commit 9546c7f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion kyber/encryption/decrypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from kyber.constants import n, k, du, dv
from kyber.entities.polring import PolynomialRing

def decrypt(private_key, ciphertext) -> bytes:
def decrypt(private_key: bytes, ciphertext: bytes) -> bytes:
"""
Decrypts the given ciphertext with the given private key.
:returns Decrypted 32-bit shared secret
Expand Down
2 changes: 1 addition & 1 deletion kyber/encryption/encrypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def secret(self) -> bytes:
"""The 32-bit shared secret that was encrypted."""
return self._m

def encrypt(self):
def encrypt(self) -> bytes:
"""
Encrypts 32-bit random shared secret.
:returns Ciphertext
Expand Down
2 changes: 1 addition & 1 deletion kyber/encryption/keygen.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from kyber.utils.parse import parse
from kyber.entities.polring import PolynomialRing

def generate_keys() -> tuple:
def generate_keys() -> tuple[bytes, bytes]:
"""
Generates a new Kyber keypair.
:returns (private_key, public_key)
Expand Down

0 comments on commit 9546c7f

Please sign in to comment.