Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document the default Kyber parameters, minor fix in Kyber docs #72

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/kyber_py/kyber/default_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,30 @@
"dv": 5,
},
}
"""
Lattice parameters for the Kyber key exchange.

To be used for initialisation of :py:obj:`.Kyber` objects.
"""

# Initialise with default parameters for easy import
Kyber512 = Kyber(DEFAULT_PARAMETERS["kyber_512"])
"""
Key exchange object that uses Kyber512 parameters internally.

Provides about 128 bit level of security.
"""

Kyber768 = Kyber(DEFAULT_PARAMETERS["kyber_768"])
"""
Key exchange object that uses Kyber768 parameters internally.

Provides about 192 bit level of security.
"""

Kyber1024 = Kyber(DEFAULT_PARAMETERS["kyber_1024"])
"""
Key exchange object that uses Kyber1024 parameters internally.

Provides about 256 bit level of security.
"""
2 changes: 1 addition & 1 deletion src/kyber_py/kyber/kyber.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def encaps(self, pk, key_length=32):

:param bytes pk: byte-encoded public key
:param int key_length: length of secret key, default value 32
:return: a random key and an public of it
:return: a random key and a ciphertext of it
:rtype: tuple(bytes, bytes)
"""
# Compute random message
Expand Down